[SOLVED] JSON Path "(DWD) Deutscher Wetterdienst Pollenflug " pollen flying

here is my final CONFIG:


String	DWD_Pollen_last_update					"letzte Aktualisierung [%s]"		<time>				{http="<[cacheDWD_Pollen:600000:JSONPATH($.last_update)]" }

//--> Gräser
String		DWD_Pollen__Graeser_today			"heute [MAP(Pollen.map):%s]"		<graeser>			{http="<[cacheDWD_Pollen:600000:JSONPATH($.content[?(@.partregion_id==123)].Pollen.Graeser.today)]" }
String		DWD_Pollen_Graeser_tomorrow			"morgen [MAP(Pollen.map):%s]"		<graeser>			{http="<[cacheDWD_Pollen:600000:JSONPATH($.content[?(@.partregion_id==123)].Pollen.Graeser.tomorrow)]" }
String		DWD_Pollen__Graeser_dayafter_to		"übermorgen [MAP(Pollen.map):%s]"	<graeser>			{http="<[cacheDWD_Pollen:600000:JSONPATH($.content[?(@.partregion_id==123)].Pollen.Graeser.dayafter_to)]" }

//--> Birke
String		DWD_Pollen__Birke_today				"heute [MAP(Pollen.map):%s]"		<birke>				{http="<[cacheDWD_Pollen:600000:JSONPATH($.content[?(@.partregion_id==123)].Pollen.Birke.today)]" }
String		DWD_Pollen_Birke_tomorrow			"morgen [MAP(Pollen.map):%s]"		<birke>				{http="<[cacheDWD_Pollen:600000:JSONPATH($.content[?(@.partregion_id==123)].Pollen.Birke.tomorrow)]" }
String		DWD_Pollen__Birke_dayafter_to		"übermorgen [MAP(Pollen.map):%s]"	<birke>				{http="<[cacheDWD_Pollen:600000:JSONPATH($.content[?(@.partregion_id==123)].Pollen.Birke.dayafter_to)]" }

http.cfg --> The values by DWD will be updated every Day at 11am



-1=keine Daten
0=keine (0)
0-1=keine bis gering (0-1)
1-2=gering bis mittel (1-2)
2=mittel (2)
2-3=mittel bis hoch (2-3)
3=hoch (3)


