I hope this has not been discussed already, but I couldn’t find any documentation relating to this.
I have implemented a crude presence mode, which I use to stop automations from firing, however, this means that when I return home, no automation has run.
For example, I have an automation to turn on the lights at nightfall, but I don’t want the lights to turn on when I am not here, so I added a condition based on presence to prevent it. However, this means that when I return home (presence toggle automatically to on), the lights remain OFF (since the automation couldn’t fire at that time).
In this scenario, I would benefit from a global mode, which pauses the automations until a condition is met.
You could change your time based automations to be within a range.
As the example you gave, instead of nightfall you could say toggle on between 18:00:00 and 02:00:00 if home and if not already done.
And by 2 at night I mean past that time you might not want all lights to go on anyways as you most likely will go to bed straight away anyways.
I believe you need to either keep track of last time activated or use a boolean to keep track if it has been done already today.
You could add your device trigger as a second trigger and nightfall as another condition. So when you come home after nightfall the script is triggered as well.
What @TazUk said above is essentially what I do and in my mind makes a lot more sense. Automations work best if you can make them as state driven as possible so you can just look at the automation and see exactly what it does and when it fires. If you start to have other things outside the automation triggering and stopping their execution on their own automation schedules then it starts to become very difficult to manage and understand.
Thank you all for your suggestions, they seem indeed to match my scenario.
I see now that I sort of went wrong about it - still new to the hass state of mind!
Also, I guess that the effect of the “pause” feature would depend on the automation (like @Hellis81 suggested, at some point, you may not want the automation to trigger).