Pre-installed application - preparation for dispatching values to ThingsBoard

The values obtained from the sensor and the count can also be sent to a ThingsBoard IoT platform via MQTT. Three MQTT messages for the dispatch of the temperature, humidity and counter values are configured for this. In order to send the values to your ThingsBoard IoT platform, you only need to configure the MQTT broker of your ThingsBoard IoT platform before (see here). An event that is regularly triggered by an interval timer will dispatch the messages. Another event sends the temperature value with each change of the temperature.

Configuration of the messages

Menu MessagesMQTT → edit mqttMsg4 - Push_Temperature_Thingsboard ()

This message transmits the flag flag1, which contains the temperature value (refer to Converting the sensor values), under the topic v1/devices/me/telemetry to the ThingsBoard MQTT broker.

de app thingsboard temp

Menu MessagesMQTT → edit mqttMsg5 - Push_Humidity_Thingsboard ()

This message transmits the flag flag2, which contains the humidity value (refer to Converting the sensor values), under the topic v1/devices/me/telemetry to the ThingsBoard MQTT broker.

de app thingsboard hum

Menu MessagesMQTT → edit mqttMsg6 - Push_Counter_Thingsboard ()

This message transmits the flag flag3, which contains the count, under the topic v1/devices/me/telemetry to the ThingsBoard MQTT broker.

de app thingsboard count
The flags flag1, flag2 and flag3 are entered in the JSON format required by ThingsBoard.

Configuration of the message dispatch

The following events are disabled in the default configuration and must first be activated manually to be able to trigger a message dispatch. To do this, activate in the menu Events the checkbox active in front of the respective event.

Menu Data pointsTimer → edit Send_Interval ()

A timer of the type Interval is added here, which expires (triggers) every five minutes.

de app mqtt timer

Menu Events → edit Push_Temperature_Event_Thingsboard ()

An event is added here, which triggers an action with each expiry of the timer timer1 - Send_Interval, which sends the message mqttMsg4 - Push_Temperature_Thingsboard.

de app thingsboard event temp

Menu Events → edit Push_Humidity_Event_Thingsboard ()

An event is added here, which triggers an action with each expiry of the timer timer1 - Send_Interval, which sends the message mqttMsg5 - Push_Humidity_Thingsboard.

de app thingsboard event hum

Menu Events → edit Push_Counter_Event_Thingsboard ()

An event is added here, which triggers an action with each expiry of the timer timer1 - Send_Interval, which sends the message mqttMsg6 - Push_Counter_Thingsboard.

de app thingsboard event count

Menu Events → edit Push_Temperature_Change_Event_Thingsboard ()

An event is added here, which triggers an action with each change of the analogue data point flag1 - Temperature, which sends the message mqttMsg4 - Push_Temperature_Thingsboard.

de app thingsboard event change temp