Hi
I am trying to create an automation that sets my Shelly 2 roller shutter to a specific position and then tilts the slats of the shutter slightly.
The challenge here is, that the Shelly 2 doesn’t appear to support the “tilt” feature, so I had to sort of create a workaround. I had previously done this in Tasker and it worked just fine. The way this worked was to
- set the position of the roller shutter
- wait until shutter movement stops
- open the shutter
- wait 800 milliseconds
- stop the shutter
That way the slats were positioned in a slightly tilted position.
This is how I reproduced it in HA:
- id: 'XXXXXXXXXXX
alias: TS down when bright
trigger:
- above: '7'
below: '40'
entity_id: sensor.sun_elevation
platform: numeric_state
condition:
- below: '75'
condition: numeric_state
entity_id: sensor.weather_cloudiness
- after: '15:00:00'
before: '22:00:00'
condition: time
action:
- data:
cover_position: '38'
entity_id: cover.tv_shutter
service: cover.set_cover_position
- delay: '00:00:27'
- data:
entity_id: cover.tv_shutter
service: cover.cover_open
- delay: '00:00:00.9'
- data:
entity_id: cover.tv_shutter
service: cover.cover_stop
I have two problems with this:
-
I don’t know how to get the roller shutters movement status, so I don’t know when it has stopped. Per documentation, the Shelly 2 should provide “open”, “close” and “stop” as state topics via MQTT, but I have no idea how to retrieve those. For now, I have added a 27-second delay in the automation, that works ok. It would be nicer to be able to wait for the state changing to “stop” and then move on though.
-
the second problem is the tilting at the end. The 900 milliseconds worked fine in Tasker, but is not working at all in HA. The automation seems to ignore the delay and the “stop” call at the end and the shutter just goes on opening all the way. I tried a 1 second delay, that registers fine, but its no good as the shutter just opens the slats all the way and actually moves a little bit back open before stopping.
Has anyone tried to create something similar and succeeded? Is there another way to achieve slats tilt?
This is my entity in configuration.yaml:
cover:
- platform: mqtt
name: TV Shutter
state_topic: "shellies/shellyswitch-XXXXXX/roller/0"
command_topic: "shellies/shellyswitch-XXXXXX/roller/0/command"
position_topic: "shellies/shellyswitch-XXXXXX/roller/0/pos"
set_position_topic: "shellies/shellyswitch-XXXXXX/roller/0/command/pos"
payload_available: "true"
payload_not_available: "false"
qos: 1
retain: false
optimistic: false
payload_open: "open"
payload_close: "close"
payload_stop: "stop"
position_open: 100
position_closed: 0