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

Integrate the actual data of the past X hours - instead of probability #22

Open meevil opened 4 months ago

meevil commented 4 months ago

Hi, I love your HA integration.

Is there a chance to include sensors, that show the actual past situation, e.g. for precipitation. I'd like to have a sensor, that tells me the actual precipitation of the last X hours. So instead of the probability, I'd like to see what happened in the past.

According to this (https://opendata.dwd.de/weather/lib/MetElementDefinition.xml), there are several data points that show weather data of "last X hours."

In my case, this data point should tell how much it rained in the past 6 hours, right?

RR6 kg / m2 Total precipitation during the last 6 hours

Sorry, if I am completely wrong.

hg1337 commented 4 months ago

Thank you @meevil!

The document you mention describes the MOSMIX format for the forecasts. The "last X hours" only defines the time span relative to the reference time. Usually, these values are then also only provided every x hours, so e.g. RR6c is only provided for timestamps every 6 hours and covers the 6 hours before that timestamp:

image (from https://opendata.dwd.de/weather/local_forecasts/mos/MOSMIX_L/single_stations/10738/kml/MOSMIX_L_LATEST_10738.kmz)

So probably not exactly what you are looking for. If you are looking for actual measurements, you need the data from the weather reports, e.g. https://opendata.dwd.de/weather/weather_reports/poi/10736-BEOB.csv Those indeed have a history and also stuff like precipitation_amount_last_24_hours. However, I'm not sure how reliable all of this is, I'm already happy if there is some usable measurement data 😆

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?

meevil commented 4 months ago

Hi @hg1337 ,

thanks a lot for your quick and long explanation. I must be absolutely honest: I wish i would have half the knowledge you have .-) Most of your explanation exceeds my understanding for this.

Maybe it helps, if i further explain, what i am using your integration for: I have a raised bed ("Hochbeet" in German) which I want to water automatically with an HA automation. I created a helper that sums up the precipitation of the next 10 hours. If not "enough" rain (in mm) is expected, the water pump will be started (at 7 AM and 5pm).

However, using the forecast isn't perfect, as i it is (1.) a forecast and (2.) if it just rained a lot and then stops for the next 10 hours, the water pump will still be turned on again, right after it poured.

So, I'd be happy, if i would know, how much it (probably) actually rained within the last 6 or 10 or 12 hours - whatever DWD is providing.

So, I especially can't really tell the consequences of this "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."

I am sorry, that I am not of much help :-) but i hope you understand what I am aiming for. If this is somehow possible for you to integrate, that'd be awesome!

SVNKoch commented 1 month ago

@meevil I haven't looked into it, but maybe there are (/ DIY) local weather station which meassure precipitation, which you could stick next to your flower bed. 🤔

PS:

I have a raised bed ("Hochbeet" in German) which I want to water automatically

First of all, I read "Hochbett" ("Loft bed" in English) and was super confused why you wanted to water your bed 🤣