All Collections
Connect your Devices
Connect Seeed Studio's SenseCAP S2120 8-in-1 weather station to Ubidots[Helium LNS]
Connect Seeed Studio's SenseCAP S2120 8-in-1 weather station to Ubidots[Helium LNS]

This articles describes how to connect the SenseCAP S2120 8-in-1 weather station to Ubidots

Juan David Tangarife avatar
Written by Juan David Tangarife
Updated over a week ago
image 2168.png

Requirements:

Table of Contents

1. Configure the SenseCap S2120 for Helium LNS

  • Please follow section #1 of the following guide. The only thing you have to take into account is to select Helium as the platform instead of the other platform shown in that guide,

2. Register the SenseCap S2120 on Helium LNS

  • Please follow section #2 of the following guide.

3. Create the Integration to Ubidots

  • Please follow section #3 of the following guide.

4. Configure the decoder function

  • Go to "Functions" section on your Helium Console

  • Click on "Create new function" button

  • Click "Custom"

  • Set a name for your decoder function

  • Delete all the code in the textbox

  • Paste the following code which is supported officially by Seeed Studio on their GitHub repository

  • Click on "Save Function" button

5. Connect the Integration to Ubidots

  • Please follow section #5 of the following guide

6. Configure the Ubidots decoder

  • Go to your Ubidots account

  • Go to "Devices" --> "Plugins"

  • Search for a newly created plugin. Its name is most likely to be "Helium integration"

  • Click on the pencil icon

  • Head to the "Decoder" section at the left side of the screen

  • Scroll down to the "Decoding Function" section and delete all the code present in the textbox

  • Paste the following code

  • Click on "SAVE & MAKE LIVE" button to save the changes

Decoder function code:

def format_payload(args):

# Log received data for debugging purposes:
print(args)
ubidots_payload = {}
incoming_data = args["decoded"]["payload"]["data"]["messages"]
LabelMap = {
"4097":"air-temperature",
"4098":"air-humidity",
"4099":"light-intensity",
"4190":"uv-index",
"4105":"wind-speed",
"4104":"wind-direction",
"4113":"rainfall-hourly",
"4101":"barometric-pressure",
};

ubidots_payload["port"] = args["port"]
ubidots_payload['SNR'] = args['hotspots'][0]['snr']
ubidots_payload['RSSI'] = args['hotspots'][0]['rssi']
ubidots_payload['Frame Counter'] = args['fcnt']

for list in incoming_data:
for JSON in list:
if JSON.get("measurementId",None) is not None:
ubidots_payload[LabelMap[JSON["measurementId"]]] = JSON["measurementValue"]
if JSON.get("Battery(%)", None) is not None:
ubidots_payload["battery"] = JSON["battery"]

return ubidots_payload

7. Visualize the Data on Ubidots

  • Head to the “Devices” section on your Ubidots account and you’ll be able to see a newly create device with the same name as you used for “Device name” at step 2.

8. Feedback, Suggestion and Related Articles

Feel free to post questions or suggestions in our community portal, or contact us via support@ubidots.com.


Other users also found helpful...

Did this answer your question?