So I have an automation that sets the lights in the morning at sunrise. It’s supposed to readjust every minute, then turn warm in the evening. When it works, it works the whole way. But more than half the time, it’s like the automation simply doesn’t run. Here are some code snippets.
Light adjusting automation
alias: "managed_morning"
initial_state: 'on'
trigger:
platform: time
minutes: '/1'
seconds: 00
condition:
condition: sun
after: sunrise
before: sunset
action:
service: script.matchlights
Automation that enables the automation above (as well as the evening one)
alias: "Managed Lighting"
initial_state: 'on'
trigger:
platform: sun
event: sunrise
offset: '-00:45:00'
condition:
condition: sun
after: sunrise
before: sunset
action:
- service: automation.turn_on
entity_id: automation.managed_morning
- service: automation.turn_on
entity_id: automation.managed_evening
The reason for this odd structure is that I have it disable the light management when I activate a theme. That way, the lights don’t revert back a minute later. So the second automation re-enables the light management automations 45min before sunrise, that way it is always activated in the morning and helps me wake up.
But like I said, it’s only working half the time or less.
Any clues? How consistent are automations generally?