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.

  • Claude Flammang@dju.social
    link
    fedilink
    arrow-up
    1
    ·
    9 months ago

    @sabreW4K3
    Create a timer that you set to 5 minutes.
    Create an automation with 3 triggers:

    1. Motion is detected
    2. Motion clear
    3. Timer changes to idle

    Choice of three actions:

    When 1:
    Switch light on
    Cancel timer (this takes care of motion being detected again during the 5 minute delay)

    When 2:
    Start timer (And let’s wait for 5. Minutes for timer to end)

    When 3:
    Check that motion is clear (as motion also cancels the timer)
    If so, switch light off

    • sabreW4K3@lemmy.tfOP
      link
      fedilink
      English
      arrow-up
      1
      ·
      9 months ago

      This broke my brain at first. I had to keep coming back to it. Thank you so much.