When measuring foot traffic, you are recording how many people enter or exit a space, and how often that area is used. This technology allows us to answer questions such as:
Monitoring the usage of space is a common request we get all the time at Losant. From a technical perspective, there are many ways to attack problems of this nature. However, not too long ago, I was introduced to a new solution that aims to solve this problem. Dor is a foot traffic solution that’s accurate, affordable, and easy to install in any location.
Dor provides data almost instantaneously after installation. Best of all, it can integrate directly with Losant. With Losant, you have the opportunity to integrate Dor with any other service, build complex business logic on top of the sensor data, and build custom websites and applications.
In this blog post, I am going to describe how to send foot traffic data from Dor into Losant and make use of it.
Dor provides a simple REST, JSON based API that allows you to receive your foot traffic data programmatically.
First, you’ll need to contact Dor for an API token. Once you have a token, you’ll have access to their Foot Traffic API. Here is the URI to obtain this information:
/teams/:team_id/devices/:device_type_name/:serial_number/foot_traffic
_events
Using Losant we can authenticate and call this API to obtain our foot traffic data on a specific interval.
The sensor will report foot traffic to Dor on a (configurable) interval. My device is reporting once an hour, which is the default. Using a Losant Workflow, we can build a workflow to facilitate the communication between Dor and Losant.
To accomplish this, we can use the Timer Node to poll the Dor API once an hour to receive all the foot traffic data since Losant last checked. Here is that exact workflow:
This workflow contains two Trigger Nodes. The four-node flow on the right is to authenticate, and reauthenticate, to Dor ever hour. Every hour this flow will make an HTTP request to obtain a new authentication token and save it in the workflow’s local storage.
In the left flow, every hour we follow the following steps:
let last_dor_point = new Date(payload.data.last_dor_point);
payload.dor = {};
payload.dor.end = payload.time.toISOString();
payload.dor.start = last_dor_point.toISOString();
https://api.getdor.com/v1/teams//devices///foot_traffic_events?start=&end=&order=desc
With this workflow, every hour we can save all the foot traffic events to Losant, and make sure Losant is always authenticated to Dor’s API.
Now that we have data flowing into Losant, we can start to build on top of it.
Losant makes it easy for you to answer new questions about the data you are collecting. For example: Can we be alerted when someone walks in after hours? Yes, you can. This task is done by adding two nodes to our existing workflow: A Time Range Node and an Email Node.
The Time Range Node allows a workflow to perform actions based on the time the workflow was triggered. The Email Node can send an email with a custom body that can even pull from your sensor data if desired. All in all, when there is traffic during the off times, you’ll get an email.
Now that your foot traffic data is integrated to Losant, there are endless possibilities. With Losant, you can tie your Dor data to any other critical system you may have to provide you with the more comprehensive view.
Along with custom dashboards, you can:
Here at Losant, we are interested to see what problems you are trying to solve with foot traffic. If you have any questions or feedback, please leave a comment or contact us.