FL550 / dwd_weather

Deutscher Wetterdienst integration for Home-Assistant
MIT License
173 stars 11 forks source link

since update incorrect temperatur shown in dwd integration #78

Closed mktat81 closed 10 months ago

mktat81 commented 11 months ago

Version of home_assistant

2023.9.2 ## Version of the custom_component version 2.0.0 ## Describe the bug A clear and concise description of what the bug or error is and when it happens. since the update yesterday it didn't get the correct Temperature Information the integrations is currently show 26 degree if i take a look on dwd website i see 19 degree for the same area the show information for humidity winddirection etc. are also different betweeen dwd website an integratin I didnot find any usefull information in the debug log but see below ## Debug log


Add your logs here.

2023-09-22 16:13:00.833 DEBUG (MainThread) [custom_components.dwd_weather] Finished fetching DWD Weather Coordinator for 48564 data in 0.000 seconds (success: True)
2023-09-22 16:13:06.905 DEBUG (MainThread) [custom_components.dwd_weather] Setup with data {'data_type': 'forecast_data', 'station_id': '48564', 'station_name': 'hamburg-fu.', 'wind_direction_type': 'DEGREES', 'hourly_update': False}
2023-09-22 16:13:07.175 INFO (SyncWorker_17) [custom_components.dwd_weather.connector] Updating hamburg-fu.
2023-09-22 16:13:07.176 DEBUG (MainThread) [custom_components.dwd_weather] Finished fetching DWD Weather Coordinator for 48564 data in 0.271 seconds (success: True)
2023-09-22 16:13:07.176 DEBUG (MainThread) [custom_components.dwd_weather] issue_time: 2023-09-22 09:00:00+00:00
2023-09-22 16:13:07.177 DEBUG (MainThread) [custom_components.dwd_weather.weather] Setting up weather with id 48564_Weather and name hamburg-fu.
2023-09-22 16:13:07.177 DEBUG (MainThread) [custom_components.dwd_weather.sensor] Sensor async_setup_entry {'data_type': 'forecast_data', 'station_id': '48564', 'station_name': 'hamburg-fu.', 'wind_direction_type': 'DEGREES', 'hourly_update': False}
2023-09-22 16:13:07.177 DEBUG (MainThread) [custom_components.dwd_weather.sensor] Sensor async_setup_entry
2023-09-22 16:13:07.177 DEBUG (MainThread) [custom_components.dwd_weather.sensor] Setting up sensor with id 48564_Weather and name Weather
2023-09-22 16:13:07.177 DEBUG (MainThread) [custom_components.dwd_weather.sensor] Setting up sensor with id 48564_Weather Report and name Weather Report
2023-09-22 16:13:07.177 DEBUG (MainThread) [custom_components.dwd_weather.sensor] Setting up sensor with id 48564_Temperature and name Temperature
2023-09-22 16:13:07.177 DEBUG (MainThread) [custom_components.dwd_weather.sensor] Setting up sensor with id 48564_Dewpoint and name Dewpoint
2023-09-22 16:13:07.177 DEBUG (MainThread) [custom_components.dwd_weather.sensor] Setting up sensor with id 48564_Pressure and name Pressure
2023-09-22 16:13:07.177 DEBUG (MainThread) [custom_components.dwd_weather.sensor] Setting up sensor with id 48564_Wind Speed and name Wind Speed
2023-09-22 16:13:07.177 DEBUG (MainThread) [custom_components.dwd_weather.sensor] Setting up sensor with id 48564_Wind Direction and name Wind Direction
2023-09-22 16:13:07.177 DEBUG (MainThread) [custom_components.dwd_weather.sensor] Setting up sensor with id 48564_Wind Gusts and name Wind Gusts
2023-09-22 16:13:07.177 DEBUG (MainThread) [custom_components.dwd_weather.sensor] Setting up sensor with id 48564_Precipitation and name Precipitation
2023-09-22 16:13:07.177 DEBUG (MainThread) [custom_components.dwd_weather.sensor] Setting up sensor with id 48564_Precipitation Probability and name Precipitation Probability
2023-09-22 16:13:07.177 DEBUG (MainThread) [custom_components.dwd_weather.sensor] Setting up sensor with id 48564_Precipitation Duration and name Precipitation Duration
2023-09-22 16:13:07.177 DEBUG (MainThread) [custom_components.dwd_weather.sensor] Setting up sensor with id 48564_Cloud Coverage and name Cloud Coverage
2023-09-22 16:13:07.177 DEBUG (MainThread) [custom_components.dwd_weather.sensor] Setting up sensor with id 48564_Visibility and name Visibility
2023-09-22 16:13:07.177 DEBUG (MainThread) [custom_components.dwd_weather.sensor] Setting up sensor with id 48564_Sun Duration and name Sun Duration
2023-09-22 16:13:07.177 DEBUG (MainThread) [custom_components.dwd_weather.sensor] Setting up sensor with id 48564_Sun Irradiance and name Sun Irradiance
2023-09-22 16:13:07.177 DEBUG (MainThread) [custom_components.dwd_weather.sensor] Setting up sensor with id 48564_Fog Probability and name Fog Probability
2023-09-22 16:13:07.177 DEBUG (MainThread) [custom_components.dwd_weather.sensor] Setting up sensor with id 48564_Humidity and name Humidity
2023-09-22 16:13:07.177 DEBUG (MainThread) [custom_components.dwd_weather.sensor] Setting up sensor with id 48564_Forecast Time (UTC) and name Forecast Time (UTC)

