thingsboard / thingsboard-gateway

Open-source IoT Gateway - integrates devices connected to legacy and third-party systems with ThingsBoard IoT Platform using Modbus, CAN bus, BACnet, BLE, OPC-UA, MQTT, ODBC and REST protocols
https://thingsboard.io/docs/iot-gateway/what-is-iot-gateway/
Apache License 2.0
1.76k stars 846 forks source link

[HELP]gateway should mix devices and connections 1toM and Mto1 #1460

Closed Jonnik84 closed 1 month ago

Jonnik84 commented 4 months ago

Hi. I’m attaching a small diagram to help to understand my question.

gateway.pdf

In my opinion, Gateway is a device that should transform data from one system to another system and that’s why there should be no direct connection between connectors and cloud devices.

For example, I have one modbus IO module, to which I connect several temperature sensors. For now there is no problem to create several modbus slaves in one connector each for different device in the cloud, aimed to get different registers from this IOModule. Gateway UI dashboard, I will see those devices and their connector will be the same for all of them.

image

but there is a problem when I have several IO modules, that I need to maintain into one cloud device in this case, system doesn’t work. device cannot be displayed correctly ( it collects data to one device from different connectors.) UI doesn’t simply have such functionality. It’s possible now to display only one connector for device….

For me, it’s mission critical for Gateway to have such ability.

imbeacon commented 3 months ago

Hi @Jonnik84,

At the moment, the gateway cannot act like this, but you can use rule chains to guide the telemetry for one device to another or to the both of them.

Jonnik84 commented 3 months ago

@imbeacon thanks for suggestion But I don't get. please explain. :)))

So I need to create several cloud devices for each connector and send telemetry between them with rule chains??

imbeacon commented 3 months ago

Particularly you are right. When data arrives to ThingsBoard, you have a post telemetry message in rule chains, with originator - device, configured in the connector configuration. I have created just an example rule chain, you can play with it to understand on how to duplicate message to another device, new device will be created automatically in this rule chain. It is just an example, but not a solution for yout case, please adjust it for your needs. test_message_splitting.json

Example on how to connect it in root rule chain is the following, don’t forget to check is device name in metadata (yellow switch in right side on screenshot) is equal to “base” device.

Screenshot 2024-07-30 at 10 29 57