I’m trying to set up an automation that turns a light on at 4:30 AM, off at sunrise, on at sunset and off at 9:30 PM. I set up the automation in the UI but it doesn’t make anything happen to the light. This is the code
alias: Living light control
description: ""
trigger:
- platform: time
at: "04:30:00"
condition: []
action:
- type: turn_on
device_id: 9b4d51f1a2d52d3a8031aff13c3b84b2
entity_id: 9860cff2bf7d2dc8d0677eab346585ac
domain: light
- wait_for_trigger:
- platform: sun
event: sunrise
offset: 0
timeout:
hours: 0
minutes: 1
seconds: 0
milliseconds: 0
- type: turn_off
device_id: 9b4d51f1a2d52d3a8031aff13c3b84b2
entity_id: 9860cff2bf7d2dc8d0677eab346585ac
domain: light
- wait_for_trigger:
- platform: sun
event: sunset
offset: 0
timeout:
hours: 0
minutes: 2
seconds: 0
milliseconds: 0
- type: turn_on
device_id: 9b4d51f1a2d52d3a8031aff13c3b84b2
entity_id: 9860cff2bf7d2dc8d0677eab346585ac
domain: light
- wait_for_trigger:
- platform: time
at: "21:30:00"
timeout:
hours: 0
minutes: 3
seconds: 0
milliseconds: 0
- type: turn_off
device_id: 9b4d51f1a2d52d3a8031aff13c3b84b2
entity_id: 9860cff2bf7d2dc8d0677eab346585ac
domain: light
mode: single
type or paste code here
In the automation list it says that it was triggered at 4:30AM but the light didn’t turn on, and it wasn’t turned off at sunrise. Initially it had no delay on the timeout and I thought that might be the problem, but adding a minute to each didn’t fix it. I have several other automations that have only one trigger for these different on/off events for other devices, and they work. I thought by combining them together I could just have one automation. I’m a HA beginner - help/explanations much appreciated