Help with Automation To Check if Requested Action Completed - e.g. Open Shades, did they open fully, if not, open them!

I’ve got Soma Smart Shades 2 on 6 windows, and half of them are a bit problematic in colder months where they just stop. If I request to open them again, they’ll complete opening on the 2nd try.

I’m trying to come up with an automation to automatically check if they’re open and if not, open them, but I’ve found that sometimes when they’re delayed on closing, they’ll start opening again. What’s the best to create an automation to look if there was a recent OPEN request or action within X amount of time?

The one I created so far was looking for the state change to OPEN, but when the condition is that they’re not at 100% within a few minutes, to go ahead and re-send the open command. And I attempted to create a condition for CLOSED as well, but I found this caused a loop where they kept reopening, so I’ve disabled the closed part of it for now.

Here’s my attempt. I think what I really need is to find a way to trigger it from the request to open them, not the state itself, but I’m not quite sure what would give me that information as a trigger. Any pointers?

alias: Auto - Living Room Shades OPEN check
description: ""
trigger:
  - platform: state
    entity_id:
      - cover.living_room_shades
    for:
      hours: 0
      minutes: 2
      seconds: 0
    to: open
condition: []
action:
  - choose:
      - conditions:
          - condition: state
            entity_id: cover.living_room_shades
            state: open
          - condition: not
            conditions:
              - condition: state
                entity_id: cover.living_room_shades
                attribute: current_position
                state: "100"
        sequence:
          - service: cover.open_cover
            data: {}
            target:
              entity_id: cover.living_room_shades
      - conditions:
          - condition: state
            entity_id: cover.living_room_shades
            state: closed
            enabled: false
          - condition: not
            conditions:
              - condition: state
                entity_id: cover.living_room_shades
                state: "0"
            enabled: false
        sequence:
          - service: cover.close_cover
            data: {}
            target:
              entity_id: cover.living_room_shades
            enabled: false
mode: single

Instead of creating another automation to check it you should do it from inside the original automation.

ex.

if you have a certain trigger that says to open the shades at 6pm:

alias: open shades
trigger:
  - platform: time
    at: '18:00:00'
action:
  - service: cover.open_cover
    target:
      entity_id: cover.living_room_shades
  - delay:
      minutes: 2
  - condition: state
    entity_id: cover.living_room_shades
    state: closed
  - service: cover.open_cover
    target:
    entity_id: cover.living_room_shades
mode: single

that way you get one retry after 2 minutes to re-open the shades if they are still closed.

if that’s not enough then you can use the “repeat-until” function in the action to ensure they open.

Thanks for suggestion. This makes sense when using a trigger of time, but I want my trigger to be that someone requested the shades to open.

This does have me thinking that maybe instead of having the direct controls access from Google, lovelace, and the Z-Wave wall switch in that room, that it instead calls a script that has the check logic built into it. The goal here is that when I ask for them to open, the action actually completes as requested (and the same for closing).

Or, I find a way to trigger off of the service call to open the shades, but I still have not figured this out yet… Open to other suggestions if anyone has any.