This article is part of a series to show how to integrate Gravio with different dashboards and data visualisation platforms, and using different techniques to show your data in new and interesting ways. Today we will be showing you how to use ThingsBoard, the IoT platform, as a data visualization platform with a Gravio CO2 Sensor.
tldr; we are using a Gravio CO2 sensor and HTTPS API requests to visualise Time Series data of sensor readings over time - in real-time.
Note: if you have a Gravio Basic subscription, you could use a Temperature Sensor instead, as that will also provide Time Series data, though the data is sent less frequently.
We use HTTPS to send the data because: this is usually the minimum that a platform provider needs to support; it doesn’t require an MQTT broker setup, and allows us to focus on the core purpose: displaying information using a third party cloud-based platform.
Thingsboard is an Open Source IoT platform that has device management, data collection, processing and visualization capabilities, which they provide through a cloud offering too.
Log in to ThingsBoard and find ‘Device Group’, expand it and select ‘All’. Then, select the ‘+’ sign on the top right of the screen as shown.
Input the ‘Name’ and leave the rest of the fields unchanged. Then, select ‘Add’. A device should now be added.
You will see the device showing in the ‘All’ tab. Click on the device and copy the access token.
Note: This access token is unique to your device only. Please keep it safe as we are using it later in the Tutorial.
Now that our device has been created, we are ready to connect the data to ThingsBoard.
Run Gravio Studio:
Note: You may want to refer to their 'Getting Started Guide' for extra information for integration.
*If you are unsure about creating ‘Actions’ please visit our YouTube Channel for more details on how to navigate/use Gravio Studio.
Please enter the details in the ‘Properties’ Section as such:
Note: The other fields that are not listed here, you may leave them either unchanged or blank.
You can use the diagram below as a reference.
Next, we will enter the details in the ‘Pre-Mappings’ Section.
Let us now test the Action created. Press the Play button on Gravio Studio and if it is successful, it will display something like this in the console.
Now we will need to create the Trigger for the Action we want. In this case, we want the Trigger set up such that when a CO2 Reading has been collected by the Gravio CO2 Sensor, it will Trigger the Action to post the reading to ThingsBoard Platform.
You can refer to the following images as a reference for the steps.
Go back to ThingsBoard and go into the ‘Device Groups’ tab on the left. Select the ‘Latest Telemetry’ tab within your device. If the data sent was successful, You should see the latest telemetry value that was sent via the Gravio CO2 Sensor.
Note: If there aren't any values, you may need to refresh your browser or wait a while for it to refresh.
Time to begin the visualisation process! Go to ‘Dashboard Groups’ tab and then select the ‘+’ sign to create a new dashboard.
Select ‘Edit’ at the bottom right hand corner after creating the dashboard.
Add ‘Entity Alias’ by clicking on the top right corner icon as shown within the ‘Edit’ mode. Then, enter the details similarly to the reference picture shown. Once done, hit ‘Apply Changes’ to save the Alias.
Proceed back to the ‘Edit’ page and select ‘Add Widget’. Select ‘Cards’ and then ‘Simple Cards’. Other widgets can be used as well but we will be using ‘Cards’ for this tutorial only.
Set the ‘Card’ up by inputting the details that were configured and created in this tutorial. After the inputs, select ‘Add’. Here is a reference picture.
Yay! We have successfully created a dashboard to visualize real-time CO2 data on ThingsBoard. The integration between Gravio Studio, Gravio CO2 Sensor and ThingsBoard is complete.
Getting started with ThingsBoard was simple and straightforward. They also have great supporting documentation for the integration process which made pushing data to the dashboard for visualization very simple. If you have data connections which you would like to visualize quickly from anywhere, ThingsBoard is a great choice.