if you need any further information let me know 
FL550 commented 11 months ago

I'll have a look into this the next days.

mktat81 commented 10 months ago

I think i found the problem. the weather station i used 'station_id': '48564', 'station_name': 'hamburg-fu.' is gone. I deletet the integration and reinstalled using the Web UI and the station was nowhere to find so i added a different and the numbers i see now are same like on the DWD website.

so the issue is a missing Station ;-)

FL550 commented 10 months ago

Thanks for the update. As someone pointed out here there is a problem with the stations in general. I have to check this.

FL550 commented 10 months ago

This should now be fixed with the new version 2.0.1.

mktat81 commented 10 months ago

did the update but could noch find 'station_id': '48564', 'station_name': 'hamburg-fu.' as i used before in the ui list. i will try to deinstall and reinstall if this will change afterwards

So even after reinstall no change. No issues for no i changed to a different Station.

FL550 commented 10 months ago

This was my mistake, sorry. I forgot to update the packaged files. Can you please try this again?

mktat81 commented 10 months ago

after reinstall again, the station is back with correct data

thank you :)

FL550 commented 10 months ago

Thank you as well for helping me finding this error :)

mktat81 commented 10 months ago

no Problem :)

jensrossbach commented 10 months ago

@FL550 I had a similar problem and after reading this thread, I re-added my weather station (Löhnberg-Obershausen) again. After that, the temperature values in the new configuration are correct again, but the weather conditions are not correct. They show sunny for nearly all upcoming days but the DWD app shows rainy for Wednesday and partly cloudy for the others.

FL550 commented 10 months ago

Hm, strange as the values are either all correct or all incorrect. There is only one weather data source for a single station. Can you please provide me a debug log?

jensrossbach commented 10 months ago

Here are the logs:

