I had setup automation to turn on my alarm when both my wife and I leave the house. A few years back that would have been perfect but now the kids are teens and we occasionally leave them in the house when we run errands. So I setup an actionable notification with ‘turn on alarm’/‘don’t turn on alarm’. I thought that behavior: ‘default’ would mean the first choice would get fired as an event even without user interaction but it appears that’s not what it means. An ignored notification doesn’t trigger any event back to home assistant.
Is there a way to make an ignored notification trigger an event?
If not, can achieve the same with more complex automation with a delay waiting for a negative response to arrive that would then block turning on of the alarm when the delay expires?
Use a wait_template and a timeout, followed by a service_template.
If you reply the wait_template skips forward and executes the correct service based on the reply.
If you don’t reply, once the timeout is reached it continues to the service_template and executes the correct service based on no reply.
@anon43302295 I’m looking to do something similar.
Could you show me what this would look like?
Pseudo code based on the OP (where the logic is a little flawed, but it’ll do):
- send actionable notification with 2 actions ‘turn on alarm’ and ‘turn off alarm’, let’s have these update an input text or something similar, with ‘on’ or ‘off’ appropriately
- wait_template for the input text being updated to either ‘on’ or ‘off’, with a timeout of say 30 seconds
- service template that if the input text is currently ‘on’ arm the alarm, else disarm the alarm.
- finally update the input text back to ‘standby’.
So logic wise:
- if you reply ‘on’ the wait_template stops waiting and the service template resolves to arm the alarm because the input text is ‘on’.
- if you reply ‘off’ the wait_template stops waiting and the service template resolves to disarm the alarm because the input text is ‘off’ (and therefore not ‘on’)
- if you don’t reply in 30 seconds the wait_template times out and the service template resolves to disarm the alarm because the input text is ‘standby’ (and therefore not ‘on’)
1 Like
In the end my wife told me she didn’t want no response to result in turning on the alarm so the ‘do nothing’ if there’s no response behavior I already had was just fine.