-
-
Notifications
You must be signed in to change notification settings - Fork 26
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
Get Location from the Home Zone in hass.config #241
Comments
Thanks for asking that question and bringing it to my attention! I was thinking about this a little over the weekend and might have something that could work here. The basic idea is that if someone puts a lat/lon in during setup, use that. Otherwise, the update coordinator could check the location on every update and use that. The issue here is how to identify the update coordinator to make sure an entity knows what data to read from. This is currently based on location, but there's no real reason we couldn't use the entity name to define it instead. It'll take me a couple weeks to get to this, but adding it to the docket! |
When you say location being used do you mean the coordinates of the current location or the name of the current location? Pirate Weather doesn't have a data point for the current location name (you can always request this as a feature in the API repo) but showing the coordinates should be doable. |
I'd live with coordinates, I'm frequently not near a named place anyway. |
It should be possible to show the location coordinates somewhere but I'll defer to @alexander0042. I also created a feature request for a location name being returned in the API. |
Any ETA on this? Dying to get dynamic weather based on location of my RV (I have the pep wave integration) |
People following this Issue should also go put a 👍 on the linked API issue. Pirate-Weather/pirateweather#260 |
Thanks for tagging that issue- if I can find a way to cache the geonames data, then it's very possible to return a location name. In the meantime, I'm testing a new update that lets the latitude and longitude be left blank during the initial setup, which will then let it pull the data from hass on each update! |
V1.5.5 has just been released which allows you to enter in 0 as the latitude and longitude to pull in the current location from HA. It doesn't include a location name or output the current coordinates at the moment. |
Would outputting the current coordinates (as sensors I guess) be helpful here? It'd be easy enough to do, but I'm not sure the value beyond debugging |
I know we used to have debug statements which printed the co-ordinates that it called the API with and I remember we removed it as it was caught by CodeQL. It could maybe be added back and just ignore the CodeQL warning or if having a sensor would make more sense then it could be setup instead. |
Just as an FYI on the sensor thing... If you are dynamically updating the location of your HA instance, you must already have some sensor in order to do that. I'm using a USB GPS Attached to my Victron Cerbo GX which I'm then collecting over MQTT. Other might be using the GPS in their cellular router (like a Peplink) or their Starlink. |
There has been no activity on this issue in the last ninety days and will automatically close in seven days. Leave a comment on this issue to prevent it from closing automatically. |
This issue has been automatically closed since there has been no further activity after seven days and will be automatically locked in sixty days. Feel free to re-open this issue or you can create a follow-up issue |
Describe the feature
This is related to #46 which is a request for a templating integration.
This conversation on the HA Community may be useful.
https://community.home-assistant.io/t/how-does-an-integration-access-has-set-location/734850
Read Location from Home Assistant's Location
This feature is a simpler request which is for the integration to use the Home Zone as the source of the location. This is exposed on the HASS object under hass.config.
On every run, this integration should read the latitude and longitude from hass.config and that would solve the mainline stationary and mobile cases.
This should be the default behavior for new installs.
For existing installs, the existing specified location can be stored as the advanced config.
Advanced Configuration
Location
One might want to use Pirate Weather to see the weather at some other location, in that case the integration can expose manually setting location in advanced configuration which is normally hidden from the user.
Language
Hass.config exposes language and advanced setting could be used an override, or the HASS language could be used instead. The README says only English is supported though, so maybe just remove this and use the HA one if is needed in the future.
Units
Hass.config exposes units. It may be that the HA Units are not specific enough, and you would want and override to enable "SI". I believe UK, CA, US would be covered.
Related: Updating Location using homeassistant.set_location
Mobile uses can use homeassistant.set_location to set the location. Below is an example of using Peplink Mobile Router's GPS (captured from API calls) to do so.
Home Assistant version
latest
Integration version
latest
Acknowledgements
The text was updated successfully, but these errors were encountered: