I have programmed an automation that will change the color of lights when my ring doorbell detects motion, but only after sunset. The first one changes the light, the other changes it back. Neither one is working. Can you please help me figure out the problem.
- id: ring_motion_porch_lights_on
alias: Ring Lights On
trigger:
platform: state
entity_id: binary_sensor.ring_front_door_motion
to: 'on'
condition:
condition: state
entity_id: sun.sun
state: below-horizon
action:
service: light.turn_on
data:
entity_id: group.front_porch_lights
brightness: 255
kelvin: 5000
- id: ring_motion_porch_lights_off
alias: Ring Lights Off
trigger:
platform: state
entity_id: binary_sensor.ring_front_door_motion
to: 'off'
condition:
condition: state
entity_id: sun.sun
state: below-horizon
action:
service: light.turn_on
data:
entity_id: group.front_porch_lights
brightness: 255
kelvin: 2000