[suggestion] Anyone willing to build a dwd_pollen binding?

See [HELP] JSON Path "Deutscher Wetterdienst" pollen flying for details.

As order of content is not fixed, it’s not that easy to do a simple request with jsonpath (you would have to get the correct index for a given partregion_id first).

Sorry, I’m in England and none of my family suffers from this sneeze triggering affliction!!

There wasn’t an example JSON in that post but if the order is the only problem you can use the JS transform and loop through the array (I’m assuming) until you find the one you are looking for.

Or you can use the REGEX transform and select the value based on the characters around it. With a couple of examples I could probably tell you the best way.

Well, after @vzorglub posted the '[?(@.partregion_id==123)] part, I realized it’s in fact very simple to get the information even with simple JSONPATH expressions.
Still learning every day… :slight_smile:

1 Like

Hi.
Is it possible to get Weather information from DWD on the same way (JSON Pfad)?
Thanks,
Markus

Didn’t find something like that. But there is plenty of data…

https://opendata.dwd.de/weather/tree.html

Hi I will start the development of a binding. When I have a prototype I will give more information.

2 Likes

Cool!

I have a running prototype including two thing types:

A bridge-type which polls and caches the whole data for all regions at a configurable refresh intervall of 15 minutes or greater.

And one Thing type per region or partregion holding the data channels



I have to do code cleanup and writing a first documentation draft before starting a pull-request.

Does anyone have more suggestions or feature requests for the binding or it’s configuration. At the moment the region things holding 3 string channels today, tomorrow and dayafter_to for each pollen type. With the values: -1, 0, 0-1, 1, 1-2, 2, 2-3 and 3.

I’m thinking about 2 further channels per day and type, but this a point I want to discuss:

What I’m thinking about are channels todayFullstring, tomorrowFullstring and dayafter_toFullstring have the translation from the above values to the values from legend which is allthough present in DWD Json file.

And channels todayNumber, tomorrowNumber, dayafter_toNumber with an internal translation of values to an number-value to enable for example dynamic icons or valuecolor for example “0”=>0, “0-1”=>1, “1”=>2, “1-2”=>3

What do you think about those additional channels. Are those useful or should this be done with rules or profiles etc? Or maybe as a additional configuration option of the Region thing-type which outputformat should be choosen?

Hi,

I actually get DWD Pollenflug data by a rule and would welcome a dedicated binding.

To your questions:
from my point of view, transformations should be done in rules, or in a MAP file.

Further I want to suggest further channels:

2 Likes

Update: I have opened a pull request for the new binding

I will have a look on the map pictures, but I’m not sure whether this can become part of the binding.

The point with last and next change I will implement.

There is a successful PR build for the binding with described functionality above:

https://openhab.jfrog.io/openhab/webapp/#/builds/PR-openHAB2-Addons/18132/1585691154953/published%20/org.openhab.addons.bundles:org.openhab.binding.dwdpollenflug:2.5.4-SNAPSHOT

I would be very happy if someone would give it a try and gives me some feedback. You can find the documentation here: