Problem statement
Currently, the sun trigger in Home Assistant supports two events: sunrise and sunset. That's it. While a time-based offset can be applied to these, offsets are not a reliable substitute for proper sun elevation-based events. Events like civil dawn, nautical twilight, or the onset of night are defined by the sun's elevation angle and not by a fixed number of minutes before or after sunrise.
A "-30 minute offset on sunrise" may approximate civil dawn reasonably well on a spring morning at a mid-latitude location, but that same offset will be significantly off in winter or at a different latitude. For users at high latitudes this breaks down even further: in areas like Scandinavia, the offset needed to approximate a given elevation event shifts dramatically across seasons, requiring constant manual recalibration. For users inside the Arctic circle, sunrise and sunset may not occur at all for weeks at a time, making the trigger completely useless for large parts of the year.
Automating things like outdoor lights, roller blinds, or morning routines based on the state of the sun is one of the most common use cases in Home Assistant, particularly among users just getting started. The current trigger sets them up with automations that silently degrade as seasons change. We believe it's time to address the shortcomings of the sun trigger and condition in Home Assistant.
Community signals
Scope & Boundaries
In scope
- Expanding the offering for sun-based triggers and conditions in Home Assistant.
Not in scope
- Going beyond sun-based triggers and conditions (e.g., no moon).
Foreseen solution
Adding the following triggers (and equivalent conditions) to Home Assistant (prioritised list):
Higher priority
- Sunrise (crosses 0°, rising)
- Sunset (crosses 0°, descending)
- Solar noon (peak elevation)
- Solar midnight (lowest elevation)
- Sun elevation threshold crossed (once when thresholds/range set by user is reached)
- Sun elevation changed (on every elevation change, but with optional thresholds/range set by user)
- Civil dawn started (crosses -6°, rising)
- Civil twilight started (crosses -6°, descending)
- Night started (crosses -18°, descending)
- Night ended (crosses -18°, rising)
Lower priority
- Nautical dawn started (crosses -12°, rising)
- Nautical twilight started (crosses -12°, descending)
- Astronomical dawn started (crosses -18°, rising)
- Astronomical twilight started (crosses -12°, descending)
- Golden hour started (crosses ~6°, descending / ~-4° rising)
- Golden hour ended (crosses ~-4°, descending)
- Blue hour started (crosses ~-4°, descending)
- Blue hour ended (crosses ~-6°, descending)
These triggers and conditions do not support custom targeting configurations, and since there is only ever one target (the sun entity), they don't need support for the behaviour option.
Risks & open questions
- With these detailed triggers and conditions, do we still need to offer the ability to set a time-based offset on any of these?
- If we do decide to go with a time-based offset, should we add support for the
for option?
- Some of the proposed triggers/conditions overlap. We've intentionally left them in because, semantically, they're different. For example: "golden hour ended" and "blue hour started" describe the same moment, but from different perspectives. But do we want this? Does this unnecessarily clutter up the trigger/condition list?
- The exact definitions for golden hour and blue hour should be set before implementation. The current elevation thresholds aren't accurate.
Appetite
Small - We should be able to complete this in several days to a week.
Execution issues
No response
Decision log
Problem statement
Currently, the sun trigger in Home Assistant supports two events: sunrise and sunset. That's it. While a time-based offset can be applied to these, offsets are not a reliable substitute for proper sun elevation-based events. Events like civil dawn, nautical twilight, or the onset of night are defined by the sun's elevation angle and not by a fixed number of minutes before or after sunrise.
A "-30 minute offset on sunrise" may approximate civil dawn reasonably well on a spring morning at a mid-latitude location, but that same offset will be significantly off in winter or at a different latitude. For users at high latitudes this breaks down even further: in areas like Scandinavia, the offset needed to approximate a given elevation event shifts dramatically across seasons, requiring constant manual recalibration. For users inside the Arctic circle, sunrise and sunset may not occur at all for weeks at a time, making the trigger completely useless for large parts of the year.
Automating things like outdoor lights, roller blinds, or morning routines based on the state of the sun is one of the most common use cases in Home Assistant, particularly among users just getting started. The current trigger sets them up with automations that silently degrade as seasons change. We believe it's time to address the shortcomings of the sun trigger and condition in Home Assistant.
Community signals
Scope & Boundaries
In scope
Not in scope
Foreseen solution
Adding the following triggers (and equivalent conditions) to Home Assistant (prioritised list):
Higher priority
Lower priority
These triggers and conditions do not support custom targeting configurations, and since there is only ever one target (the sun entity), they don't need support for the behaviour option.
Risks & open questions
foroption?Appetite
Small - We should be able to complete this in several days to a week.
Execution issues
No response
Decision log