Close cover and then tilt

Hi,
I try to set my blindes/covers to fully closed and then tilt. Manually it’s working fine. I’ll close the cover and then set the tilt. But in my automation that won’t work. Is there any “combined” service?
Thanks a lot,
markus

          - service: cover.close_cover
            metadata: {}
            data: {}
            target:
              entity_id: cover.wozi_tuer_raffstore
          - service: cover.set_cover_tilt_position
            metadata: {}
            data:
              tilt_position: 80
            target:
              entity_id: cover.wozi_tuer_raffstore

My guess is that it starts to close then it stops because it’s commanded to tilt.
You need to add a delay in-between the two commands

thanks for your answer. delay might be tricky (different covers), but the “wait_for_trigger” could do it:

  - service: cover.close_cover
    metadata: {}
    data: {}
    target:
      entity_id: cover.buero_raffstore_raffstore
  - wait_for_trigger:
      - platform: state
        entity_id:
          - cover.buero_raffstore
        to: closed
  - service: cover.set_cover_tilt_position
    metadata: {}
    data:
      tilt_position: 60
    target:
      entity_id: cover.buero_raffstore

But I don’t really like it, as the following lines of my automation are waiting es well. That would mean in my usecase all my blinds running after each other and not at the same time.

Somthing like “cover.set_position_and_tilt” would be great…

A quick and dirty solution would be, to set that specific part at the end of the automation, so the office cover will be the last one. :slight_smile:

The better way would be, to use parallel actions. :wink: This is exactly made for your use case. :wink:

Add all the cover.close entities after each other, then wait until, then tilt all covers

1 Like

Make a separate script (or a script blueprint) that does the close, waits a time, then does the tilt. The entity_id, delay time for the close, and the tilt number can be passed by fields so you only need one of these set to parallel mode. You can have your automation fire these all off in a parallel action, have your delay set for each window, and it all happens at once.

Cleans up your code and makes magic happen… :magic_wand:

1 Like

Wow thanks! Didn’t knowledge that function. And you’re right. It’s doing magic!

Have you even read the link I posted above? :wink:

It doesn’t make sense, to use a seperate script and let automations run in parallel, if you can do the same, way shorter and easier in one automation, where you let the actions run in parallel, not the automation itself… :wink:

The example shown in the documentation does exactly what you want.

script:
  example_script:
    sequence:
      - parallel:
          - sequence:
              - wait_for_trigger:
                  - platform: state
                    entity_id: binary_sensor.motion
                    to: "on"
              - service: notify.person1
                data:
                  message: "This message awaited the motion trigger"
          - service: notify.person2
            data:
              message: "I am sent immediately and do not await the above action!"

Sorry, just offering how I would do it. That is def less code. Mine the code is reusable.
I added parallel based on your input.
Just thinking out loud I guess.

1 Like

No need to be sorry, it wasn’t directed at you or anyone! :laughing: I just wanted to know, why the parallel action doesn’t fit to the problem. Aka. I wanted to know why my recommendation wasn’t a good one, so I can avoid or change it in the future! :slight_smile:

I think it’s because I used the magic wand at the end, that was a cheat.

1 Like