A sunset automation can fire before Home Assistant’s Sun entity changes to below the horizon, causing an added state check to block the action. Updated guidance explains that the entity can lag sunrise and sunset triggers by a few minutes.

The guide points to the dedicated “Sun is set” and “Sun is up” conditions, which change at the same moment as the triggers. The distinction matters for automations such as outdoor lights that combine a sunrise or sunset trigger with a check on the Sun. Sridhar Neti makes his first contribution to Home Assistant’s website with the explanation.