#Hey all Motion Sensor and Light

1 messages ยท Page 1 of 1 (latest)

paper stag
#

I have a motion sensor and LEDs in my office in the Garden. I'm always being told off for leaving the lights on! ๐Ÿ™‚

#

So when I walk in my office, the lights come on. GReat. Then when I leave the office, and the motion sensor detects no movement, there is a 5 minute delay and the lights go off. Also great.

#

But if I come back into the office, and the motion sensor detects movement, the 5 minute delay still counts down, and the LEDs go off.. Then I'm waving my arms about like I'm being attacked by a wasp to get the lights back on..

#

How do I set it to cancel the "Turn Off Countdown" when motion is detected agian?

#

For the record, I have searched, and seen a few "answers" but I don't really understand them.,

stone crag
#

What does your automation look like at the moment? (the yaml I guess) ๐Ÿ™‚

#

if the automation is essentially triggered by "motion detected" -> 5 minute delay > turn lights off, then setting the mode to "restart" should restart the delay every time motion is detected again, meaning it will only turn off if not motion was detected for a full 5 minutes

#

mode can only be set in yaml I believe

paper stag
#

Yeah, thats the kind of answers I saw, but I can't really make much sense of it! ๐Ÿ™‚ (HA Noob!)

#
alias: Office lights - motion trigger
description: ""
trigger:
  - platform: state
    entity_id:
      - binary_sensor.sonoff_a48003b3bc
    alias: Motion in the office - On
condition: []
action:
  - choose:
      - conditions:
          - type: is_motion
            condition: device
            device_id: REMOVED
            entity_id: binary_sensor.sonoff_a48003b3bc
            domain: binary_sensor
        sequence:
          - type: turn_on
            device_id: 300975e15b098b0bd5e426dec7f580f9
            entity_id: switch.sonoff_10014e213c
            domain: switch
          - stop: ""
      - conditions:
          - type: is_no_motion
            condition: device
            device_id: 58f43482a607bbc5f1d3ed57a9909c2f
            entity_id: binary_sensor.sonoff_a48003b3bc
            domain: binary_sensor
        sequence:
          - delay:
              hours: 0
              minutes: 15
              seconds: 0
              milliseconds: 0
          - type: turn_off
            device_id: 300975e15b098b0bd5e426dec7f580f9
            entity_id: switch.sonoff_10014e213c
            domain: switch
    default: []
stone crag
#

I'm not very sure how choose will interact with it, but I think you can add a top-level mode: restart at the end of this automation, at same indentation level as alias, description etc