Hi everyone, I’m new to Home Assistant and I need help to make an automation for a floodlight and a Reolink Camera. What I am trying to do is make a person-activated Floodlight that turns on the Floodlight when the person entity changes to “detected” and I would like for the lights to stay on as long as the person entity is in the “detected” state and only turn off the when the person entity is “clear” for 5 seconds. I have made an automation that works for the most part, but sometimes it doesn’t work and the floodlight stays on after the person entity is clear and only turn offs when the “wait for trigger” timeouts. I know the automation I have made is bad, and I ask for someone’s help to make it better. Thank you HA community.
alias: Motion Floodlight
description: “”
triggers:
- trigger: state
entity_id:- binary_sensor.camera_person
from: “off”
to: “on”
conditions:
- binary_sensor.camera_person
- condition: sun
after: sunset
before: sunrise
actions: - action: light.turn_on
metadata: {}
data: {}
target:
entity_id: light.camera_floodlight - wait_for_trigger:
- trigger: state
entity_id:- binary_sensor.camera_person
from: “on”
to: “off”
for:
hours: 0
minutes: 0
seconds: 5
timeout:
hours: 0
minutes: 1
seconds: 0
continue_on_timeout: true
- binary_sensor.camera_person
- trigger: state
- action: light.turn_off
metadata: {}
data: {}
target:
entity_id: light.camera_floodlight
mode: single