ThingsBoard PE Feature
Only ThingsBoard Professional Edition supports Platform Integrations feature.
See ThingsBoard PE Installation Options to install ThingsBoard PE.
TheThingsIndustries is LoRaWAN network designed for connecting your devices using LoRaWAN stack. After integrating TheThingsIndustries with the ThingsBoard, you can connect, communicate, process and visualize data from devices in the ThingsBoard IoT platform.
The first step is to create an application in TheThingsIndustries console. Go to console by , open Applications section, press add application button and fill required fields.
Our device submits data in binary format. We have 2 options where to decode this data:
In this tutorial, we will make an initial transformation into JSON with TTI decoder and then use ThingsBoard converters for correct data processing. In real life scenario, it is up to you where to decode/encode data, because it is possible to do this on any side.
After application registered in TTI, go to Payload formatters, Uplink select decoder function. We will take the first byte as a temperature value from a device and transform it into JSON.
Press Save payload function
Next step is a Device creation in the TTI. Open End devices page and press Add end device
DevEUI - unique device identifier.
Fill the AppSKey by generation button.
Press Add end device button.
We need to create Integration on The Things Industries, to do this open Integrations - MQTT and press Generate new API key. Copy username and password we will need it later.
Now we can start configuring the ThingsBoard.
First, we need to create Uplink Data converter that will be used for receiving messaged from the TTI. The converter should transform incoming payload into the required message format. Message must contains deviceName and deviceType. Those fields are used for submitting data to the correct device. If a device was not found then new device will be created. Here is how payload from TheThingsIndustries will look like:
We will take device_id and map it to the deviceName and application_id map to the deviceType. But you can use another mapping in your specific use cases. Also, we will take the value of the temperature field and use it as a device telemetry.
Go to Data Converters and create new uplink Converter with this function:
For sending Downlink messages from the ThingsBoard to the device inside TTI, we need to define downlink Converter. In general, output from Downlink converter should have the following structure:
Go to Data Converters and create new downlink Converter with this function:
This converter will take version field from the incoming message and add it is a payload field in the outbound message. Destination device is a thermostat1 device.
Next we will create Integration with TheThingsIndustries inside the ThingsBoard. Open Integrations section and add new Integration with type TheThingsIndustries
Lets verify our integration.
When device sends data, we can check it in the ThingsBoard, to do this:
Go to Device Group -> All -> thermostat1 - you can see that
For testing Downlink Messages, we will update our Root Rule Chain to send downlink message when device attribute is changed. Open and edit Root Rule Chain. Add Integration Downlink Action node and connect it with the Message Type Switch Node using relation Attributes Updated
Go to Device Group -> All -> thermostat1 -> attributes section. We will add Shared attribute with name version and value v.0.11
By making this step, we triggered downlink message to the device thermostat1 and this message should contains version field value.
Open TTI Console, navigate to thingsboard-integration application, to the section Data.
And we see that Downlink message was received (It is displayed as bytes 76 2E 30 2E 31 31).
With this integration you can also configure Downlink converters and trigger required actions using Rule Engine nodes.
入门指南 - 这些指南提供了ThingsBoard主要功能的快速概述。
安装指南 - 了解如何在各种操作系统上安装ThingsBoard。
数据看板 - 这些指南包含有关如何配置复杂的ThingsBoard仪表板的说明。
数据处理 - 了解如何使用ThingsBoard规则引擎。
数据分析 - 了解如何使用规则引擎执行基本的分析任务。
硬件样品 - 了解如何将各种硬件平台连接到ThingsBoard。
高级功能 - 了解高级ThingsBoard功能。
开发指南 - 了解ThingsBoard中的贡献和开发。