Skip to content
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

Phase not reflecting altitude configuration #137

Open
enjibby opened this issue Dec 17, 2024 · 1 comment
Open

Phase not reflecting altitude configuration #137

enjibby opened this issue Dec 17, 2024 · 1 comment

Comments

@enjibby
Copy link

enjibby commented Dec 17, 2024

I have set up Sun2 specifically to implement customisations in my household for the mountains to the west. I performed some quick map measurements and placed some values that I thought would reflect the mountain's positions. I noticed that the "Dusk" and "Setting" sensors correctly adjusted their times relative to HA's built-in sun values.

However, the "Phase" sensor still seems to change state later in the evening, matching the HA's built-in sun phase.

I have now modified my automations to do checks for whether "now()" is after the value of the "Setting" sensor (and triggered it every minute) but ideally I'd prefer to just use the "Phase" sensor (or a second, modified sensor) and its state-change event.

@pnbruckner
Copy link
Owner

Yes, in the current implementation, the observer elevation is only used in determining sunrise & sunset and the various dawn & dusk sensors, as well as the daylight & night sensors (which are effectively derived from the dawn & dusk times.)

The phase sensors are based on hard-coded values of the sun's elevation, where sunrise/sunset are defined as -0.833 degrees.

I can see an argument for making the phase sensors depend on observer elevation, but I'll have to think on that some more.

In the meantime, using the Setting sensor is probably best, but you don't have to do it by testing now() every minute. Simply use a time trigger directly with the Setting sensor as defined here: https://www.home-assistant.io/docs/automation/trigger/#sensors-of-datetime-device-class

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants