我开始用的mqtt通知但是有个缺点,就是每次重连MQTT服务器就会显示历史最后一次的通知。
改用http方式通知后正常。使用脚本调用
shell_command:
notify_event: 'curl -X POST --header "Content-Type: application/json" -d ''{
"name": "notify_event",
"force": true,
"icon": "{{ icon }}",
"moveIcon": false,
"repeat": 2,
"soundfile": "{{ sound }}",
"text": "{{ msg }}",
"color": [255,0,0]
}'' http://awtrix.chang:7000/api/v3/notify'
|