Yesterday we had a day of exploring cutting edge of sensor technology at SENSOR+TEST. Great to see...
Tool tracking in Airtable with a Bluetooth sensor
Airtable is spreadsheets re-imagined for the web and is used by lots of people - from sports teams to marketing departments to factory operations teams.
I thought it would be interesting to see how quick it would be for someone in one of those teams to log the usage of a particular piece of equipment in an Airtable using Blecon. Let's see how we get on!
I can connect Blecon directly to Airtable, because Airtable supports webhook triggers. Great!
To replicate this setup, you'll need an Airtable Pro subscription in order to use the scripting feature we will require. Let's get started.
Create a Blecon Network and add a sensor
- Open the Blecon console at https://console.blecon.net.
- Click Create Blecon Network and choose any name.
- Connect a sensor by scanning the Network QR code with your phone, then tapping your phone against a Blecon Device.
Let's use the Blecon B1 motion sensor to detect the usage of a particular piece of equipment. Here we have this very well-used impact driver. The B1 is of course waterproof and shock resistant so we don't need to worry too much about how it's handled.
- Log into Airtable and open a new table
- Set up the table like this:
Note that the column type of the Timestamp column should be like this:
Connecting Blecon to Airtable
We need to tell Blecon where to send sensor events. Here's how you do that.
- Open the table you created earlier in Airtable.
- Go to Automations at the top, and then choose Add Trigger, then Webhook.
- Now Airtable will generate a webhook URL for you, here:
- Copy that webhook URL and then in the Blecon Console, enter that as the Handler URL in your network configuration. That's all you need to do on the Blecon side.
Completing the setup on Airtable
To populate our Airtable, we need to add a small script so that our Blecon sensor data is represented correctly in our Airtable.
- Staying in the Automations screen from the previous step, click Add Action, then choose Run Script.
- In the code section, paste the following script:
- Now you need to set up the inputs to the script. You need to create four inputs, named length, timestamps, types, and device. You do this by finding the input you want within the JSON sent by Blecon.
- Create the length input by going to request_data, then records, and length
- Create timestamps and types by going to request_data, records, then the respective item
- Create Device ID by going to network_headers then choose device_id
- When you're sure you've created those inputs with the right names, you can click Finished editing, and you're done!
Visualising the data
If you've completed those steps, you should already be seeing data flowing into your table.
Let's say however we want to make this more useful, and have a graph of tool usage over time. What we want to do first is bucket our events by hour.
- Create a new column named Buckets.
- Set this column to a Formula type and paste the following formula:
- You should now see buckets by date appear like this:
- This represents the hour and date of the tool movement event. Now with this, we can make a graph.
- Go to the Extensions section of Airtable, and add a bar chart.
- Set up the chart as below:
Conclusion and results
Here's how our tool tracker is looking. I've added another sensor to my Blecon network so this is tracking the usage of two tools.
I think the combination of Blecon cloud native sensors and modern productivity tools such as Airtable is an extremely powerful one. If we can put real-world data into the hands of everyone, there's no limit to its applications in areas such as energy efficiency, business processes, or healthcare, just to name a few.
What do you think?
Blecon is in limited preview and is currently available to Early Access members. Contact us or apply for Early Access.