Shelly 2 Roller Shutter Automation: Challenges and Solutions

I’ve been experimenting with setting up an automation for my Shelly 2 roller shutter, aiming to adjust its position and tilt the slats slightly. While I’ve managed to create a workaround using delays, I’m encountering a few hurdles that I hope the community can help me overcome.

First, I rely on a 27-second delay to ensure the shutter has stopped moving before proceeding. Ideally, I’d like to trigger the next action based on the shutter’s state changing to ‘stop,’ but I’m unsure how to retrieve this information from the Shelly 2 via MQTT. If anyone has successfully implemented this, I’d love to hear how you did it!

The second issue is with the tilting mechanism. A 900-millisecond delay worked perfectly in Tasker, but in Home Assistant, it seems to be ignored. The shutter either doesn’t tilt at all or overshoots, leaving the slats fully open. I’ve tried adjusting the delay, but it hasn’t resolved the problem. Has anyone found a reliable way to achieve consistent tilting in HA?

Here’s a snippet of my current 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

Any insights or alternative approaches would be greatly appreciated! I’m excited to see if the community has some clever solutions to these challenges.