Script or alert (or automation?)

Hi everybody,

I would usually always default to using an automation, but got a suggestion about using alerts more recently, which are a great way to do what I’d have used automations for, but much simpler.

For this use case, I am not sure whether to use a script or an automation. It is a bit more complex:

  1. two different triggers
    1.1 climate.jonna_heizung and
    1.2 binary_sensor.jonna_tuer_contact
  2. conditions
    2.1. climate => 20°C
    2.2 door => open
  3. if both conditions are met (so the door has been opened and the set temperature is larger than or equal to 20°C), do x (in this case, notify.jonna and notify.alexa_media)
  4. wait for a set period of time (input_number.helper_jonna_timeframe), after this time:
  5. check, whether either the door has been closed, or the climate entity has been set to a value below 20°C
    5.1 if true, do nothing (or call some service to confirm)
    5.1 if false, set climate entity to some value

I have not yet used the wait part of a script or automation. Basically, I want the script/automation to keep running, but wait a couple of minutes to allow one to manually either close the door or lower the temperature. If they do, they automation is complete. But if they don’t, another action is supposed to happen (namely, turn down the heat to a lower value).

What would be the best way to do this? Thank you in advance for your ideas :slight_smile: