[英]Acces to thingsboard shared attribute
i'am trying to call a shared attribute for a device (thingbsoard) with the rule chain so i can apply an if statement on it, but i dont know how to do it, is there anyway that allow me to call attributes in rule chain please?我正在尝试使用规则链调用设备 (thingbsoard) 的共享属性,以便我可以在其上应用 if 语句,但我不知道该怎么做,无论如何是否允许我调用规则链中的属性请?
this is the example i used, but i'am sure that the get function is wrong.这是我使用的示例,但我确定 get function 是错误的。
var shared_att = global.getSharedAttributeValue("threshold");
if (shared_att > 50) {
// Trigger an alarm
var alarm = {
type: "Temperature",
severity: "Critical",
description: "Temperature has exceeded the threshold of 50 degrees.",
status: "Active"
};
Use Originator attributes
rule node to fetch any type of attributes.使用
Originator attributes
规则节点来获取任何类型的属性。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.