Hi,
I setup a shelly2, as a roller.
I want to use it for my shutters.
I currently have this:
- platform: command_line
covers:
rolluikwoonkamer:
command_open: curl “http://192.168.180.58/roller/0?go=open” >>/tmp/roller 2>&1
command_close: curl “http://192.168.180.58/roller/0?go=close” >>/tmp/roller 2>&1
command_stop: curl “http://192.168.180.58/roller/0?go=stop” >>/tmp/roller 2>&1
command_state: curl “http://192.168.180.58/roller/0” 2>>/tmp/roller | grep last_direction
value_template: >
{% if value == ‘open’ %}
100
{% elif value == ‘close’ %}
0
{% endif %}
But that is not working with the state topic. I think the state should be something with json?
Any an idea, below the output of the state command
curl “http://192.168.180.58/roller/0” 2>> /tmp/roller | grep last_direction
{“state”:“stop”,“power”:0.00,“is_valid”:true,“safety_switch”:false,“stop_reason”:“normal”,“last_direction”:“close”}