Solution template successfully installed
close
Solution instructions
As part of this solution, we have created the "Temperature & Humidity" dashboard that displays data from multiple sensors. You may use the
dashboard to:
add new sensors;
change the location of the sensors;
configure the alarm thresholds;
browse historical data.
The dashboard has two states. The main state displays the list of the sensors, their location on the map as well as the list of their alarms. You
may drill down to the sensor details state by clicking on the table row. The sensor details state allows to browse temperature and humidity
history, change sensor settings and location.
You may always customize the "Temperature & Humidity" dashboard using dashboard development guide.
Devices
We have already created two sensors and loaded some demo data for them. See device info and credentials below:
Device Customer
Access token
name name
NvgOcm8qwyUZYJ7d25
U8
Sensor T1
Click to copy
Device Customer
Access token
name name
91fK2FO1PhOctRKQ33i
W
Sensor C1 Customer D
Click to copy
Solution expects that the sensor device will upload "temperature" and "humidity" values. The most simple example of the expected payload is
in JSON format:
{"temperature": 42, "humidity": 73}
Click to copy
To emulate the data upload on behalf of device "Sensor T1", one should execute the following command:
curl -v -X POST -d "{\"temperature\": 42, \"humidity\": 73}"
https://thingsboard.cloud/api/v1/NvgOcm8qwyUZYJ7d25U8/telemetry --header "Content-
Type:application/json"
Click to copy
The example above uses HTTP API. See connecting devices for other connectivity options.
Alarms
Alarms are generated using two Alarm rules in the "Temperature Sensor" device profile. User may turn alarms on and off as well as configure
the alarm thresholds via the "Temperature & Humidity" dashboard using "Edit Sensor" form.
Customers
"Sensor C1" is assigned to a newly created customer "Customer D". You may notice that "Customer D" has two users, and the "Temperature
& Humidity" dashboard is accessible for those users. You may create more Customers and more Users via administration UI.
Customer
Name Login Password User Group
name
customer
hugh.farr@thingsboard.io
Click to Customer
Hugh Farr Click to copy Customer D
copy Administrators
eric.hickman@thingsboar customer
Eric d.io Click to Customer
Customer D
Hickman Click to copy copy Administrators
Solution entities
As part of this solution, the following entities were created:
Name Type Owner
Read Only Role Tenant
Temperature & Humidity Sensors Rule chain Tenant
Temperature & Humidity Sensors (Remote
Rule chain Tenant
Facility)
Name Type Owner
Device
Temperature Sensor Tenant
profile
Customer D Customer Tenant
Sensor T1 Device Tenant
Customer
Sensor C1 Device
D
Temperature & Humidity Dashboard Tenant
Customer
hugh.farr@thingsboard.io User
D
Customer
eric.hickman@thingsboard.io User
D
Customer
Remote Facility R1 Edge
D
Edge computing
Optionally, this solution can be extended to use edge computing.
ThingsBoard Edge allows bringing data analysis and management to the edge, where the data created. At the same time ThingsBoard Edge
seamlessly synchronizing with the ThingsBoard cloud according to your business needs.
As example, in the context of Temperature & Humidity Sensors solution, edge computing could be useful if you have remote facilities that
are located in different parts of town, country or worldwide. In this case, ThingsBoard Edge can be deployed into every remote facility to
process data from temperature and humidity sensors, enabling real-time analysis and decision-making, such as turning on/off heater or
adjusting temperature automatically. Edge is going to process data in case there is no network connection to the central ThingsBoard server,
and thus no data will be lost and required decisions are going to be taken locally. Eventually, required data is going to be pushed to the cloud,
once network connection is established. Configuration of edge computing business logic is centralized in a single place - ThingsBoard server.
In the scope of this solution, new edge entity Remote Facility R1 was added to a customer "Customer D".
Additionally, particular entity groups were already assigned to the edge entity to simplify the edge deployment:
"Customer Administrators" USER group of customer "Customer D";
"Temperature & Humidity sensors" DEVICE group of customer "Customer D";
"Customer dashboards" DASHBOARD group of your tenant.
To install ThingsBoard Edge and connect to the cloud, please navigate to edge details page and click Install & Connect instructions button.
Once the edge is installed and connected to the cloud, you will be able to log in into edge using your tenant or users of customer "Customer
D" credentials.
Push data to device on edge
"Temperature & Humidity sensors" DEVICE group of customer "Customer D" was assigned to the edge entity "Remote Facility R1". This
means that all devices from this group will be automatically provisioned to the edge.
You can see devices from this group once you log in into edge and navigate to the Entities -> Devices page.
To emulate the data upload on behalf of device "Sensor C1" to the edge, one should execute the following command:
curl -v -X POST -d "{\"temperature\": 43, \"humidity\": 74}"
http://localhost:8080/api/v1/91fK2FO1PhOctRKQ33iW/telemetry --header
"Content-Type:application/json"
Click to copy
Or please use next command if you updated edge HTTP 8080 bind port to 18080 during edge installation:
curl -v -X POST -d "{\"temperature\": 43, \"humidity\": 74}"
http://localhost:18080/api/v1/91fK2FO1PhOctRKQ33iW/telemetry --header "Content-
Type:application/json"
Click to copy
Once you'll push data to the device "Sensor C1" on edge, you'll be able to see telemetry update on the cloud for this device as well.