Frame label="Gräser (Vorhersage)"	visibility=[DWDSelectedSite==7] {
				Text item=DWD_Pollen__Graeser_today			valuecolor=["0"="#008000", "0-1"="#00ff00", "1"="#ffff00", "1-2"="#ff0000", "2"="#ffa500", "2-3"="#ff0000" , "3"="#ff0000"]
				Text item=DWD_Pollen_Graeser_tomorrow		valuecolor=["0"="#008000", "0-1"="#00ff00", "1"="#ffff00", "1-2"="#ff0000", "2"="#ffa500", "2-3"="#ff0000" , "3"="#ff0000"]
				Text item=DWD_Pollen__Graeser_dayafter_to	valuecolor=["0"="#008000", "0-1"="#00ff00", "1"="#ffff00", "1-2"="#ff0000", "2"="#ffa500", "2-3"="#ff0000" , "3"="#ff0000"]	visibility=[DWD_Pollen__Graeser_dayafter_to !="-1"]
			Frame label="Birke (Vorhersage)"		visibility=[DWDSelectedSite==7] {
				Text item=DWD_Pollen__Birke_today			valuecolor=["0"="#008000", "0-1"="#00ff00", "1"="#ffff00", "1-2"="#ff0000", "2"="#ffa500", "2-3"="#ff0000" , "3"="#ff0000"]
				Text item=DWD_Pollen_Birke_tomorrow			valuecolor=["0"="#008000", "0-1"="#00ff00", "1"="#ffff00", "1-2"="#ff0000", "2"="#ffa500", "2-3"="#ff0000" , "3"="#ff0000"]
				Text item=DWD_Pollen__Birke_dayafter_to		valuecolor=["0"="#008000", "0-1"="#00ff00", "1"="#ffff00", "1-2"="#ff0000", "2"="#ffa500", "2-3"="#ff0000" , "3"="#ff0000"]	visibility=[DWD_Pollen__Birke_dayafter_to !="-1"]
			Frame label=" "		visibility=[DWDSelectedSite==7] {
				Text item=DWD_Pollen_last_update

Only one thing I would like to improve.
I would like to change the “last update” item as a String to DateTime.
Unfortunately, I do not know exactly how I should do that.

Thanks a lot to @vzorglub and @Udo_Hartmann

To do that you need another item and a rule:

DateTime PollenLastUpdateDateTime
rule "Pollen datetime"
    DWD_Pollen_last_update changed
    PollenLastUpdateDateTime.postUpdate(DWD_Pollen_last_update.toString.substring(0, 16))

Can anyone tell me how I can get the flower/weather ícons from DWD in the sitemap like The-Elk.
Have this error:

2018-05-31 16:29:04.496 [ERROR] [ui.internal.items.ItemUIRegistryImpl] - Cannot retrieve visibility item DWDSelectedSite for widget org.eclipse.smarthome.model.sitemap.Frame

And the values for the day after tomorrow are gone. Is this right?

birke graeser dwd

store the Icons to $OPENHAB_CONF/icons/classic

EDIT: I had edit my final Sitemap and added:

visibility=[DWD_Pollen__Graeser_dayafter_to !="-1"]
visibility=[DWD_Pollen__Birke_dayafter_to !="-1"]

If you want additional pollen info (Hasel, Erle, Esche, Birke, Graeser, Roggen, Beifuss, Ambrosia)
replace in the JSONPATH:


{http="<[cacheDWD_Pollen:600000:JSONPATH($.content[?(@.partregion_id==123)].Pollen.<POLLENINFO>.today)]" }

Hasel, Erle, Esche, Birke, Graeser, Roggen, Beifuss, Ambrosia

hope this helps you


Nice. That’s perfect.
Thank you very much.
Can i get the weather information on the same way?

I don´t think so.

I use weather underground for weather informations.

I have seen that the stations by WU are very near to each other, but the values are different.
I think this are privat stations and don’t know if this is a good solution.
Are you happy with your values?

yes, I am very happy with the values.

I also have many weather stations in the neighborhood.
Some weather stations have been around for many years and deliver very good values.


The private weather stations only use the current values.Aall other values such as Forcast etc. are provided by external service providers:

I found now the following information for all NEW weather underground User:



it works for existing users, but no one knows how long it will work :frowning_face:

Well, I think, they want your money :wink:

Hello, is it possible tp get the UV-Index from the DWD-Site? The JSON-File ist here: https://opendata.dwd.de/climate_environment/health/alerts/uvi.json
and the dokumentation is here:

It seems very similar but I don’t know how to use it.

In the http.cfg I write


But how I build the Item?

Number DWD_UVI_totay " UV-Index Heute" {http="<[cacheDWD_UVI:600000:JSONPATH(???Hamburg.forcast.today)]" }

I have the same idea with “Biowetter” and “Thermischer Gefahrenindex”

I guess it would be something like

Number DWD_UVI_totay " UV-Index Heute" {http="<[cacheDWD_UVI:600000:JSONPATH($.content[?(@.city=="Hamburg")].forcast.today)]" }

Thanks you, but it don’t work.

when I try
String DWD_UVI_totay “UV-Index Heute [%s]” {http="<[cacheDWD_UVI:600000:JSONPATH($.content[?(@.city==Hamburg)].forecast.today)]" }

I get nearly the whole JSON

Any Idea?

There should be quotes in the JSONPATH. Probably they have to be escaped:

Number DWD_UVI_totay " UV-Index Heute" {http="<[cacheDWD_UVI:600000:JSONPATH($.content[?(@.city==\"Hamburg\")].forecast.today)]" }

This don‘t work, too. I change forcast to forecast, no effect.

Since yesterday my pollen values are not working without changing anything. Only update over openhabian-config.
Get the message “don’t find null in pollen.map.”
Will check the complet message, but are there any ideas?

Ups, typo… changed this in original post…

Does work here:

Ok, But this don‘t work, too. Any Ideas?

So, I try it with the tool from jsonpath.com.

According to this tool, I get the right value with the path


BUT when I try to integrate it to an item like this

Number DWD_UVI_totay " UV-Index Heute [%s]" {http="<[cacheDWD_UVI:600000:JSONPATH($.content.[?(@.city=="Hamburg")].forecast.today)]" }

I get an error: dismatched input ‘Hamburg’ expecting ‘}’

I don’t know why. Can anybody help?

I find the answer. it should be single quote and not double quote

Number DWD_UVI_totay " UV-Index Heute [%s]" {http="<[cacheDWD_UVI:600000:JSONPATH($.content.[?(@.city=='Hamburg')].forecast.today)]" }

now it works :slight_smile:

1 Like