Make Sense of Your Sigfox Data Using Wia
Tags: iot, sigfox, wia, tutorials
Published: 2018-01-03 10:33:04

---
title: Make Sense of Your Sigfox Data Using Wia
published: true
description: Turn your Sigfox data into a human readable form using Wia Flows.
tags: iot, sigfox, wia, tutorials
---
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](https://blog.wia.io/how-to-integrate-any-sigfox-device-with-wia "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 `Flows` and click `Create Flow`.
- Enter a name for your `Flow`. I'm going to call mine `Translate Sigfox Data`.
- You will then be redirected to the Flow Studio.  

![Screen Shot 2018-01-01 at 14.48.11](//images.contentful.com/i5evrz7h2uo7/3gIRuDg17ayQUIa6gkOSIY/5e74ca322cea61a7b41b0716b7256a46/Screen_Shot_2018-01-01_at_14.48.11.png)

### Add a Trigger Node
- In the Flow Studio, drag over an Event trigger node from the panel on the left.
- Select the node, enter `sigfoxDataUplink` as the name of the Event in the panel on the right and click `Update`.  

![Screen Shot 2018-01-01 at 13.12.56](//images.contentful.com/i5evrz7h2uo7/4Ytayplm4E2AWAmKYmkyic/d628ec1f07899fb9d158b70a442f0acc/Screen_Shot_2018-01-01_at_13.12.56.png)

### Add a Logic Node
- Drag over a `Run Function` logic node from the panel on the left. This node allows you to inject your own Javascript and manipulate the data flowing through.
- Copy the code below into the `Code Block` and click `Update`.
  
```
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;
```  
  
![Screen Shot 2018-01-01 at 15.07.29](//images.contentful.com/i5evrz7h2uo7/1P82GawV6wIMO8Ss8OUeUM/dda1ea3b3369bd01b61ed186a15697dd/Screen_Shot_2018-01-01_at_15.07.29.png)
  
### Add an Output Node
- Drag over an `Event` output node from the panel on the left.
- Enter `temperature` as the name of the Event.

![Screen Shot 2018-01-01 at 15.07.21](//images.contentful.com/i5evrz7h2uo7/18ntUPD9IUSWoOgoOUsMMw/b8ad1506d4b91092aa1818ab2e3230f0/Screen_Shot_2018-01-01_at_15.07.21.png)

### 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.  

![Screen Shot 2018-01-01 at 15.07.48](//images.contentful.com/i5evrz7h2uo7/74yWEqqklacqyQMmQKcaEQ/224b7e48b36f469be0cb49a1e461f14b/Screen_Shot_2018-01-01_at_15.07.48.png)

### Add Flow to Your Device
- Go to `Devices` and select the Device your would like to add the Flow to.
- Click on `Flows` in the subnav then click on `Enable` beside 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.

![Screen Shot 2018-01-03 at 10.12.58](//images.contentful.com/i5evrz7h2uo7/3RIBfJoBS82IsCYyWacq46/77a636a32f3a5cd6d14b334b833e4091/Screen_Shot_2018-01-03_at_10.12.58.png)  


That's all folks!

P.S. If you need any help with getting setup, [tweet us](https://twitter.com/wiaio) or email [support@wia.io](mailto:support@wia.io)


*References*  
[Sigfox](https://www.sigfox.com "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.