Open Qhilm opened 1 month ago
I feel I need to create a second sensor, same DWD station, but left in "daily data update" mode. I will try this.
Hi, sorry for my late reply. There hasn't been changed regarding this data structure. The temperature attribute is still the same, so the max temp should still be the maximum temperature of the day. Can you please provide some details about your suspected error in the data?
Hi, no problem.
For example, currently sensor.max_temp_today
is 16°C. 16°C is the minimum today though...
Will the below really get the daily minimum? Or is 0 the first hour of the day? (my service is set to collect hourly data)
weather_data['weather.dwd_station_redacted'].forecast[0].temperature
It's weird, it seems to work at first when I reload Home Assistant, then it goes wrong and sensor.max_temp_today
is even lower than the daily max I see in the forecast card for weather.dwd_station_redacted
...
Then I reload HA and it's correct again:
@Qhilm Do you have the daily update enabled?
So the yaml above says "daily" but the device is set to "hourly". I'm not entirely clear on how the two interacts.
I tried creating an new integration entry set to "daily", that didn't help.
There are two symptoms:
It's like weather.get_forecasts
is broken and pulling some garbled data and when HA restarts it does something else, not weather.get_forecasts
...
Update: the history of sensor.max_temp_today
shows that it is indeed fetching something at 2am, the trigger seems to be working. In the image below, one can see that sensor.max_temp_today
was 15°C until 2am (which was wrong), then at 2am it went down to 13°C (also completely wrong) and when I reloaded HA it jumped to 25°C (correct).
It seems that the trigger triggers does something that is different than what happens when restarting HA.
[edit] And reloading templates also fixes the issue. I don't get why it pulls the wrong temperature at 2am, it's the same code.
I am quite busy right now, so I currently have no time for assisting you. I am sorry, but I promise I will look into this after I find some time!
Version of home_assistant
2024.5.3
Version of the custom_component
2.1.2
Describe the bug
The following code was working last year (you suggested this, many thanks again), it does not work anymore though:
The entity
sensor.max_temp_today
seems to show the minimum daily temperature now, instead of the maximum. It feels like the data structure has changed. If there is a place where I can look this up, please point me in the right direction. I went to the DWD OpenData page but it does not seem there is a description of the data format."Force hourly data update" is enabled for me, but I notice that data type is set to "daily" in this yaml, I wonder if there is a conflict.
Debug log
There are no errors in the logs, as far as I can tell.