-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow more flexible configuration of what affects sunrise & sunset events #116
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pnbruckner
changed the title
Add elevation option for observer obstruction vs horizon
Allow more flexible configuration of what affects sunrise & sunset events
Mar 22, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Tasks
Closes #111
Overview
Allow more flexible configuration of what affects sunrise & sunset events. See details below.
Also, add services to dynamically change integration entries (i.e., "locations") that were created via UI config flow and include location parameters (i.e., which do not use HA's location configuration.)
Lastly, add sensors to indicate the sun's azimuth at sunrise & sunset.
Together, these allow more dynamic use of this integration. E.g., for vacation, one might want to know sunrise, etc. at the vacation destination, which might be one place, or might change during the vacation. Another use case is where a mountain affects sunrise, but where the sunrise occurs (distance & relative height to the top of the mountain) changes throughout the year (i.e., as the azimuth of the sun at sunrise changes.)
Observer Obstruction vs Horizon
The astral package can accept two different types of data for certain events like sunrise & sunset to describe where these events are seen relative to the observer.
The first, which has been the only supported option so far, is the horizon. In this case, the elevation of the observer relative to ground level defines how much to adjust the event by due to the curvature of the Earth.
The second is an obstruction, such as the top of a mountain. This is defined by the horizontal distance to the obstruction, and the relative height of the obstruction from the observer, which can be negative if the obstruction is lower than the observer (e.g., the observer is on an even higher mountain.)
This PR adds support for defining either type for easterly events (sunrise, dawn) and westerly events (sunset, dusk.)