jaydeethree / Home-Assistant-weatherdotcom

Home Assistant custom component/integration for Weather.com
GNU General Public License v3.0
35 stars 5 forks source link

[FR] Service to change latitude/longitude #22

Closed wigster closed 5 months ago

wigster commented 5 months ago

I would like to be able to change the latitude/longitude of the weather entity through some service or even by hand. Currently, it is only possible to delete and then recreate an integration instance.

The use case is the following: I would like to have a second weather entity (in addition to my home one) which would get the forecast/conditions for the location where I happen to be e.g. on holiday. I would swap out the source for the forecast from my dashboard and I would be able to see the weather where I happen to be rather than at home.

As a secondary thing -- it would be great if the weather entity, or some other sensor, contained the current latitude/longitude of the current location, so that I could look up the city name programmatically using some reverse geo-location..

This is probably a bit against the philosophy of HA, since history of these sensors would be a splicing of multiple locations, but I think it would be a useful feature.

jaydeethree commented 5 months ago

This is probably a bit against the philosophy of HA, since history of these sensors would be a splicing of multiple locations

Yeah, that's exactly the reason why I didn't add the option to change the latitude/longitude. While it is possible to add a reconfiguration flow for changing this, I feel like it doesn't really make sense since you would end up merging different sets of data into a single set of sensors.

it would be great if the weather entity, or some other sensor, contained the current latitude/longitude

Home Assistant does not support having that data in the weather entity:

https://developers.home-assistant.io/docs/core/entity/weather/

It should be pretty easy to add sensors for this though, so I'll plan to do that when I have time.

jaydeethree commented 5 months ago

Latitude/longitude sensors were added in https://github.com/jaydeethree/Home-Assistant-weatherdotcom/commit/7f3c40cd0a8d18be36fa4f51fc0252453be515e8 and are now available in version 1.1.4.

wigster commented 5 months ago

Thanks works great!