Open MrEbbinghaus opened 1 week ago
Hi, yes, there are now more options for current weather, but the old format is still supported for backwards compatibility.
I can also provide an async implementation based on aiohttp
or httpx
. The requests
implementation in combination with FlatBuffers as a binary data transport format has been primarily developed for data science use cases. I am not sure how well it interfaces with HA. @MrEbbinghaus Would a simple aiohttp or httpx implementation provide any benefit in this direction?
I guess @frenck should decide on that. He is the expert. :-)
Currently, forecast objects have a
current_weather
field that only includes condition, temperature and wind, whereashourly
anddaily
include much more.The MeteoAPI has a
current
parameter with a subset of thehourly
attributes, which allows more granular queries. (Like temperature, precipitation, humidity, pressure, cloud cover, ...)Why this is relevant At the moment, the Open-Meteo Home Assistant integration provides
precipitation
only in the forecasts and wind information only in the entity state. This is a nuisance.Going forward Open Meteo has their own python SDK / implementation, unfortunately without an async implementation (yet). https://github.com/open-meteo/sdk/tree/main/python https://github.com/open-meteo/python-requests
So maybe this project can only provide the async interface in the future or even be archived in favour of the official implementation. (I'll just innocently mention @patrick-zippenfenig here 😉)
Note on backwards compatibility It seems that
current_weather
overwrites thecurrent
parameter, so you can't just query for more and be backwards compatible. This should be solved by always querying withcurrent=temperature_2m,is_day,weather_code,wind_speed_10m,wind_direction_10m
and then mapping the variables to the oldCurrentWeather
model.Compare:
current_weather=true
current=temperature_2m,is_day,weather_code,wind_speed_10m,wind_direction_10m