Hi. I am trying to create an automation with a trigger of when my door is locked. Then have conditions of when I am not home. Then it turns off the lights in my house.
The problem is that I need this to run once all conditions become true. However currently when the lock triggers the automation then the condition is checked at that moment and it’s not yet true, so the automation never proceeds.
I tried setting up multiple triggers but it seems that that ANY trigger will trigger the automation but I really need the automation to only trigger if ALL triggers are true.
This seems like it would be a very common need so I feel like I’m missing something obvious. Any suggestions? Thanks!
Instead of using your conditions in the ‘condition’ section of the automation, use wait_template in the action section. This will basically pause the automation until the condition(s) outlined in the wait_template become true.
Put all the conditions as your triggers also. That will make sure it triggers (more than it needs to) but also when all conditions are true.
Or you make a template trigger with all the conditions.
But as always, it’s a lot easier to help if you post what you need help with
This method is best if you need all triggers and all conditions valid at the exact same time for the automation to proceed. My option allows for a delay time between the trigger and the condition being met.
Your suggestion requires the item listed as the trigger to occur first, then the wait_for_trigger to go from false to true during the delay period. If it is already true the sequence will not continue (unless it charges to false and then back to true during the delay).
The matching triggers and conditions option allows the automation to proceed any time they are all true, regardless of the order they occurred in and ignoring any durations.
Both options are useful, but not really a substitute for one another.