I have a bunch of presence and motion sensors (like four, but shush) and when people leave rooms I would like to turn the lights off after five minutes, however if someone returns to the room before that five minutes is up, I’d like to start that countdown again. Is there a grateful way to do this that isn’t me just doing if no activity for five minutes, turn off the lights, else wait five minutes and then turn off the lights. Because that’s ugly, rigid and not very smart at all.

    • walden@sub.wetshaving.social
      link
      fedilink
      English
      arrow-up
      2
      ·
      9 months ago

      When I restart mine, I restart HA only, and all of the add-ons (including NodeRED) keep running. The problem is as soon as HA restarts, it blasts all of the states to NodeRED, and for the most part (I think), they all go from “unavailable” to “on/off”. This restarts whatever timers NodeRED keeps track of. I don’t know of a good way around this, but I restart HA so infrequently that it doesn’t matter for me.

    • Flying_Hellfish@lemmy.world
      link
      fedilink
      English
      arrow-up
      2
      ·
      9 months ago

      No, but you CAN use HA timers in NodeRED. You just have to trigger off the state of the timer itself. I did get it to work but it was quite a bit of spaghetti, I found it easier to use eventID triggers in the standard automation GUI for dealing with persistent timers.