2023-10-02 18:54:18.051 DEBUG (MainThread) [custom_components.dwd_weather] Setup with data {'station_id': 'L511', 'data_type': 'mixed_data', 'station_name': 'Löhnberg-Obershausen', 'wind_direction_type': 'degrees', 'hourly_update': False}
2023-10-02 18:54:18.795 INFO (SyncWorker_8) [custom_components.dwd_weather.connector] Updating Löhnberg-Obershausen
2023-10-02 18:54:19.160 DEBUG (MainThread) [custom_components.dwd_weather] Finished fetching DWD Weather Coordinator for L511 data in 1.108 seconds (success: True)
2023-10-02 18:54:19.160 DEBUG (MainThread) [custom_components.dwd_weather] issue_time: 2023-10-02 15:00:00+00:00
2023-10-02 18:54:24.248 DEBUG (MainThread) [custom_components.dwd_weather.weather] Setting up weather with id L511_Weather and name Löhnberg-Obershausen
2023-10-02 18:54:24.250 DEBUG (MainThread) [custom_components.dwd_weather.sensor] Sensor async_setup_entry {'station_id': 'L511', 'data_type': 'mixed_data', 'station_name': 'Löhnberg-Obershausen', 'wind_direction_type': 'degrees', 'hourly_update': False}
2023-10-02 18:54:24.250 DEBUG (MainThread) [custom_components.dwd_weather.sensor] Sensor async_setup_entry
2023-10-02 18:54:24.250 DEBUG (MainThread) [custom_components.dwd_weather.sensor] Setting up sensor with id L511_Weather and name Weather
2023-10-02 18:54:24.250 DEBUG (MainThread) [custom_components.dwd_weather.sensor] Setting up sensor with id L511_Weather Report and name Weather Report
2023-10-02 18:54:24.250 DEBUG (MainThread) [custom_components.dwd_weather.sensor] Setting up sensor with id L511_Temperature and name Temperature
2023-10-02 18:54:24.251 DEBUG (MainThread) [custom_components.dwd_weather.sensor] Setting up sensor with id L511_Dewpoint and name Dewpoint
2023-10-02 18:54:24.251 DEBUG (MainThread) [custom_components.dwd_weather.sensor] Setting up sensor with id L511_Pressure and name Pressure
2023-10-02 18:54:24.251 DEBUG (MainThread) [custom_components.dwd_weather.sensor] Setting up sensor with id L511_Wind Speed and name Wind Speed
2023-10-02 18:54:24.251 DEBUG (MainThread) [custom_components.dwd_weather.sensor] Setting up sensor with id L511_Wind Direction and name Wind Direction
2023-10-02 18:54:24.251 DEBUG (MainThread) [custom_components.dwd_weather.sensor] Setting up sensor with id L511_Wind Gusts and name Wind Gusts
2023-10-02 18:54:24.251 DEBUG (MainThread) [custom_components.dwd_weather.sensor] Setting up sensor with id L511_Precipitation and name Precipitation
2023-10-02 18:54:24.251 DEBUG (MainThread) [custom_components.dwd_weather.sensor] Setting up sensor with id L511_Precipitation Probability and name Precipitation Probability
2023-10-02 18:54:24.251 DEBUG (MainThread) [custom_components.dwd_weather.sensor] Setting up sensor with id L511_Precipitation Duration and name Precipitation Duration
2023-10-02 18:54:24.251 DEBUG (MainThread) [custom_components.dwd_weather.sensor] Setting up sensor with id L511_Cloud Coverage and name Cloud Coverage
2023-10-02 18:54:24.251 DEBUG (MainThread) [custom_components.dwd_weather.sensor] Setting up sensor with id L511_Visibility and name Visibility
2023-10-02 18:54:24.251 DEBUG (MainThread) [custom_components.dwd_weather.sensor] Setting up sensor with id L511_Sun Duration and name Sun Duration
2023-10-02 18:54:24.251 DEBUG (MainThread) [custom_components.dwd_weather.sensor] Setting up sensor with id L511_Sun Irradiance and name Sun Irradiance
2023-10-02 18:54:24.252 DEBUG (MainThread) [custom_components.dwd_weather.sensor] Setting up sensor with id L511_Fog Probability and name Fog Probability
2023-10-02 18:54:24.252 DEBUG (MainThread) [custom_components.dwd_weather.sensor] Setting up sensor with id L511_Humidity and name Humidity
2023-10-02 18:54:24.252 DEBUG (MainThread) [custom_components.dwd_weather.sensor] Setting up sensor with id L511_Forecast Time (UTC) and name Forecast Time (UTC)
2023-10-02 18:54:24.252 DEBUG (MainThread) [custom_components.dwd_weather.sensor] Setting up sensor with id L511_Report Time (UTC) and name Report Time (UTC)
2023-10-02 18:55:23.576 DEBUG (MainThread) [custom_components.dwd_weather] Finished fetching DWD Weather Coordinator for L511 data in 0.001 seconds (success: True)
2023-10-02 18:56:23.576 DEBUG (MainThread) [custom_components.dwd_weather] Finished fetching DWD Weather Coordinator for L511 data in 0.001 seconds (success: True)
2023-10-02 18:57:23.576 DEBUG (MainThread) [custom_components.dwd_weather] Finished fetching DWD Weather Coordinator for L511 data in 0.001 seconds (success: True)
2023-10-02 18:58:23.577 DEBUG (MainThread) [custom_components.dwd_weather] Finished fetching DWD Weather Coordinator for L511 data in 0.001 seconds (success: True)
2023-10-02 18:59:23.576 DEBUG (MainThread) [custom_components.dwd_weather] Finished fetching DWD Weather Coordinator for L511 data in 0.001 seconds (success: True)
2023-10-02 19:00:24.199 INFO (SyncWorker_5) [custom_components.dwd_weather.connector] Updating Löhnberg-Obershausen
2023-10-02 19:00:24.205 DEBUG (MainThread) [custom_components.dwd_weather] Finished fetching DWD Weather Coordinator for L511 data in 0.629 seconds (success: True)

