Question about triggers

Hi everybody,

one question from a beginner. I recognized that if I create an automation I can set a trigger and as soon as this trigger fires the automation starts.

No I realized that in case of a trigger (e.g. sunset) is fired and a condition is not met (e.g. window open) the automation is not processed (e.g. shut window roller).

Is there a possibility that the automation checks the condition again and repeats as long until the condition is met.
The idea is to have sth. like after sunset; close window shutter when window closed - and this will happen as soon as the window closes.

Thanks a lot for your feedback & support!

Change it around.
Trigger on “window closes” and use “after sunset” as the condition.

1 Like

You need two triggers:

  • At sunset
  • When the window closes

and two conditions:

  • Is the current time after sunset?
  • Is the window closed?

If either sunset occurs or a window is closed, and the current time is after sunset and the window is closed, proceed to perform the action.

Taras’s solution above is the best way to accomplish your need, two triggers and two conditions to check that both requirements are met.
For the sake of completeness there is another way.
You could trigger on the sunset, not have a condition at all but then have a wait template in the action section before your desired action.
This would cause the automation to wait until the window is closed (just passing through if the window is already closed)
This depends on your needs but it would not survive a restart, though in a twisted set of circumstances neither would Teras’s if the window was closed during a shutdown.
:man_shrugging:

Thanks guys! This worked perfect!

Which suggestion did you use?

@123 - I took your suggestion with the two triggers. I will also try @Mutt proposed solution for another shutter. It is awesome to see multiple routes to achieve a similar result.

Stick with Taras’s suggestion, for this, it’s ideal.
For other problems you may prefer to wait following a complex trigger but that’s not called for in your (I assume) ‘ficticious’ example.

Edit: how did you test, you’ve not had a sunset to play with yet ?