Looks ok. Did you maybe try with switch.toggle instead of switch.off ?
And if log says that it has been triggered and sunrise, then automation itself did run fine.
What switch is it?
Thank you - The only differences I see are the initial_state and lack of empty condition and data brackets. I’m going to test with those changes and see what happens…
Update - changes to my automation made no difference. Further logbook review shows:
6:38:24 AM [Street Lamp] turned on
6:38:24 AM [Sun] has risen
6:36:24 AM [Street Lamp] turned off
6:36:24 AM [Street Lamp Off at Sunrise] has been triggered
…So, this automation is working perfectly at 6:36.24 AM. But it appears the sun.sun platform is shutting it back off again two minutes later. I have scrubbed all of my automations thoroughly and cannot find any sun.sun automations.
Change your logging level to debug and trace what is happening in the logs. Or wait until 0.115 which has context (cause) next to the logbook entries. Or try the 0.115 beta now. It’s pretty stable but there are a lot of changes. Make sure you backup before trying it if you go that way. And read the beta release notes.
.115 will be helpful. Thank you. In the meantime, I put a 4 minute offset in the automation to make sure the light is off in the day. The automation works perfectly. The logbook is revealing:
6:44:25 AM [Street Lamp] turned off
6:44:25 AM [Street Lamp Off at Sunrise]has been triggered
6:42:25 AM [Street Lamp] turned on
6:42:25 AM [Sun} has risen
6:40:25 AM [Street Lamp]turned of
It is confusing that:
something turns off the light at 6:40:25. This corresponds to the sun event platform time. (I no longer have an automation for this)
something turns on the light at 6:42:25. The sun.sun state platform sunrise is 6:42:25. (I don’t have any sun.sun automations and i don’t understand the reason for the time difference)
the automation I created with the 4 minute delay is working perfectly.
Is there a way that previous automations could be cached somewhere and need to be cleaned? Not sure how to fix this.