Closed csoltenborn closed 3 years ago
This looks as a really nice idea! However, as stated in the developer docs from HA, all integrations doing network requests should do this in a separate python module which is hosted on pypi. So maybe a module dwd_weather_adapters which is optional, where we can put all relevant download and parsing code.l, is a good way to do this.
I guess the new Template Weather Provider (https://www.home-assistant.io/integrations/weather.template/) is exactly what you are looking for. It was introducted in Home Assistant 2021.03. At least it allows setting temperature, humdity, pressure and wind speed with values from custom sensors.
Ok, this is the easiest solution. Thank you for your hint. I'll close this for now.
I totally agree - using it already with my custom weather station's current data and DWD's forecast :-)
Is your feature request related to a problem? Please describe. In the city I live in (Paderborn, Germany), the DWD does not have any weather stations for some reason. The next station is around 15km away from me. In contrast, there is a weather station in the city which makes its measurements publicly available and allows people to use it. Of course, this station does not provide forecasts.
Describe the solution you'd like I'd like to be able to receive the data of the current weather conditions from another freely available data source. This includes the following data:
Describe alternatives you've considered I have not considered any alternatives :-)
Additional context In an ideal world ;-), the dwd_weather integration would support adapters for publicly available weather station, and would make existing adapters available to all its users via the UI. An adapter could e.g. consist of a python class inheriting from a base adapter class (provided by the integration), and implementing the following:
The integration would then receive the data using the URL whenever appropriate, ask the adapter to parse it afterwards, and then make use of the parsed data.
Here's some example code - note that the adapter should probably provide more information, e.g. location of weather station, human readable name etc.