hg1337 / homeassistant-dwd

Custom component for Home Assistant that integrates weather data (measurements and forecasts) of Deutscher Wetterdienst (DWD).
Apache License 2.0
78 stars 7 forks source link

[Feature] Forecast Today for the whole Day #24

Open dafunkydan opened 4 months ago

dafunkydan commented 4 months ago

I have a similar Question like https://github.com/hg1337/homeassistant-dwd/issues/22#issue-2251581844, but with slightly different Goals, so i didn't want to hijack that Thread 😃

The Forecast for Today only reflects the upcoming Values. So if you have a Look at the Forecast at 10 p.m., you might see e.g. highest Temperature is 5°. Or a Precipitation of 0.3, while it has been raining the whole Day.

Which, of course, is true in Terms of Forecast, but not true if looking at "Today". So, if you want to compare Tomorrow with Today, you just can't.

Is there a Way to get the "real" Values of Today? By Real, i would already be happy with the most precise forecasts. Real measurement, of course, might be even better 😉

I currently thinking of providing the "raw" data from the MOSMIX forecasts and the weather reports via additional separate sensors that can be enabled optionally as nice JSON objects, similar to the forecasts, but without any further processing, so that you would e.g. have keys like RR6c or precipitation_amount_last_24_hours and the corresponding values for the corresponding timestamp. Would that help you?

This sounds Great! The Weather reports include a lot of data, a lot not necessary for me. But seeing Yesterdays' Values is my second Goal, so in the Morning User can compare yesterday with todays forecast. So this would be a great Feature! 👍

Still, i am wondering if there is a Way to get the "Forecast/Backcast" for Today?

cofw2005 commented 2 weeks ago

I also see that issue. If we use weather.get_forecasts action to forecast daily value and hourly value. We can see that the today's forecast rain value (first item of the list) is showing the sum of the hourly value for the rest hours of the day. I created a sensor to store this forecast_rain value hourly. It is always going down. See below chart as example. Screenshot

Like @dafunkydan said, if you get this value in the middle of the day, you only get the upcoming rain amount for rest of the day. And only the value at 0:00 probably represent the real today's total value.

If there is also such a data, e.g. precipitation of last hour or hourly measured precipitation. Then the forecast value of the whole day can sum the total value of measured for past hours and forecast for upcoming hours.

hg1337 commented 16 hours ago

Thank you for the feedback. Currently, the behavior is indeed like that on purpose, see https://github.com/hg1337/homeassistant-dwd/blob/2024.9.0/questions_and_answers.md#why-does-the-daily-forecast-for-the-current-day-differ-from-the-warnwetter-app

I looked into it again. The challenge is that we need to calculate the daily forecast from the hourly forecast and the hourly forecast is only provided for the future. To get the forecasts for the past, multiple historic files (currently only one file needs to be downloaded) need to be downloaded and combined properly.

I keep it open, but unfortunately you cannot expect this feature very soon. If we bring this feature, I would like to have it configurable so that people who like the current behavior (like myself ;) ) can keep it.