#Trigger ID / ID usage

1 messages · Page 1 of 1 (latest)

grave sluice
#

Hi, I'm trying to automate a sleep mode activation which sends a notification to my phone to activate it, or delay it by 1 hour. It should automatically activate after 5 minutes if I don't respond to either. However I can't seem to get the 'triggered by' to pick up my 'wait for triggers' mobile phone response trigger ids.

#

Both of my 'wait for triggers' have ids set for them, but the 'triggered by' can't use them.

#

just to show, i have to go into the yaml to assign it's trigger id, but this causes it not to run and runs the default part of the choose section

spice lance
#

Tigger id is only assign when the automation is started. So you can't wait for it in a "wait for". It will not change during the run of the automation.

For this problem, just don't wait IN the automation, just wait out the automation. So just:

  • tigger at 22:00 => send notification
  • trigger at 22:05 => act if no response received
  • trigger on response => do what you want to do
grave sluice
#

I ended up doing this condition

#

condition: template
value_template: "{{ wait.trigger.id == "activate_now" }}"

#

which got it working! 🙂

spice lance
#

The best automations are just quick and be done. All the long waiting is best to keep outside the automation. Just act on the event and be done