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

observer_elevation error #130

Closed
flyize opened this issue Aug 25, 2024 · 5 comments
Closed

observer_elevation error #130

flyize opened this issue Aug 25, 2024 · 5 comments

Comments

@flyize
Copy link

flyize commented Aug 25, 2024

The docs say this is optional, but I see this error every time it starts. Did I miss something?

This error originated from a custom integration.

Logger: custom_components.sun2.config
Source: custom_components/sun2/config.py:224
integration: Sun2 (documentation, issues)
First occurred: 9:08:10 AM (1 occurrences)
Last logged: 9:08:10 AM

New config option observer_elevation missing @ data[sun2][0], will use system general elevation setting
@pnbruckner
Copy link
Owner

@flyize, what version of this integration are you using, and what version of HA?

Are you using UI or YAML config? Please provide details of the configuration that leads to this error.

@flyize
Copy link
Author

flyize commented Aug 26, 2024

Looks like I'm using 3.3.3. And 2024.8.2 of HA.

I'm using the UI config, but do have one configured via YAML.

@pnbruckner
Copy link
Owner

pnbruckner commented Aug 26, 2024

I believe the warning stems from your YAML configuration. It would be nice if you could provide a copy of that configuration as requested, but I guess that's probably not necessary after all.

This is probably a documentation issue. observer_elevation is optional, but when not provided, the default is not zero, but rather the system's elevation configuration is used. This was done so that existing installations wouldn't change when upgrading. However, a warning is issued because using the system's elevation configuration is not recommended. The problem is, that setting is defined as elevation above sea level, where the sun2 integration (and the built-in sun integration, for that matter) wants elevation above ground level. This has actually been an issue in HA for years that has never been noticed or fixed.

So, yes, observer_elevation is optional, but not providing it results in a warning (not an error) so that you are aware that the integration may be getting the wrong value. If your system's elevation configuration is set to distance above ground level, then the sun2 integration will work correctly. If not, then it's probably best to add observer_elevation to your sun2 YAML configuration and set it to the appropriate value above ground level (which will also cause the warning to go away.)

I'll leave this open for now to remind me to update the docs. Feel free to comment further if you disagree or some of that doesn't make sense.

@flyize
Copy link
Author

flyize commented Aug 26, 2024

Oh! That makes much more sense. Thank you!

@pnbruckner
Copy link
Owner

README.md updated accordingly.

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