This is how the data in the weather entity today looks like:

image image

This is what the DWD app says:

image

GerdRuetten commented 10 months ago

I have the same problem with not correct values for the station 78458. It shows me now (22:40 o'clock) a temperature from 30,5 °C

Release: v2.0.1

image

2023-10-03 22:43:52.719 INFO (SyncWorker_5) [custom_components.dwd_weather.connector] Updating Bedburg-Weiler Hohenholz
2023-10-03 22:43:57.868 DEBUG (MainThread) [custom_components.dwd_weather] Finished fetching DWD Weather Coordinator for 78458 data in 10.779 seconds (success: True)
2023-10-03 22:43:57.868 DEBUG (MainThread) [custom_components.dwd_weather] issue_time: 2023-10-03 20:00:00+00:00
2023-10-03 22:43:59.022 DEBUG (MainThread) [custom_components.dwd_weather.sensor] Sensor async_setup_entry {'data_type': 'forecast_data', 'station_id': '78458', 'station_name': 'Bedburg-Weiler Hohenholz', 'wind_direction_type': 'direction', 'hourly_update': True}
2023-10-03 22:43:59.022 DEBUG (MainThread) [custom_components.dwd_weather.sensor] Sensor async_setup_entry
2023-10-03 22:43:59.022 DEBUG (MainThread) [custom_components.dwd_weather.sensor] Setting up sensor with id 78458_Weather and name Weather
2023-10-03 22:43:59.022 DEBUG (MainThread) [custom_components.dwd_weather.sensor] Setting up sensor with id 78458_Weather Report and name Weather Report
2023-10-03 22:43:59.022 DEBUG (MainThread) [custom_components.dwd_weather.sensor] Setting up sensor with id 78458_Temperature and name Temperature
2023-10-03 22:43:59.022 DEBUG (MainThread) [custom_components.dwd_weather.sensor] Setting up sensor with id 78458_Dewpoint and name Dewpoint
2023-10-03 22:43:59.022 DEBUG (MainThread) [custom_components.dwd_weather.sensor] Setting up sensor with id 78458_Pressure and name Pressure
2023-10-03 22:43:59.023 DEBUG (MainThread) [custom_components.dwd_weather.sensor] Setting up sensor with id 78458_Wind Speed and name Wind Speed
2023-10-03 22:43:59.023 DEBUG (MainThread) [custom_components.dwd_weather.sensor] Setting up sensor with id 78458_Wind Direction and name Wind Direction
2023-10-03 22:43:59.023 DEBUG (MainThread) [custom_components.dwd_weather.sensor] Setting up sensor with id 78458_Wind Gusts and name Wind Gusts
2023-10-03 22:43:59.023 DEBUG (MainThread) [custom_components.dwd_weather.sensor] Setting up sensor with id 78458_Precipitation and name Precipitation
2023-10-03 22:43:59.023 DEBUG (MainThread) [custom_components.dwd_weather.sensor] Setting up sensor with id 78458_Precipitation Probability and name Precipitation Probability
2023-10-03 22:43:59.023 DEBUG (MainThread) [custom_components.dwd_weather.sensor] Setting up sensor with id 78458_Precipitation Duration and name Precipitation Duration
2023-10-03 22:43:59.023 DEBUG (MainThread) [custom_components.dwd_weather.sensor] Setting up sensor with id 78458_Cloud Coverage and name Cloud Coverage
2023-10-03 22:43:59.023 DEBUG (MainThread) [custom_components.dwd_weather.sensor] Setting up sensor with id 78458_Visibility and name Visibility
2023-10-03 22:43:59.023 DEBUG (MainThread) [custom_components.dwd_weather.sensor] Setting up sensor with id 78458_Sun Duration and name Sun Duration
2023-10-03 22:43:59.023 DEBUG (MainThread) [custom_components.dwd_weather.sensor] Setting up sensor with id 78458_Sun Irradiance and name Sun Irradiance
2023-10-03 22:43:59.023 DEBUG (MainThread) [custom_components.dwd_weather.sensor] Setting up sensor with id 78458_Fog Probability and name Fog Probability
2023-10-03 22:43:59.023 DEBUG (MainThread) [custom_components.dwd_weather.sensor] Setting up sensor with id 78458_Humidity and name Humidity
2023-10-03 22:43:59.023 DEBUG (MainThread) [custom_components.dwd_weather.sensor] Setting up sensor with id 78458_Forecast Time (UTC) and name Forecast Time (UTC)
2023-10-03 22:43:59.078 DEBUG (MainThread) [custom_components.dwd_weather.weather] Setting up weather with id 78458_Weather and name Bedburg-Weiler Hohenholz
FL550 commented 10 months ago

I have updated the integration to v2.0.2 to provide better debugging capabilities. Can you please send me the new debug logs and also download the file from DWD at the same time and upload it here: https://opendata.dwd.de/weather/local_forecasts/mos/MOSMIX_L/single_stations/L511/kml/MOSMIX_L_LATEST_L511.kmz

jensrossbach commented 10 months ago

Here is the log and the downloaded file from DWD: dwd_weather_L511.log MOSMIX_L_LATEST_L511.zip

image Bildschirmfoto 2023-10-05 um 17 53 37

FL550 commented 10 months ago

I might have found the solution, as the weather conditions are reported by DWD as partly-cloudy. I will update the library to reflect this better.

jensrossbach commented 10 months ago

Great, can you also check the other weather conditions, because there was also a condition with partly cloudy and a bit of rain which was shown as sunny.

FL550 commented 10 months ago

Sunny shouldn't be the case after the update. And to be displayed as rainy, it has to be more than two hours per day.

FL550 commented 10 months ago

This is now fixed in v2.0.3. Please let me know if not and otherwise please close this issue.

GerdRuetten commented 10 months ago

This is now fixed in v2.0.3. Please let me know if not and otherwise please close this issue.

Confirm! Attention: Select the correct station, if you see duplicate station entities in the selectbox

jensrossbach commented 10 months ago

It's better now, but still not optimal in my opinion.

This is what the DWD app says: Bildschirmfoto 2023-10-06 um 18 27 36

This is the weather data from the other DWD weather custom component in HACS: Bildschirmfoto 2023-10-06 um 18 28 51

And this is the weather data from your integration: Bildschirmfoto 2023-10-06 um 18 26 24

The values from the other integration are also not perfect, but at least the icon with cloud and sun for instance fits better. Also the min/max temperature values are correct for all days but not in case of this integration.

FL550 commented 10 months ago

But the condition icons are exactly the same as in the DWD app, which I consider as master?

And the reason for the temperatures are probably rounding differences.

jensrossbach commented 10 months ago

But the condition icons are exactly the same as in the DWD app, which I consider as master?

Not exactly, the DWD app shows clouds with a sun and your integration shows only clouds (or only sun like in case of today).

And the reason for the temperatures are probably rounding differences.

Okay, so the integration is rounding the values to a whole integer?

FL550 commented 10 months ago

Not exactly, the DWD app shows clouds with a sun and your integration shows only clouds (or only sun like in case of today).

Homeassistant only offers the states sunny, partly-cloudy and cloudy for only cloudy. Within the DWD app there is at least one state more. I don't think I could get a better fit.

Okay, so the integration is rounding the values to a whole integer?

Yes

jensrossbach commented 10 months ago

For me it looks like as you map partly-cloudy to cloudy (because the icon with clouds only is shown, third picture above). The other DWD weather integration seems to use the partly-cloudy state (second picture above).

FL550 commented 10 months ago

It isn't a direct mapping, as there are only hourly data points and no daily summary available.

Can you please confirm this in a few days, as for me it fits.

GerdRuetten commented 10 months ago

@FL550

Isn't this the all possible conditions

image

See

https://www.home-assistant.io/integrations/weather/

FL550 commented 10 months ago

Yes they are and I am using all of these. But for clouds only without precipitation, there are only the three.

I am getting the prevailing condition for every hour from DWD and have to decide, which value should be displayed for the complete day. And for the clouds DWD provides four steps: clear sky, light clouds, medium clouds and overcast. And this makes mapping a bit complicated.

If you have better ideas on how to translate them, please make a suggestion and provide me also a screenshot of the DWD weather app and a copy of the weather file from the DWD server. I would be happy, if we can improve this if you are unhappy with the current implementation.

jensrossbach commented 10 months ago

I think it's okay now. Issue can be closed from my point of view.