Since upgrading to the latest version of home assistant some of my automations have stopped working - specifically ones that only run after sunset… I have proven it’s this as removing the condition triggers the automation.
Has anyone else seen this problem? Below is my configuration.
Check your settings in Configuration -> General and make sure nothing has changed (eg lat/long and timezone) and check Logbook that the time is correct.
As Trevor pointed out, I would try try something like this:
condition:
- condition: state
state: 'off'
entity_id: switch.hallway_mss550l_main_channel
- condition: state
entity_id: sun.sun
state: 'below_horizon'
You don’t need the “and conditions”, this will run when both evaluate to true, anyway I think the main issue was the indent on the sun condition was not indented enough. Are you sure it worked before? The other issue is using after sunset will only work till midnight, then it becomes before sunset because it is the next day, but it is still dark. Is that what you intended? Using below_horizon will work when its dark, until the sun is up. My 2 cents