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?

  • m_randall@sh.itjust.works
    link
    fedilink
    English
    arrow-up
    3
    ·
    10 months ago

    Not a particularly helpful comment but I struggled with this kinda thing until switching to Node Red. It made complex things much easier to get working.

    • Panq@lemmy.nz
      link
      fedilink
      English
      arrow-up
      1
      ·
      9 months ago

      Node Red by far gave me the best automation for numerous lights. X minutes after sunrise, it iterates every light that is on and calls turn off with a fairly long (2 min?) transition time, so the lights all gradually fade off.

      It’s been running for years without me needing to touch anything, it doesn’t care if you replace/rename any lights, and the slow fade when it’s still getting brighter outside makes the change invisible.

      I’ll bet you could do the same thing without Node Red, but nowhere near as easily.