Hi all,
i change firmware of a sonos dual R2 and connect via mqtt to HA.
I define it as a cover in order to control a sun rollershutter (awning).
The motor who move the awning doesn’t report the position so i need, when i press the open or close button (and then via automation) define how many seconds the relays is in ON state.
How i can configure it?
cover:
- platform: mqtt
state_topic: "stat/sonoff02/POWER"
command_topic: "cmnd/sonoff02/Backlog"
# command_topic: "cmnd/sonoff01/power"
# state_topic: "stat/sonoff01/POWER"
name: "Tenda"
qos: 0
retain: true
payload_open: "power1 on"
payload_close: "power2 on"
payload_stop: "power1 off;power2 off"
state_open: "ON"
state_closed: "OFF"
optimistic: false
value_template: "
{% if value_json.POWER1 == 'OFF' and value_json.POWER2 == 'OFF' %} 50
{% elif value_json.POWER1 == 'OFF' %} 100
{% elif value_json.POWER2 == 'ON' %} 0
{% endif %} "