shell_command:
update_to_lewei: /usr/bin/curl --request POST http://www.lewei50.com/api/V1/Gateway/UpdateSensors/01 --data "[{'Name':'S1','Value':{{states.sensor.interface4ifoutoctets.state}}},{'Name':'S2','Value':{{states.sensor.interface4ifinoctets.state}}}]" --header 'userkey:2829af5614f54bf6b07738c2da6*****'
shell_command:
update_to_lewei: /usr/bin/curl --request POST http://www.lewei50.com/api/V1/Gateway/UpdateSensors/01 --data "[{'Name':'S1','Value':{{states.sensor.interface4ifoutoctets.state}}},{'Name':'S2','Value':{{states.sensor.interface4ifinoctets.state}}}]" --header 'userkey:2829af5614f54bf6b07738c2da6*****'
添加自动化,默认是1分钟上传一次
- alias: run_lewei50
trigger:
platform: time
# You can also match on interval. This will match every 5 minutes
minutes: '/1'
seconds: 00
action:
service: shell_command.update_to_lewei