Propagate telemetry from the device to the corresponding asset in Thingsboard

85 Views Asked by At

I have a thingsboard device to which up to 3 temperature sensors are connected via SPI. Each sensor monitors the temperature of one refrigerator (asset).

The device SPI port to which the different asset sensor is connected doesn't change with time, e.g. port_1 -> Fridge 22, port_2-> Fridge 23, port_3 -> Fridge 44.

I need to propagate the telemetry from the device to the corresponding asset. Note that each device is related to up to 3 assets.

It is easy if one device is related to only one asset, as shown here, but I don't know in this case.

How can I do that?

1

There are 1 best solutions below

0
On

You can do it by creating 3 relation types for your device:

enter image description here

Just replace Test Assets with your refrigerators.

Now go to your device rulechain and add those nodes: enter image description here

Lets suppose that you are posting this telemetry data from your device to thingsboard:

{
   "asset1_temp":1,
   "asset2_temp":2,
   "asset3_temp":3
}

enter image description here

enter image description here

enter image description here

I tried and it works well, all of 3 assets have received the telemetry:

Test Asset 1: {"temperature":1}

Test Asset 2: {"temperature":2}

Test Asset 3: {"temperature":3}