Hi all.
I have stared at this automation for too long. I cannot figure out what I’m doing wrong. I’m fairly new to my HA automation journey, so please LMK if I’m doing something stupid.
I’m trying to automate lights based on the sun. When the sun is above the horizon, motion triggers it at 65% brightness, and below at 5% brightness. Then after 1 minute of no motion switch off the light.
This should be so simple but for some reason, my automating gets stuck at the last step and stays “Waiting for trigger” and never switches off the lights?
Any help will be greatly appreciated.
Here is the yaml code:
id: '1644338994620'
alias: Light - Bathroom Downstairs v1 - sun.sun
description: ''
trigger:
- platform: state
entity_id: binary_sensor.motion_bathroom_downstairs_occupancy
from: 'off'
to: 'on'
condition:
- condition: device
type: is_off
device_id: 6fdd28d5ed372036c37a2546af62c1c7
entity_id: light.lights_overhead_bathroom_downstairs
domain: light
action:
- choose:
- conditions:
- condition: state
entity_id: sun.sun
state: above_horizon
sequence:
- service: light.turn_on
target:
entity_id: light.lights_overhead_bathroom_downstairs
data:
brightness_pct: 65
- conditions:
- condition: state
entity_id: sun.sun
state: below_horizon
sequence:
- service: light.turn_on
data:
brightness_pct: 5
target:
entity_id: light.lights_overhead_bathroom_downstairs
default: []
- wait_for_trigger:
- type: no_motion
platform: device
device_id: e45615c69b8419deeb2ade195b21ae23
entity_id: binary_sensor.motion_bathroom_downstairs
domain: binary_sensor
for:
hours: 0
minutes: 1
seconds: 0
- service: light.turn_off
target:
entity_id: light.lights_overhead_bathroom_downstairs
mode: single