短信模板示例
更新时间:2019-06-14
告警成立、更新、解除时会发出如下格式的消息:
Plain Text
1{
2 "uuid": "1234b503-b743-4f6c-8d1f-257979a751b4",
3 "name": "风机工作温度监控",
4 "desc": "监控第2厂区2楼风机工作温度不超过60度",
5 "endpointName": "myendpoint",
6 "topic": "sensor/floor2",
7 "select": "*",
8 "condition": "temperature > 60",
9 "alarmState": 1 / 0
10 "stateDesc": “异常” / “恢复正常",
11 "notifyType": "ALARM"/ “REFERSH” / “RECOVER”,
12 "startTime": 1497244107,
13 "refreshTime": 1497244107,
14 "recoverTime": 1497244107,
15 "lastMsg": {
16 "temperature": 68.9,
17 "device": "dev0003"
18 }
19}
在填写短信服务的模板变量和报警通知方式的模板变量时,请按照如上规范。如name代表该报警通知的名称,stateDesc代表状态,消息内容则用lastMsg.temperature表示。 举例说明: 如果你的短信模板为:风机${deviceid}温度异常,当前温度${temp}。
则你的短信模板变量可以这么写(通过AS命令,将消息中的字段与短信模板中的变量关联起来):lastMsg.device AS deviceid, lastMsg.temperature AS temp。