Always surprises me when I go to do something in HA and realize that I can't figure out how.
This time its lights, specifically making sure that they don't get left on.
Until now I've simply been creating an automation for each light switch so that if it changes state from Off to On and when it's 30 minutes after sunrise it's starts a 15 minute wait and then changes the state of the switch to off.
This approach mostly works but it's less than ideal.
First I'm having to create an automation for each device. How do I do it by Area, or list / group of devices, instead?
Second if a device is turned on too early there's no state change for the automation to catch and it never fires. I could fix this by creating another automation that checks for it but then I'll have even more of them to manage.
Third this doesn't work very well if you want different things to happen on the weekends as opposed to during the weekday. For instance on a Saturday I may WANT that closet light to stay on longer because I'm putting away clothes.
It'd be really nice if I could program HA like this 'On a weekday if you see any device on this list turn on 30 minutes after Sunrise I want you to turn whichever one(s) it was off again 15 minutes later.'.
I'm must be missing something here because surely HA can do this, right?
Create a helper group that has all the lights.
Trigger:
Helper group turns on for 30 min
Condition:
I used time after and before as a fixed time.
Action:
service turn off with a target of the helper group
Should result in the trigger firing 30min after ANY light turns on and only turning them off at the set time.