Closed flyize closed 3 weeks ago
@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.
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.
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.
Oh! That makes much more sense. Thank you!
README.md updated accordingly.
The docs say this is optional, but I see this error every time it starts. Did I miss something?