Sitemap

Create device using telemetry data using rule engine:Thingsboard

2 min readFeb 21, 2023

--

In this article, device provisioning using telemetry data is discussed. The use case considered in BLE gateway reading BLE beacons or tags.

Steps followed:

  1. Create Profile in Thingsboard:https://thingsboard.io/docs/user-guide/device-profiles/
Creating Device Profile

2. To create device through API , Thingsboard provides two keys with these keys we will be able to create device.

Press enter or click to view image in full size

3. Create rule engine or import rule engine using json:

Press enter or click to view image in full size

4. Edit the payload to add provision key from the profile :

Press enter or click to view image in full size
payload is added with provision key

This payload creates devices based on the key present in telemetry key of interest.

Get Bytemate Pvt Ltd’s stories in your inbox

Join Medium for free to get updates from this writer.

5. The MAC id of BLE tag or some unique identifier can be made as device id as shown below

Press enter or click to view image in full size
“deviceName” key create the device

6. REST api plugin with end point http://demo.thingsboard.io/api/v1/provision will create devices

7. Update the payload of each BLE beacon or tag in its particular device latest telemetry is done by changing the originator.

8. Example payload to be published by simulator or real BLE Gateway after reading tags

JSON payload

Reference links:

  1. https://thingsboard.io/docs/user-guide/ui/devices/
  2. https://thingsboard.io/docs/iot-gateway/
  3. https://thingsboard.io/docs/iot-gateway/config/mqtt/
  4. https://www.mokosmart.com/mokosmart-mkgw1-gateway-iot-cloud-platform/

--

--