I had this simple automation working a while ago then it stopped some time back. I can go into developer states and set the “sun” state to “above_horizon” and my second automation here works just fine and turns the lights off. The first one for “below_horizon” never triggers for me to turn the lights on. Turning them on manually then the automation for turning them off works fine though.
After trying many, many things for some reason it was my alias name.
I ended up making a clone of my sunset automation and trying things with it. It would work fine, but my alias as “Outdoor Lights on at Dusk” just flat out refused to work. I changed to “Outdoor Lights on at Sunset” and it’s working now. I don’t understand it at all and still drives me a bit crazy. Not sure if something is cached somewhere screwing with things.
Well then I typed that and went back to my “States” screen and saw both my automations for “sun” showed on. In interest of figuring it out I switched the name back and sure enough the “automation.outdoor_lights_on_at_dusk” is set as “off”
Not sure when/how the automation was set as “off” or what purpose it’s for exactly. The UI screen shows nothing on it for the automations so it made it very odd to figure out and not intuitive.
Thanks, i’ll do the initial_state to true. From what I read they are all true by default though, so unsure if this will help. My guess is I may have at some point tried to manually “trigger” my automations from the home “states” page. That toggle is setting the state to “false” and not triggering it.
That whole thing isn’t all that intuitive how it’ll pop up on your home screen, toggle it, then it’s permanently disabled unless you figure this out.
Also from all my tinkering I know that the alias does not need quotes
…if you shut down Home Assistant again before it finishes starting, any automation that doesn’t have the initial state set to true will be stored as being off, and those automations will be disabled at the next startup.