Hoping someone has a complete example they can share with an HA new guy…
I have several situations where I want automations not to trigger for N hours.
Examples: working on the garage (dont want motion or door notifications), super windy day (disable back yard motion notifications), etc
Ideally I could setup a single Helper, per automation, with the selection of delay times: 1 hr, 2 hrs, etc
… after such time the automation resumes as normal.
In the initial sent notification, it would have an option to disable ‘for a period of time’ with a selection drop-down to select the amount of delay
There are multiple ways, though you should also consider if they work when HA restarts. Personally I use timers. They can restore on HA restart, you can cacel them, prolong them, see if they are running and test for them in other automations too. They give the most amount of control.
If it’s not that important that it works all the time then a delay at the end of the automation will prevent it from running again while the delay is running.
A restart or reload of that automation will break this though
Would be nice to have them persist across reboots but not required if its a lot more setup/config.
The bypass is to literally stop the notifications from happening - thus stop the automation (aka 'Do-Not-Retrigger) for a selectable timeframe like the below Helper screenshot… can a ‘delay’ do that?
Delays only work for do not do again. Just put a delay action at the end.
But for some examples they won’t work, because you can only start the pause from the action and not for instance say: when a wind gust above x is detected, no not lower the awning for x time.
Tmier persistence is just a checkmark on you set when creating them in the Helper GUI. Starting, stopping etc is well documented:
Testing if a timer is running to stop an action is as simple as:
conditions:
- condition: not
conditions:
- condition: state
entity_id: timer.control_override
state: active
Timers are not adhoc / dynamic? Meaning I must manually create (and uniquely name) a Timer for each separate automation?
This is definitely more complex and less UI based than I was expecting.
Also seem like this workflow is not documented anywhere?
I think this is the workflow…
Create Timer specific to a given Automation
Create Actionable Notification… allow user to select number which is passed to Timer to set the upper limit of the time.
Create Automation
– add Timer as a Condition… do not trigger while Timer = 0
– add Actionable Notification as Action
I’ve spent 2 hours on this and still cant figure out how to send an Actionable Notification with a number list for the user to select from, and how to pass that to the Timer
Keep in mind that - at least for Android, not sure for iDevices - you can only send a max of 3 selectable actions in your Actionable Notification, e.g.
Correct - that’s not how actionable notifications work.
I don’t have a timer set up that way, but here’s an actionable notification triggered by an alert that the lights in my garage have been on for more than 5min:
alert:
garageswitch_on_for_long:
name: Garage Lights are still on!
entity_id: switch.garageswitch_switch_1
repeat: 5
can_acknowledge: true # Optional, default is true
skip_first: true # Optional, false is the default
data:
tag: garage_light_is_on
priority: high
actions:
- action: garageswitch_switch_1_off
title: Turn Light Off
channel: Alert
importance: high
And here is the code that uses the response to turn off the garage lights:
Instead of messing with all the timers I would probably just use a Number Helper and template condition… if you use the slugified entity ID of the automation as the object ID of the number you could use the following condition in each automation: