Make Sense of Your Sigfox Data Using Wia
Hey All, Today we’re going to look at turning your Sigfox data into a human readable form that you can easily use in your applications. Before we start, have a look at the How To Integrate Any Sigfox Device With Wia tutorial to get your devices connected to Wia.
For this tutorial, my Event data will contain the hexadecimal string
aabbccdd. We will show how to convert this to binary, take the first 6 bits as our temperature reading and create a new Event.
Create a Flow
- Go to the
- Enter a name for your
Flow. I'm going to call mine
Translate Sigfox Data.
- You will then be redirected to the Flow Studio.
Add a Trigger Node
- In the Flow Studio, drag over an Event trigger node from the panel on the left.
- Select the node, enter
sigfoxDataUplinkas the name of the Event in the panel on the right and click
Add a Logic Node
- Drag over a
- Copy the code below into the
Code Blockand click
let sigfoxData = event.data.sigfoxData;
let binaryData = parseInt(sigfoxData, 16).toString(2);
let tempBinary = binaryData.slice(0, 6);
let result = parseInt(tempBinary, 2).toString(10);
event.data = result;
Add an Output Node
- Drag over an
Eventoutput node from the panel on the left.
temperatureas the name of the Event.
Connect the Nodes
- Click on the white diamond shape at the bottom of the Event node and drag the line to the input of the Logic node.
- Click on the white diamond shape at the bottom of the Logic node and drag the line to the input of the Output node.
Add Flow to Your Device
- Go to
Devicesand select the Device your would like to add the Flow to.
- Click on
Flowsin the subnav then click on
Enablebeside the Flow name.
Run the Flow
Publish an Event from the Device and you will see the new
temperature Event come through.
(Optional) Create Multiple Events in the Same Flow
If you wish to create multiple events, just follow the previous steps for your other data points.
That’s all folks!
Sigfox is a French Internet of Things (IoT) company founded in 2009 that builds wireless networks to connect low-energy narrowband objects such as electricity meters, smartwatches, and washing machines, which need to be continuously on and emitting small amounts of data.
Originally published at gist.github.com.