I’ve set up a script and automation to run through Alexa. The script turns on the landing lights for 10 minutes when we go to bed. Then the automation kicks in for motion detection which runs until sunrise. The lights on the landing are huge lights. The routine runs but no matter what I try to change to keep the lights on longer than 20 seconds when no motion is detected seems impossible. Here is the code. Hopefully, someone can see what I am missing.
'alias: Landing Motion Control (HA)
triggers:
- entity_id: binary_sensor.hue_motion_sensor_1_motion
to: “on”
trigger: state
conditions: - condition: state
entity_id: input_boolean.alexa_goodnight_v3
state: “on” - condition: state
entity_id: light.landing
state: “off”
actions: - entity_id: light.landing
data:
brightness_pct: 25
action: light.turn_on - wait_for_trigger:
- entity_id: binary_sensor.hue_motion_sensor_1_motion
to: “off”
trigger: state
timeout: “00:02:00”
- entity_id: binary_sensor.hue_motion_sensor_1_motion
- entity_id: light.landing
action: light.turn_off
mode: restart
3 posts - 2 participants