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?
You can call a service on an area, that's what I do![](https://lemmy.world/pictrs/image/a3acf46c-cb7a-4dd3-a97d-26dfe9bc0dde.png)
If you want different behaviors on different days, you can use conditionals to check. I'd probably have a weekend automation vs a weekday one tho.
Generally, I just base my light states on motion sensors, turn on if motion, turn off if the motion sensor reports unoccupied
Keep things as simple in ha automations as possible because it really sucks trying to do anything more complicated. That's when people turn to node red