https://thingsboard.io/docs/user-guide/rule-engine-2-0/tutorials/add-devices-to-group/
导入json规则链
Let’s assume your device is reporting temperature readings to ThingsBoard and you would like to visualize devices that have reported temperature > 50°C.
假设您的设备正在向ThingsBoard报告温度读数,并且您想要可视化报告温度>50°C的设备。
In this tutorial we will configure ThingsBoard Rule Engine to automatically update “High temperature devices” group members based on incoming temperature readings from the device. You can use this tutorial as a basis for much more complex filtering.
在本教程中,我们将配置ThingsBoard规则引擎,以根据来自设备的传入温度读数自动更新“高温设备”组成员。您可以使用本教程作为更复杂的过滤的基础。
节点B:脚本过滤器节点 | 检查来自设备的传入消息是否包含温度读数。如果来自设备的消息包含温度读数,则将其转发到节点C | |
---|---|---|
节点C:脚本过滤器节点 | 检查传入消息的温度是否大于50°C。如果温度>50°C,则将消息转发到节点D。如果温度<=50°C消息被转发到节点E | |
节点D:添加到组节点 | 将设备添加到组。通过替换deviceType元数据值来构造组名。根据需要自动创建设备组 | |
节点E:从组节点中删除 | 从组中删除设备。通过替换deviceType元数据值来构造组名 |