Two actions With time delay (Button)

hello everyone, i’m quite new to the field.

i read a lot, of course, and also try out a few things. but now I need some food for thought.

I would like to execute two actions (call service) with a time delay with a button on the front end.
once the command cover.cover_close should be executed immediately when the button is pressed and 10 seconds later cover.cover_stop

how do I do that? about conditions? automated?

Thank you, I am grateful for any help :slightly_smiling_face:


Just add the action “Delay” in-between. Can all just be done from the UI :slight_smile: But why do you need the stop? Most cover modules will stop automatically.

1 Like

Hey, thank you :slightly_smiling_face:

my motors are mechanical and not electric. so i cannot determine the position. there is only up or down. To watch TV in the strong sun, I want to move it to a certain position.

type: button
  action: call-service
  service: cover.close_cover
  service_data: {}
    entity_id: cover.working_room
entity: cover.working_room
name: Kino

Is this correct? Just add a delay? And the Seconds action? Cover.cover_stop?

Ahh, you want to have a button in LoveLace. Easiest option would be to do all the actions in a script and call that script with the button action.

1 Like

the hint helped me a lot, it works without any problems. Script created with a timeout that executes the second action after it has expired. All binded to a Button

thanks to you Timo :slightly_smiling_face:

hey I have something else that I can’t find a solution to. if the roller shutter is lowered, I would like to query a variable X and a condition, whether this is 0, if so set it to 1. it’s not that easy, is it? Unfortunately, I couldn’t make any sense of the documentation.

Sth Like this:

alias: kino
  x: '{{ 0 }}'
  - condition:  "{{ x < 1 }}"
  - service: cover.close_cover

But this Result is a Parser Error. What did i wrong?
it’s so much more complicated than c+ or php😁

Have a look at template conditions.

1 Like

Variables are not stored in automations, they are just a find and replace for in the automation. But I think what you’re looking for is an input_boolean helper.

1 Like

hey you are my man.
input_boolean was a great tip. together with the script I was able to implement my Toogle switch.
“shut down shutters, wait 10 seconds, stop shutters, set boolean to on and vice versa”

Several queries packed in two options with condition (input boolean on / off) thank you very much :slight_smile:

Would be great to see your solution, ie, code, yaml, steps you took, etc.