I can’t get an automation to work.
In short, I want an automation to check if my group.family is away from home for 20 minutes and I want it to keep checking this between 8am and 9am.
I use service: light.turn_off to turn off lights when this is met but the automation doesn’t seem to continue after 8am. Is it mode that needs to be changed?
The only trigger you have is the family group changing to not_home, so if that happens outside the time range your automation will never trigger.
Try to add another trigger to run every day at 8AM (and perhaps one more when away mode changes to ‘on’) and add a condition to only run when family group is not_home.
The solution to that people are already 20 mins away before the time frame is to also add a time trigger at the start of the time frame and check again for 20 minutes not home in the conditions.
basically if there’s more than one condition, all should be added both as a trigger and as a condition.
Yeah, I understand that, but if everyone leaves at 07:30AM, the automation will be triggered 20m late (07:50AM) and won’t run as it is outside the time interval you selected. This is fine.
However, in this case, the group home will stay not_home until someone gets back home, and during this time, you don’t have any new trigger…
So, basically, your automation will work only if the last person leaves home between 07:40AM and 08:40AM. If the last person leaves outside this time window, it won’t run.
You probably want the lights to turn off at 08:00AM if the house is empty, right? For this you need a new trigger to run at 8AM and a new com diction to check if the group is not_home (so you prevent turning off at 8AM if someone still at home).
I don’t need the lights to turn off at exactly 8:00 but sometime between 8 and 9, assuming we’ve been gone for 20 minutes.
I’ll try your “Or even better:” automation! Sees that there are several different triggers that can now affect, e.g. bootlean which is started after 20 min in another automation. I’ll get back to you!
This one is handled by the gone for 20 minutes trigger. The problem is when you leave more tha 20 mins before 8:00. That’s what the time trigger is for. But the condition to check if you’re gone also needs the 20 minutes duration test. Otherwise when you leave 0:01 before 8:00, the light will go off at 8:00.
The same is for the away mode test. When that changes, you might need to reevaluate again if the light needs to go off.
So each test needs a trigger to check if it has changed, and all the conditions need to be there at the same time too, because whatever just changed may not be enough.