Camera motion sensor to turn on lights

hello everyone,
I recently installed a reolink doorbell (highly recomended). what i’m trying to achieve is to turn on my front garden lights when motion is detected - I have it working, but its working almost too well.
when motion is detected lights turn on, 20 seconds later the lights turn off, but when this happens the camera triggers motion and the lights go on again, 20 seconds later the light turn off , triggering motion which causes the lights to turn on… etc etc…

anyone have any ideas on what i can do to break the continous cycle?

heres is the current yaml

alias: Front Garden sensor lights
description: If motion is detected on the doorbell turn on front garden lights
trigger:
  - platform: state
    entity_id:
      - binary_sensor.doorbell_motion
    from: "off"
    to: "on"
condition:
  - condition: state
    entity_id: light.front_garden_lights_134
    state: "off"
action:
  - service: light.turn_on
    data: {}
    target:
      entity_id: light.front_garden_lights_134
  - wait_for_trigger:
      - platform: state
        entity_id:
          - binary_sensor.doorbell_motion
        from: "on"
        to: "off"
  - delay:
      hours: 0
      minutes: 0
      seconds: 20
      milliseconds: 0
  - service: light.turn_off
    data: {}
    target:
      entity_id: light.front_garden_lights_134
mode: single

thanks

1 Like

You have the light turning Off after 20 seconds. Keep the light on longer and use an announcement to retrigger after the 20 seconds. That’s what I do, basically means if I’ve heard the announcement a 3rd time (45 seconds )and no doorbell push, then time to start looking at the camera feed.

Hmmmm so in your case, when and how do you turn the lights off?

I have mine set up a bit different for what I’m doing.

For your question, just try and change the 20 seconds delay to 60 secs. or something longer like 5 mins to help with the re triggering. Your just trying to stop the light from going on/off every 20 seconds if whatever starts/stops moving and causing motion to turn On/Off.

My first thought would just be to add another short delay at the end to keep it from triggering again from the light going off/‘motion’ being seen again.

K_white - I’ll give this ago, but I’m not sure it will fix the problem. If I change the delay to 5mins, then instead of the lights turning back on every 20 seconds, they’ll be turning on every 5mins… what I think I need is to have some sort of ‘hold off’ timer that will stop the trigger from kicking off my automation, if I can set that to something like 2seconds, that should be enough time for the camera image to change. I have no idea how do to this though…

Like I said… I’ll try changing the delay to 5mins and testing this evening just I’m misunderstanding how this works.

Cheers

Yes this is what I think I need, but not sure how to implement. The camera only needs 1-2 second to adjust after the lights trun off so it’ll be a very short delay.

Any idea what the yaml would look like if I wanted to do this?

What’s your question? Add another delay at the end (just like the one you already have). Play with the delay length until you find one that keeps it from triggering the camera. Since you are using the ‘single’ mode, the automation won’t/can’t trigger again until it’s finished.

I set the same thing up at my house a few months ago - sort of.

I’m using Blue Iris for my NVR, rather than directly interfacing with cameras in HA. The benefits to this are many, but the specific one in this case is the ability to leverage Deepstack for object detection.

This allows me to trigger lights when a person is detected, not just motion.

In addition, when a person is detected, I receive a notification on my phone with the image from the camera, complete with the markup highlighting the person, as well as the confidence with which Deepstack identified the object as a person.

If you’re interested in how to set this up, I’m in the middle of making a 3-part video series about it. Part 1 is already up. Planning to have part 2 up by the end of the week, and part 3 should be up late next week.

Here’s part 1 in case you’re interested.

Thanks… I’ll try that.

Exx - this sound interesting… I’ll have a look.