c5te1n / node-red-contrib-dwd-local-weather

Node Red node to retrieve local weather forecast from DWD (Germany)
Apache License 2.0
13 stars 11 forks source link

NaN error with precipitation 24h and 3h #18

Closed Graefer closed 3 years ago

Graefer commented 4 years ago

Thanks for this great node! If I choose MOSMIX elements RRdc or RRhc (total precipitation during the last 24h/12h) I always get „NaN“ — not a number? What can I do?

P1Rebo commented 4 years ago

Hi, I had the same issue and realized that the station just sends / responds with valid numbers 7-8am and 7-8pm. You could build a flow and run it for 24h. Each time the outpot changes (rbe node) you send yourself a msg for example. Hope this helps for you. By the way, I also love these nodes :-)

Graefer commented 4 years ago

Yes, that's the solution. Thanks a lot!

Graefer commented 4 years ago

P1Rebo: Is RRdc the amount of rain of yesterday or 7-7am? I suppose the latter?

P1Rebo commented 4 years ago

You can find the definitions here in EN or DE.

https://www.dwd.de/DE/leistungen/opendata/help/schluessel_datenformate/kml/mosmix_elemente_pdf.pdf?__blob=publicationFile&v=2

I think it's from 7-7pm. Otherwise at 7am it would be the same value I guess. Furthermore, if you request the value at 730 it's the one from 7, since it doesn't change.

Graefer commented 4 years ago

Definition is ‚last 24h‘. But relative to what? When once playing with pulling parameters I got 3.6mm at 7:02 and 3.7mm at 7:24 hinting this is relative to the time requesting the data. What makes you think it’s 7pm to 7pm??

P1Rebo commented 4 years ago

Ah ok... I didn't check that lately. In this case it might be so that the Weather Station just updates the values within this period (maybe to fulfill any law enforcements).

But neither am I a DWD engineer nor the maintainer of this library. :-)

c5te1n commented 3 years ago

Thanks for this great node! If I choose MOSMIX elements RRdc or RRhc (total precipitation during the last 24h/12h) I always get „NaN“ — not a number? What can I do?

In those cases you can now use output modifiers to get the next / previous value of the data field. So if you use >RRdc it will look for the next value in that field ans so effectively return today's expected total precipitation. Using < might not work for current data as historic data is not included in DWD's data files.

Graefer commented 3 years ago

I found a MOSMIX FAQ https://www.dwd.de/DE/leistungen/met_verfahren_mosmix/faq/faq_mosmix_node.html in German which might my useful to some users. Especially the fact, that RR3c can be != 0 although the preceding RR1c were == 0. And that the time is based on UTC which means that e.g. RRdc is delivered to differerent times (CET vs. CEST).