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

Correct handling of NaN and variables, not updated every hour #43

Closed syoma755 closed 2 years ago

syoma755 commented 2 years ago

As many know DWD does not provide data on hourly basis for some of the variables. Examples are PEvap, TM, RSunD, RRdc and others. Some of them updated once per 12 hours, some are once per 24 hours.

The problem is that in case of normal request without modifiers node returns NaN most of the time (and when not? Documentation must be clear here). And if one uses > Modifier, eg. >RSunD, the node returns some value, but it's absolutely unclear for which forecast in the future this value is taken - 15 Hours ahead? 23 Hours ahead?

I would suggest to modify the behaviour of the node to make it more clear how these values are handled.

c5te1n commented 2 years ago

Hi @syoma755,

thanks for your feedback. The node is supposed to be an easy interface for the KML format that is used by DWD to make MOSMIX predictions available to the public. Technically, those files contain one value per hour. However for some values, a lot of the values are omitted. RSunD for example has only one value in 24 hours, which seems to be at 8:00 local time and shows the "Relative sunshine duration within the last 24 hours". Using >RsunD will find the next available value in the file and with that show the sunshine duration today (after 8:00) or yesterday (before 8:00).

There is a lot of documentation available from DWD here. The Excel file available here states what data points are available and in many cases hints to how frequently the values are available. It's worth noting that not all elements are available for all stations.

Duplicating the documentation into this node would not scale when elements are removed or added and be risky in that the documentation can get easily out of date. If you find some specific documents, that should be linked to the documentation of the node, please let me know

syoma755 commented 2 years ago

The problem is that when using > modifier we don't know for which time the value is returned - 24 Hours ahead, 36 Hours etc. Maybe it would be a good solution to return the value together with a timestamp of this value in this case?