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

solved
Tags: #<Tag:0x00007fd311622870>

(Stefan) #1

Hello,
I would like to integrate the current pollen count in openhab, but I am not a JSON Path expert.
the JSON file is here: https://opendata.dwd.de/climate_environment/health/alerts/s31fg.json

Here is also a documentation which values are structured like:

My idea is to cache the JSON file via the http-binding:

http:cacheDWD_Pollen.url=https://opendata.dwd.de/climate_environment/health/alerts/s31fg.json
http:cacheDWD_Pollen.updateInterval=600000 

and then evaluate it via JSON path and write the values in proxy items:

DateTime	DWD_Pollen_last_update		"Letzte Aktualisierung"										{http="<[cacheDWD_Pollen:60000:JSONPath(??????)]" } 

Number		DWD_Pollen__Graeser_today			"Gräser Vorhersage für heute"						{http="<[cacheDWD_Pollen:60000:JSONPath(??????)]" }
Number		DWD_Pollen_Graeser_tomorrow			"Gräser Vorhersage für morgen"						{http="<[cacheDWD_Pollen:60000:JSONPath(??????)]" }
Number		DWD_Pollen__Graeser_dayafter_to		"Gräser Vorhersage für übermorgen"					{http="<[cacheDWD_Pollen:60000:JSONPath(??????)]" }

Number		DWD_Pollen__Birke_today				"Birke Vorhersage fĂĽr heute"						{http="<[cacheDWD_Pollen:60000:JSONPath(??????)]" }
Number		DWD_Pollen_Birke_tomorrow			"Birke Vorhersage fĂĽr morgen"						{http="<[cacheDWD_Pollen:60000:JSONPath(??????)]" }
Number		DWD_Pollen__Birke_dayafter_to		"Birke Vorhersage fĂĽr ĂĽbermorgen"					{http="<[cacheDWD_Pollen:60000:JSONPath(??????)]" }

maybe also in a rule:

        val String var1= sendHttpGetRequest("https://opendata.dwd.de/climate_environment/health/alerts/s31fg.json")
	var String value1 = transform("JSONPATH", "?????", var1)
	var String value2 = transform("JSONPATH", "?????", var1)
	var String value3 = transform("JSONPATH", "?????", var1)
	.....
	DWD_Pollen__Graeser_today.sendCommand(value1)
	DWD_Pollen_Graeser_tomorrow.sendCommand(value2)
	DWD_Pollen__Graeser_dayafter_to.sendCommand(value3)
        ......

Can someone help me? I would like the values for the region:

partregion_name":"Bayern n. der Donau, o. Bayr. Wald, o. Mainfranken"

Thanks a lot

Stefan

EDIT: SOLVED


[suggestion] Anyone willing to build a dwd_pollen binding?
[SOLVED] JSON Path weather warnings DWD (Deutscher Wetterdienst)
(Udo Hartmann) #2
DateTime DWD_Pollen_last_update          "Letzte Aktualisierung"            {http="<[cacheDWD_Pollen:60000:JSONPath($.last_update)]" } 

Number   DWD_Pollen__Graeser_today       "Gräser Vorhersage für heute"      {http="<[cacheDWD_Pollen:60000:JSONPath($.content[25].Pollen.Graeser.today)]" }
Number   DWD_Pollen_Graeser_tomorrow     "Gräser Vorhersage für morgen"     {http="<[cacheDWD_Pollen:60000:JSONPath($.content[25].Pollen.Graeser.tomorrow)]" }
Number   DWD_Pollen__Graeser_dayafter_to "Gräser Vorhersage für übermorgen" {http="<[cacheDWD_Pollen:60000:JSONPath($.content[25].Pollen.Graeser.dayafter_to)]" }

Number   DWD_Pollen__Birke_today         "Birke Vorhersage fĂĽr heute"       {http="<[cacheDWD_Pollen:60000:JSONPath($.content[25].Pollen.Birke.today)]" }
Number   DWD_Pollen_Birke_tomorrow       "Birke Vorhersage fĂĽr morgen"      {http="<[cacheDWD_Pollen:60000:JSONPath($.content[25].Pollen.Birke.tomorrow)]" }
Number   DWD_Pollen__Birke_dayafter_to   "Birke Vorhersage fĂĽr ĂĽbermorgen"  {http="<[cacheDWD_Pollen:60000:JSONPath($.content[25].Pollen.Birke.dayafter_to)]" }

Please be aware that there is no information if index [25] will always stay the same. Maybe you will have to use the rule code instead and get the index for the given partregion_id 123 (this one is fix)


(Udo Hartmann) #3

Would be very nice to get a binding for this :slight_smile:


(Vincent Regaud) #4
DateTime	DWD_Pollen_last_update		"Letzte Aktualisierung"										{http="<[cacheDWD_Pollen:60000:JSONPath($.lastupdate)]" } 

Number		DWD_Pollen__Graeser_today			"Gräser Vorhersage für heute"						{http="<[cacheDWD_Pollen:60000:JSONPath($.content[25].Pollen.Graeser.today)]" }
Number		DWD_Pollen_Graeser_tomorrow			"Gräser Vorhersage für morgen"						{http="<[cacheDWD_Pollen:60000:JSONPath($.content[25].Pollen.Graeser.tomorrow)]" }
Number		DWD_Pollen__Graeser_dayafter_to		"Gräser Vorhersage für übermorgen"					{http="<[cacheDWD_Pollen:60000:JSONPath($.content[25].Pollen.Graeser.dayafter_to)]" }

Number		DWD_Pollen__Birke_today				"Birke Vorhersage fĂĽr heute"						{http="<[cacheDWD_Pollen:60000:JSONPath($.content[25].Pollen.Birke.today]" }
Number		DWD_Pollen_Birke_tomorrow			"Birke Vorhersage fĂĽr morgen"						{http="<[cacheDWD_Pollen:60000:JSONPath($.content[25].Pollen.Birke.tomorrow)]" }
Number		DWD_Pollen__Birke_dayafter_to		"Birke Vorhersage fĂĽr ĂĽbermorgen"					{http="<[cacheDWD_Pollen:60000:JSONPath($.content[25].Pollen.Birke.dayafter_to)]" }

That’s assuming that the order of the regions doesn’t change

Or:

Number		DWD_Pollen__Graeser_today			"Gräser Vorhersage für heute"						{http="<[cacheDWD_Pollen:60000:JSONPath($.content[?(@.partregion_id==123)].Pollen.Graeser.today)]" }

And so on replace [25] with '[?(@.partregion_id==123)]` to make sure we get the region regardless of the order in the json


(Stefan) #5

@vzorglub

here my Pollen.items

String		DWD_Pollen_last_update				"Letzte Aktualisierung [%s]"							{http="<[cacheDWD_Pollen:60000:JSONPath($.lastupdate)]" } 

String		DWD_Pollen__Graeser_today			"Gräser Vorhersage für heute [%s]"						{http="<[cacheDWD_Pollen:60000:JSONPath($.content[?(@.partregion_id==123)].Pollen.Graeser.today)]" }
String		DWD_Pollen_Graeser_tomorrow			"Gräser Vorhersage für morgen [%s]"						{http="<[cacheDWD_Pollen:60000:JSONPath($.content[?(@.partregion_id==123)].Pollen.Graeser.tomorrow)]" }
String		DWD_Pollen__Graeser_dayafter_to		"Gräser Vorhersage für übermorgen [%s]"					{http="<[cacheDWD_Pollen:60000:JSONPath($.content[?(@.partregion_id==123)].Pollen.Graeser.dayafter_to)]" }

String		DWD_Pollen__Birke_today				"Birke Vorhersage fĂĽr heute [%s]"						{http="<[cacheDWD_Pollen:60000:JSONPath($.content[?(@.partregion_id==123)].Pollen.Birke.today)]" }
String		DWD_Pollen_Birke_tomorrow			"Birke Vorhersage fĂĽr morgen[%s] "						{http="<[cacheDWD_Pollen:60000:JSONPath($.content[?(@.partregion_id==123)].Pollen.Birke.tomorrow)]" }
String		DWD_Pollen__Birke_dayafter_to		"Birke Vorhersage fĂĽr ĂĽbermorgen[%s] "					{http="<[cacheDWD_Pollen:60000:JSONPath($.content[?(@.partregion_id==123)].Pollen.Birke.dayafter_to)]" }

http.cfg

http:cacheDWD_Pollen.url=https://opendata.dwd.de/climate_environment/health/alerts/s31fg.json
http:cacheDWD_Pollen.updateInterval=600000

but i got the following failure in the log file:

2018-05-18 13:17:06.009 [vent.ItemStateChangedEvent] - DWD_Pollen__Graeser_today changed from NULL to {"legend":{"id7":"3","id2":"0-1","id1":"0","id7_desc":"hohe Belastung","id2_desc":"keine bis geringe Belastung","id4":"1-2","id6":"2-3","id5_desc":"mittlere Belastung","id3_desc":"geringe Belastung","id6_desc":"mittlere bis hohe Belastung","id5":"2","id4_desc":"geringe bis mittlere Belastung","id1_desc":"keine Belastung","id3":"1"},"name":"Pollenflug-Gefahrenindex für Deutschland ausgegeben vom Deutschen Wetterdienst in Zusammenarbeit mit der Stiftung Deutscher Polleninformationsdienst","last_update":"2018-05-18 11:00 Uhr","content":[{"partregion_name":"Inseln und Marschen","Pollen":{"Esche":{"dayafter_to":"0","tomorrow":"0","today":"0"},"Birke":{"dayafter_to":"0-1","today":"0-1","tomorrow":"0-1"},"Graeser":{"dayafter_to":"2-3","today":"1-2","tomorrow":"1"},"Ambrosia":{"dayafter_to":"0","today":"0","tomorrow":"0"},"Erle":{"tomorrow":"0","dayafter_to":"0","today":"0"},"Roggen":{"dayafter_to":"0","tomorrow":"0","today":"0"},"Beifuss":{"dayafter_to":"0","tomorrow":"0","today":"0"},"Hasel":{"today":"0","dayafter_to":"0","tomorrow":"0"}},"region_name":"Schleswig-Holstein und Hamburg","partregion_id":11,"region_id":10},{"partregion_id":12,"region_id":10,"region_name":"Schleswig-Holstein und Hamburg","partregion_name":"Geest, Schleswig-Holstein und Hamburg","Pollen":{"Hasel":{"today":"0","dayafter_to":"0","tomorrow":"0"},"Roggen":{"dayafter_to":"0-1","tomorrow":"0","today":"0"},"Erle":{"tomorrow":"0","dayafter_to":"0","today":"0"},"Beifuss":{"dayafter_to":"0","today":"0","tomorrow":"0"},"Birke":{"tomorrow":"0-1","dayafter_to":"0-1","today":"0-1"},"Graeser":{"tomorrow":"2","dayafter_to":"2-3","today":"2"},"Esche":{"dayafter_to":"0","today":"0","tomorrow":"0"},"Ambrosia":{"today":"0","dayafter_to":"0","tomorrow":"0"}}},{"region_name":"Mecklenburg-Vorpommern ","Pollen":{"Hasel":{"tomorrow":"0","dayafter_to":"0","today":"0"},"Erle":{"tomorrow":"0","dayafter_to":"0","today":"0"},"Roggen":{"today":"0","dayafter_to":"0-1","tomorrow":"0"},"Beifuss":{"today":"0","dayafter_to":"0","tomorrow":"0"},"Birke":{"dayafter_to":"0-1","today":"0-1","tomorrow":"0-1"},"Graeser":{"tomorrow":"2","dayafter_to":"2","today":"2"},"Esche":{"today":"0","dayafter_to":"0","tomorrow":"0"},"Ambrosia":{"dayafter_to":"0","today":"0","tomorrow":"0"}},"partregion_name":"","partregion_id":-1,"region_id":20},{"partregion_id":31,"region_id":30,"partregion_name":"Westl. Niedersachsen/Bremen","Pollen":{"Hasel":{"dayafter_to":"0","tomorrow":"0","today":"0"},"Erle":{"dayafter_to":"0","today":"0","tomorrow":"0"},"Roggen":{"dayafter_to":"1-2","today":"1-2","tomorrow":"1-2"},"Beifuss":{"dayafter_to":"0","tomorrow":"0","today":"0"},"Ambrosia":{"dayafter_to":"0","today":"0","tomorrow":"0"},"Birke":{"tomorrow":"0-1","dayafter_to":"0-1","today":"0-1"},"Graeser":{"dayafter_to":"3","today":"2-3","tomorrow":"2-3"},"Esche":{"tomorrow":"0","dayafter_to":"0","today":"0"}},"region_name":"Niedersachsen und Bremen"},{"region_name":"Niedersachsen und Bremen","Pollen":{"Ambrosia":{"dayafter_to":"0","today":"0","tomorrow":"0"},"Esche":{"tomorrow":"0","dayafter_to":"0","today":"0"},"Graeser":{"today":"2-3","dayafter_to":"2-3","tomorrow":"2-3"},"Birke":{"tomorrow":"0-1","dayafter_to":"0-1","today":"0-1"},"Beifuss":{"dayafter_to":"0","today":"0","tomorrow":"0"},"Roggen":{"today":"1-2","dayafter_to":"1-2","tomorrow":"1-2"},"Erle":{"today":"0","dayafter_to":"0","tomorrow":"0"},"Hasel":{"dayafter_to":"0","tomorrow":"0","today":"0"}},"partregion_name":"Östl. Niedersachsen","partregion_id":32,"region_id":30},{"partregion_name":"Rhein.-Westfäl. Tiefland","Pollen":{"Erle":{"dayafter_to":"0","tomorrow":"0","today":"0"},"Beifuss":{"today":"0","dayafter_to":"0","tomorrow":"0"},"Roggen":{"dayafter_to":"1-2","tomorrow":"1-2","today":"1-2"},"Hasel":{"today":"0","dayafter_to":"0","tomorrow":"0"},"Esche":{"today":"0","dayafter_to":"0","tomorrow":"0"},"Birke":{"tomorrow":"0-1","dayafter_to":"0-1","today":"0-1"},"Graeser":{"dayafter_to":"3","today":"2-3","tomorrow":"2-3"},"Ambrosia":{"tomorrow":"0","dayafter_to":"0","today":"0"}},"region_name":"Nordrhein-Westfalen","region_id":40,"partregion_id":41},{"region_id":40,"partregion_id":42,"partregion_name":"Ostwestfalen","Pollen":{"Hasel":{"dayafter_to":"0","today":"0","tomorrow":"0"},"Roggen":{"tomorrow":"0-1","dayafter_to":"0-1","today":"0-1"},"Erle":{"dayafter_to":"0","tomorrow":"0","today":"0"},"Beifuss":{"tomorrow":"0","dayafter_to":"0","today":"0"},"Graeser":{"today":"2-3","dayafter_to":"3","tomorrow":"2-3"},"Birke":{"tomorrow":"0-1","dayafter_to":"0-1","today":"0-1"},"Esche":{"dayafter_to":"0","tomorrow":"0","today":"0"},"Ambrosia":{"today":"0","dayafter_to":"0","tomorrow":"0"}},"region_name":"Nordrhein-Westfalen"},{"region_id":40,"partregion_id":43,"region_name":"Nordrhein-Westfalen","Pollen":{"Hasel":{"tomorrow":"0","dayafter_to":"0","today":"0"},"Erle":{"dayafter_to":"0","tomorrow":"0","today":"0"},"Beifuss":{"dayafter_to":"0","tomorrow":"0","today":"0"},"Roggen":{"tomorrow":"0","dayafter_to":"0","today":"0"},"Ambrosia":{"dayafter_to":"0","today":"0","tomorrow":"0"},"Graeser":{"today":"2","dayafter_to":"2-3","tomorrow":"2-3"},"Birke":{"tomorrow":"0-1","dayafter_to":"0-1","today":"0-1"},"Esche":{"dayafter_to":"0","tomorrow":"0","today":"0"}},"partregion_name":"Mittelgebirge NRW"},{"partregion_name":"","Pollen":{"Roggen":{"dayafter_to":"1-2","today":"1-2","tomorrow":"1-2"},"Erle":{"today":"0","dayafter_to":"0","tomorrow":"0"},"Beifuss":{"tomorrow":"0","dayafter_to":"0","today":"0"},"Hasel":{"dayafter_to":"0","tomorrow":"0","today":"0"},"Ambrosia":{"dayafter_to":"0","today":"0","tomorrow":"0"},"Esche":{"dayafter_to":"0","tomorrow":"0","today":"0"},"Birke":{"tomorrow":"0-1","dayafter_to":"0-1","today":"0-1"},"Graeser":{"dayafter_to":"2-3","today":"2-3","tomorrow":"2-3"}},"region_name":"Brandenburg und Berlin ","region_id":50,"partregion_id":-1},{"region_id":60,"partregion_id":61,"region_name":"Sachsen-Anhalt","Pollen":{"Hasel":{"dayafter_to":"0","today":"0","tomorrow":"0"},"Roggen":{"dayafter_to":"1-2","tomorrow":"1-2","today":"1-2"},"Erle":{"dayafter_to":"0","today":"0","tomorrow":"0"},"Beifuss":{"tomorrow":"0","dayafter_to":"0","today":"0"},"Ambrosia":{"today":"0","dayafter_to":"0","tomorrow":"0"},"Birke":{"tomorrow":"0-1","dayafter_to":"0-1","today":"0-1"},"Graeser":{"today":"2-3","dayafter_to":"2-3","tomorrow":"2-3"},"Esche":{"today":"0","dayafter_to":"0","tomorrow":"0"}},"partregion_name":"Tiefland Sachsen-Anhalt"},{"region_name":"Sachsen-Anhalt","Pollen":{"Ambrosia":{"dayafter_to":"0","tomorrow":"0","today":"0"},"Graeser":{"dayafter_to":"2-3","today":"2","tomorrow":"2"},"Birke":{"tomorrow":"0-1","dayafter_to":"0-1","today":"0-1"},"Esche":{"tomorrow":"0","dayafter_to":"0","today":"0"},"Hasel":{"dayafter_to":"0","today":"0","tomorrow":"0"},"Beifuss":{"tomorrow":"0","dayafter_to":"0","today":"0"},"Roggen":{"dayafter_to":"0","today":"0","tomorrow":"0"},"Erle":{"today":"0","dayafter_to":"0","tomorrow":"0"}},"partregion_name":"Harz","region_id":60,"partregion_id":62},{"partregion_id":71,"region_id":70,"region_name":"Thüringen","partregion_name":"Tiefland Thüringen","Pollen":{"Esche":{"dayafter_to":"0","today":"0","tomorrow":"0"},"Birke":{"dayafter_to":"0-1","tomorrow":"0-1","today":"0-1"},"Graeser":{"tomorrow":"2-3","dayafter_to":"3","today":"2-3"},"Ambrosia":{"tomorrow":"0","dayafter_to":"0","today":"0"},"Beifuss":{"dayafter_to":"0","today":"0","tomorrow":"0"},"Erle":{"tomorrow":"0","dayafter_to":"0","today":"0"},"Roggen":{"today":"0-1","dayafter_to":"0-1","tomorrow":"0-1"},"Hasel":{"dayafter_to":"0","tomorrow":"0","today":"0"}}},{"region_name":"Thüringen","partregion_name":"Mittelgebirge Thüringen","Pollen":{"Ambrosia":{"tomorrow":"0","dayafter_to":"0","today":"0"},"Esche":{"dayafter_to":"0","tomorrow":"0","today":"0"},"Graeser":{"tomorrow":"2","dayafter_to":"2-3","today":"2"},"Birke":{"today":"0-1","dayafter_to":"0-1","tomorrow":"0-1"},"Beifuss":{"today":"0","dayafter_to":"0","tomorrow":"0"},"Erle":{"today":"0","dayafter_to":"0","tomorrow":"0"},"Roggen":{"dayafter_to":"0","today":"0","tomorrow":"0"},"Hasel":{"dayafter_to":"0","today":"0","tomorrow":"0"}},"region_id":70,"partregion_id":72},{"region_id":80,"partregion_id":81,"partregion_name":"Tiefland Sachsen","Pollen":{"Esche":{"tomorrow":"0","dayafter_to":"0","today":"0"},"Graeser":{"tomorrow":"2-3","dayafter_to":"2-3","today":"2-3"},"Birke":{"tomorrow":"0-1","dayafter_to":"0-1","today":"0-1"},"Ambrosia":{"dayafter_to":"0","today":"0","tomorrow":"0"},"Beifuss":{"tomorrow":"0","dayafter_to":"0","today":"0"},"Erle":{"tomorrow":"0","dayafter_to":"0","today":"0"},"Roggen":{"today":"1","dayafter_to":"1-2","tomorrow":"1"},"Hasel":{"dayafter_to":"0","tomorrow":"0","today":"0"}},"region_name":"Sachsen"},{"partregion_name":"Mittelgebirge Sachsen","Pollen":{"Hasel":{"dayafter_to":"0","today":"0","tomorrow":"0"},"Erle":{"dayafter_to":"0","today":"0","tomorrow":"0"},"Roggen":{"dayafter_to":"0","tomorrow":"0","today":"0"},"Beifuss":{"dayafter_to":"0","tomorrow":"0","today":"0"},"Ambrosia":{"tomorrow":"0","dayafter_to":"0","today":"0"},"Graeser":{"dayafter_to":"2-3","today":"2","tomorrow":"2"},"Birke":{"dayafter_to":"0-1","tomorrow":"0-1","today":"0-1"},"Esche":{"dayafter_to":"0","tomorrow":"0","today":"0"}},"region_name":"Sachsen","region_id":80,"partregion_id":82},{"partregion_id":91,"region_id":90,"Pollen":{"Hasel":{"tomorrow":"0","dayafter_to":"0","today":"0"},"Roggen":{"dayafter_to":"0-1","tomorrow":"0-1","today":"0-1"},"Erle":{"dayafter_to":"0","today":"0","tomorrow":"0"},"Beifuss":{"dayafter_to":"0","tomorrow":"0","today":"0"},"Birke":{"tomorrow":"0-1","dayafter_to":"0-1","today":"0-1"},"Graeser":{"dayafter_to":"3","tomorrow":"2-3","today":"2-3"},"Esche":{"dayafter_to":"0","tomorrow":"0","today":"0"},"Ambrosia":{"tomorrow":"0","dayafter_to":"0","today":"0"}},"partregion_name":"Nordhessen und hess. Mittelgebirge","region_name":"Hessen"},{"partregion_name":"Rhein-Main","Pollen":{"Ambrosia":{"today":"0","dayafter_to":"0","tomorrow":"0"},"Graeser":{"tomorrow":"3","dayafter_to":"3","today":"2-3"},"Birke":{"dayafter_to":"0-1","today":"0-1","tomorrow":"0-1"},"Esche":{"dayafter_to":"0","tomorrow":"0","today":"0"},"Hasel":{"dayafter_to":"0","today":"0","tomorrow":"0"},"Roggen":{"dayafter_to":"1","tomorrow":"1","today":"1"},"Erle":{"tomorrow":"0","dayafter_to":"0","today":"0"},"Beifuss":{"dayafter_to":"0","today":"0","tomorrow":"0"}},"region_name":"Hessen","region_id":90,"partregion_id":92},{"partregion_id":103,"region_id":100,"region_name":"Rheinland-Pfalz und Saarland","Pollen":{"Hasel":{"dayafter_to":"0","tomorrow":"0","today":"0"},"Erle":{"dayafter_to":"0","today":"0","tomorrow":"0"},"Roggen":{"tomorrow":"1","dayafter_to":"1","today":"1"},"Beifuss":{"tomorrow":"0","dayafter_to":"0","today":"0"},"Ambrosia":{"tomorrow":"0","dayafter_to":"0","today":"0"},"Birke":{"dayafter_to":"0-1","tomorrow":"0-1","today":"0-1"},"Graeser":{"dayafter_to":"3","tomorrow":"3","today":"2-3"},"Esche":{"tomorrow":"0","dayafter_to":"0","today":"0"}},"partregion_name":"Saarland"},{"Pollen":{"Hasel":{"dayafter_to":"0","today":"0","tomorrow":"0"},"Beifuss":{"dayafter_to":"0","today":"0","tomorrow":"0"},"Roggen":{"tomorrow":"1","dayafter_to":"1","today":"1"},"Erle":{"dayafter_to":"0","today":"0","tomorrow":"0"},"Birke":{"dayafter_to":"0-1","today":"0-1","tomorrow":"0-1"},"Graeser":{"today":"2-3","dayafter_to":"3","tomorrow":"3"},"Esche":{"dayafter_to":"0","today":"0","tomorrow":"0"},"Ambrosia":{"tomorrow":"0","dayafter_to":"0","today":"0"}},"partregion_name":"Rhein, Pfalz, Nahe und Mosel","region_name":"Rheinland-Pfalz und Saarland","partregion_id":101,"region_id":100},{"partregion_id":102,"region_id":100,"Pollen":{"Erle":{"dayafter_to":"0","tomorrow":"0","today":"0"},"Beifuss":{"tomorrow":"0","dayafter_to":"0","today":"0"},"Roggen":{"dayafter_to":"0","tomorrow":"0","today":"0"},"Hasel":{"dayafter_to":"0","today":"0","tomorrow":"0"},"Esche":{"tomorrow":"0","dayafter_to":"0","today":"0"},"Birke":{"today":"0-1","dayafter_to":"0-1","tomorrow":"0-1"},"Graeser":{"today":"2","dayafter_to":"2-3","tomorrow":"2-3"},"Ambrosia":{"dayafter_to":"0","tomorrow":"0","today":"0"}},"partregion_name":"Mittelgebirgsbereich Rheinland-Pfalz","region_name":"Rheinland-Pfalz und Saarland"},{"partregion_id":111,"region_id":110,"region_name":"Baden-Württemberg","partregion_name":"Oberrhein und unteres Neckartal","Pollen":{"Hasel":{"dayafter_to":"0","today":"0","tomorrow":"0"},"Erle":{"today":"0","dayafter_to":"0","tomorrow":"0"},"Roggen":{"today":"1","dayafter_to":"1","tomorrow":"1"},"Beifuss":{"dayafter_to":"0","today":"0","tomorrow":"0"},"Birke":{"dayafter_to":"0-1","today":"0-1","tomorrow":"0-1"},"Graeser":{"today":"3","dayafter_to":"3","tomorrow":"3"},"Esche":{"today":"0","dayafter_to":"0","tomorrow":"0"},"Ambrosia":{"dayafter_to":"0","today":"0","tomorrow":"0"}}},{"region_id":110,"partregion_id":112,"Pollen":{"Erle":{"dayafter_to":"0","tomorrow":"0","today":"0"},"Roggen":{"tomorrow":"0-1","dayafter_to":"0-1","today":"0-1"},"Beifuss":{"dayafter_to":"0","tomorrow":"0","today":"0"},"Hasel":{"today":"0","dayafter_to":"0","tomorrow":"0"},"Esche":{"tomorrow":"0","dayafter_to":"0","today":"0"},"Birke":{"today":"0-1","dayafter_to":"0-1","tomorrow":"0-1"},"Graeser":{"dayafter_to":"2-3","today":"2-3","tomorrow":"2-3"},"Ambrosia":{"dayafter_to":"0","tomorrow":"0","today":"0"}},"partregion_name":"Hohenlohe/mittlerer Neckar/Oberschwaben","region_name":"Baden-Württemberg"},{"region_name":"Baden-Württemberg","Pollen":{"Beifuss":{"dayafter_to":"0","tomorrow":"0","today":"0"},"Roggen":{"dayafter_to":"0","tomorrow":"0","today":"0"},"Erle":{"tomorrow":"0","dayafter_to":"0","today":"0"},"Hasel":{"today":"0","dayafter_to":"0","tomorrow":"0"},"Esche":{"dayafter_to":"0","today":"0","tomorrow":"0"},"Birke":{"tomorrow":"0-1","dayafter_to":"0-1","today":"0-1"},"Graeser":{"dayafter_to":"2-3","tomorrow":"2","today":"2"},"Ambrosia":{"dayafter_to":"0","tomorrow":"0","today":"0"}},"partregion_name":"Mittelgebirge Baden-Württemberg","region_id":110,"partregion_id":113},{"partregion_id":121,"region_id":120,"region_name":"Bayern","Pollen":{"Erle":{"today":"0","dayafter_to":"0","tomorrow":"0"},"Roggen":{"today":"0-1","dayafter_to":"0-1","tomorrow":"0-1"},"Beifuss":{"dayafter_to":"0","tomorrow":"0","today":"0"},"Hasel":{"tomorrow":"0","dayafter_to":"0","today":"0"},"Esche":{"tomorrow":"0","dayafter_to":"0","today":"0"},"Birke":{"dayafter_to":"0-1","tomorrow":"0-1","today":"0-1"},"Graeser":{"dayafter_to":"3","tomorrow":"2-3","today":"2-3"},"Ambrosia":{"dayafter_to":"0","tomorrow":"0","today":"0"}},"partregion_name":"Allgäu/Oberbayern/Bay. Wald"},{"Pollen":{"Erle":{"today":"0","dayafter_to":"0","tomorrow":"0"},"Roggen":{"dayafter_to":"0-1","today":"0-1","tomorrow":"0-1"},"Beifuss":{"dayafter_to":"0","tomorrow":"0","today":"0"},"Hasel":{"dayafter_to":"0","tomorrow":"0","today":"0"},"Esche":{"dayafter_to":"0","today":"0","tomorrow":"0"},"Graeser":{"dayafter_to":"3","tomorrow":"2-3","today":"2-3"},"Birke":{"today":"0-1","dayafter_to":"0-1","tomorrow":"0-1"},"Ambrosia":{"tomorrow":"0","dayafter_to":"0","today":"0"}},"partregion_name":"Donauniederungen","region_name":"Bayern","region_id":120,"partregion_id":122},{"region_id":120,"partregion_id":123,"Pollen":{"Hasel":{"dayafter_to":"0","today":"0","tomorrow":"0"},"Roggen":{"today":"0-1","dayafter_to":"0-1","tomorrow":"0-1"},"Erle":{"dayafter_to":"0","today":"0","tomorrow":"0"},"Beifuss":{"dayafter_to":"0","today":"0","tomorrow":"0"},"Birke":{"dayafter_to":"0-1","tomorrow":"0-1","today":"0-1"},"Graeser":{"dayafter_to":"3","today":"2-3","tomorrow":"2-3"},"Esche":{"tomorrow":"0","dayafter_to":"0","today":"0"},"Ambrosia":{"dayafter_to":"0","tomorrow":"0","today":"0"}},"partregion_name":"Bayern n. der Donau, o. Bayr. Wald, o. Mainfranken","region_name":"Bayern"},{"region_id":120,"partregion_id":124,"region_name":"Bayern","partregion_name":"Mainfranken","Pollen":{"Erle":{"dayafter_to":"0","tomorrow":"0","today":"0"},"Roggen":{"dayafter_to":"0-1","tomorrow":"0-1","today":"0-1"},"Beifuss":{"tomorrow":"0","dayafter_to":"0","today":"0"},"Hasel":{"tomorrow":"0","dayafter_to":"0","today":"0"},"Ambrosia":{"tomorrow":"0","dayafter_to":"0","today":"0"},"Esche":{"dayafter_to":"0","today":"0","tomorrow":"0"},"Graeser":{"today":"2-3","dayafter_to":"3","tomorrow":"2-3"},"Birke":{"dayafter_to":"0-1","tomorrow":"0-1","today":"0-1"}}}],"next_update":"2018-05-19 11:00 Uhr","sender":"Deutscher Wetterdienst - Medizin-Meteorologie"}
2018-05-18 13:17:04.981 [INFO ] [el.core.internal.ModelRepositoryImpl] - Refreshing model 'Pollen.items'
2018-05-18 13:17:05.974 [WARN ] [.core.transform.TransformationHelper] - Cannot get service reference for transformation service of type JSONPath
2018-05-18 13:17:05.976 [WARN ] [ab.binding.http.internal.HttpBinding] - Couldn't transform response because transformationService of type 'JSONPath' is unavailable
2018-05-18 13:17:05.985 [WARN ] [.core.transform.TransformationHelper] - Cannot get service reference for transformation service of type JSONPath
2018-05-18 13:17:05.987 [WARN ] [ab.binding.http.internal.HttpBinding] - Couldn't transform response because transformationService of type 'JSONPath' is unavailable
2018-05-18 13:17:05.995 [WARN ] [.core.transform.TransformationHelper] - Cannot get service reference for transformation service of type JSONPath
2018-05-18 13:17:05.998 [WARN ] [ab.binding.http.internal.HttpBinding] - Couldn't transform response because transformationService of type 'JSONPath' is unavailable
2018-05-18 13:17:06.006 [WARN ] [.core.transform.TransformationHelper] - Cannot get service reference for transformation service of type JSONPath
2018-05-18 13:17:06.009 [WARN ] [ab.binding.http.internal.HttpBinding] - Couldn't transform response because transformationService of type 'JSONPath' is unavailable
2018-05-18 13:17:06.018 [WARN ] [.core.transform.TransformationHelper] - Cannot get service reference for transformation service of type JSONPath
2018-05-18 13:17:06.021 [WARN ] [ab.binding.http.internal.HttpBinding] - Couldn't transform response because transformationService of type 'JSONPath' is unavailable
2018-05-18 13:17:06.081 [WARN ] [.core.transform.TransformationHelper] - Cannot get service reference for transformation service of type JSONPath
2018-05-18 13:17:06.084 [WARN ] [ab.binding.http.internal.HttpBinding] - Couldn't transform response because transformationService of type 'JSONPath' is unavailable
2018-05-18 13:17:06.100 [WARN ] [.core.transform.TransformationHelper] - Cannot get service reference for transformation service of type JSONPath
2018-05-18 13:17:06.102 [WARN ] [ab.binding.http.internal.HttpBinding] - Couldn't transform response because transformationService of type 'JSONPath' is unavailable
2018-05-18 13:18:06.847 [WARN ] [.core.transform.TransformationHelper] - Cannot get service reference for transformation service of type JSONPath
2018-05-18 13:18:06.849 [WARN ] [ab.binding.http.internal.HttpBinding] - Couldn't transform response because transformationService of type 'JSONPath' is unavailable
2018-05-18 13:18:06.856 [WARN ] [.core.transform.TransformationHelper] - Cannot get service reference for transformation service of type JSONPath
2018-05-18 13:18:06.858 [WARN ] [ab.binding.http.internal.HttpBinding] - Couldn't transform response because transformationService of type 'JSONPath' is unavailable
2018-05-18 13:18:06.865 [WARN ] [.core.transform.TransformationHelper] - Cannot get service reference for transformation service of type JSONPath
2018-05-18 13:18:06.868 [WARN ] [ab.binding.http.internal.HttpBinding] - Couldn't transform response because transformationService of type 'JSONPath' is unavailable
2018-05-18 13:18:06.875 [WARN ] [.core.transform.TransformationHelper] - Cannot get service reference for transformation service of type JSONPath
2018-05-18 13:18:06.878 [WARN ] [ab.binding.http.internal.HttpBinding] - Couldn't transform response because transformationService of type 'JSONPath' is unavailable
2018-05-18 13:18:06.885 [WARN ] [.core.transform.TransformationHelper] - Cannot get service reference for transformation service of type JSONPath
2018-05-18 13:18:06.887 [WARN ] [ab.binding.http.internal.HttpBinding] - Couldn't transform response because transformationService of type 'JSONPath' is unavailable
2018-05-18 13:18:06.894 [WARN ] [.core.transform.TransformationHelper] - Cannot get service reference for transformation service of type JSONPath
2018-05-18 13:18:06.896 [WARN ] [ab.binding.http.internal.HttpBinding] - Couldn't transform response because transformationService of type 'JSONPath' is unavailable
2018-05-18 13:18:06.903 [WARN ] [.core.transform.TransformationHelper] - Cannot get service reference for transformation service of type JSONPath
2018-05-18 13:18:06.905 [WARN ] [ab.binding.http.internal.HttpBinding] - Couldn't transform response because transformationService of type 'JSONPath' is unavailable

(Marcus K.) #6

do you have JSONPath Transformation installed?


(Stefan) #7

Yes it is installed.

and I use it since a year to transform the JSON File from my NUKI Smart Lock

  /* ------------------------------------------------------------------------ */
 /* Nuki Status ĂĽber API alle 30 Sekunden
/ ------------------------------------------------------------------------- */

rule "Nuki Status ĂĽber API alle 30 Sekunden"
when 
    Time cron "*/30 * * * * ?"
then
	logInfo("Rules", "Nuki Status ĂĽber API alle 30 Sekunden")
	val String var1= sendHttpGetRequest("http://<IP-Adresse>:8080/lockState?token=ABCDEFG&nukiId=123456789")
	var String value1 = transform("JSONPATH", "$.state", var1)
	var String value2 = transform("JSONPATH", "$.batteryCritical", var1)
	nukiHaustuer_status.sendCommand(value1)
	nukiHaustuer_LowBattery.sendCommand(value2)
end

(Vincent Regaud) #8

JSONPATH all capitals


(Stefan) #9

:star_struck: THX a lot

but this item show following log:

String		DWD_Pollen_last_update				"Letzte Aktualisierung [%s]"							{http="<[cacheDWD_Pollen:60000:JSONPATH($.lastupdate)]" } 
org.openhab.core.transform.TransformationException: Invalid path '$.lastupdate' in '{"legend":{"id7":"3","id2":"0-1","id1":"0","id7_desc":"hohe Belastung","id2_desc":"keine bis geringe Belastung","id4":"1-2","id6":"2-3","id5_desc":"mittlere Belastung","id3_desc":"geringe Belastung","id6_desc":"mittlere bis hohe Belastung","id5":"2","id4_desc":"geringe bis mittlere Belastung","id1_desc":"keine Belastung","id3":"1"},"name":"Pollenflug-Gefahrenindex für Deutschland ausgegeben vom Deutschen Wetterdienst in Zusammenarbeit mit der Stiftung Deutscher Polleninformationsdienst","last_update":"2018-05-18 11:00 Uhr","content":[{"partregion_name":"Inseln und Marschen","Pollen":{"Esche":{"dayafter_to":"0","tomorrow":"0","today":"0"},"Birke":{"dayafter_to":"0-1","today":"0-1","tomorrow":"0-1"},"Graeser":{"dayafter_to":"2-3","today":"1-2","tomorrow":"1"},"Ambrosia":{"dayafter_to":"0","today":"0","tomorrow":"0"},"Erle":{"tomorrow":"0","dayafter_to":"0","today":"0"},"Roggen":{"dayafter_to":"0","tomorrow":"0","today":"0"},"Beifuss":{"dayafter_to":"0","tomorrow":"0","today":"0"},"Hasel":{"today":"0","dayafter_to":"0","tomorrow":"0"}},"region_name":"Schleswig-Holstein und Hamburg","partregion_id":11,"region_id":10},{"partregion_id":12,"region_id":10,"region_name":"Schleswig-Holstein und Hamburg","partregion_name":"Geest, Schleswig-Holstein und Hamburg","Pollen":{"Hasel":{"today":"0","dayafter_to":"0","tomorrow":"0"},"Roggen":{"dayafter_to":"0-1","tomorrow":"0","today":"0"},"Erle":{"tomorrow":"0","dayafter_to":"0","today":"0"},"Beifuss":{"dayafter_to":"0","today":"0","tomorrow":"0"},"Birke":{"tomorrow":"0-1","dayafter_to":"0-1","today":"0-1"},"Graeser":{"tomorrow":"2","dayafter_to":"2-3","today":"2"},"Esche":{"dayafter_to":"0","today":"0","tomorrow":"0"},"Ambrosia":{"today":"0","dayafter_to":"0","tomorrow":"0"}}},{"region_name":"Mecklenburg-Vorpommern ","Pollen":{"Hasel":{"tomorrow":"0","dayafter_to":"0","today":"0"},"Erle":{"tomorrow":"0","dayafter_to":"0","today":"0"},"Roggen":{"today":"0","dayafter_to":"0-1","tomorrow":"0"},"Beifuss":{"today":"0","dayafter_to":"0","tomorrow":"0"},"Birke":{"dayafter_to":"0-1","today":"0-1","tomorrow":"0-1"},"Graeser":{"tomorrow":"2","dayafter_to":"2","today":"2"},"Esche":{"today":"0","dayafter_to":"0","tomorrow":"0"},"Ambrosia":{"dayafter_to":"0","today":"0","tomorrow":"0"}},"partregion_name":"","partregion_id":-1,"region_id":20},{"partregion_id":31,"region_id":30,"partregion_name":"Westl. Niedersachsen/Bremen","Pollen":{"Hasel":{"dayafter_to":"0","tomorrow":"0","today":"0"},"Erle":{"dayafter_to":"0","today":"0","tomorrow":"0"},"Roggen":{"dayafter_to":"1-2","today":"1-2","tomorrow":"1-2"},"Beifuss":{"dayafter_to":"0","tomorrow":"0","today":"0"},"Ambrosia":{"dayafter_to":"0","today":"0","tomorrow":"0"},"Birke":{"tomorrow":"0-1","dayafter_to":"0-1","today":"0-1"},"Graeser":{"dayafter_to":"3","today":"2-3","tomorrow":"2-3"},"Esche":{"tomorrow":"0","dayafter_to":"0","today":"0"}},"region_name":"Niedersachsen und Bremen"},{"region_name":"Niedersachsen und Bremen","Pollen":{"Ambrosia":{"dayafter_to":"0","today":"0","tomorrow":"0"},"Esche":{"tomorrow":"0","dayafter_to":"0","today":"0"},"Graeser":{"today":"2-3","dayafter_to":"2-3","tomorrow":"2-3"},"Birke":{"tomorrow":"0-1","dayafter_to":"0-1","today":"0-1"},"Beifuss":{"dayafter_to":"0","today":"0","tomorrow":"0"},"Roggen":{"today":"1-2","dayafter_to":"1-2","tomorrow":"1-2"},"Erle":{"today":"0","dayafter_to":"0","tomorrow":"0"},"Hasel":{"dayafter_to":"0","tomorrow":"0","today":"0"}},"partregion_name":"Östl. Niedersachsen","partregion_id":32,"region_id":30},{"partregion_name":"Rhein.-Westfäl. Tiefland","Pollen":{"Erle":{"dayafter_to":"0","tomorrow":"0","today":"0"},"Beifuss":{"today":"0","dayafter_to":"0","tomorrow":"0"},"Roggen":{"dayafter_to":"1-2","tomorrow":"1-2","today":"1-2"},"Hasel":{"today":"0","dayafter_to":"0","tomorrow":"0"},"Esche":{"today":"0","dayafter_to":"0","tomorrow":"0"},"Birke":{"tomorrow":"0-1","dayafter_to":"0-1","today":"0-1"},"Graeser":{"dayafter_to":"3","today":"2-3","tomorrow":"2-3"},"Ambrosia":{"tomorrow":"0","dayafter_to":"0","today":"0"}},"region_name":"Nordrhein-Westfalen","region_id":40,"partregion_id":41},{"region_id":40,"partregion_id":42,"partregion_name":"Ostwestfalen","Pollen":{"Hasel":{"dayafter_to":"0","today":"0","tomorrow":"0"},"Roggen":{"tomorrow":"0-1","dayafter_to":"0-1","today":"0-1"},"Erle":{"dayafter_to":"0","tomorrow":"0","today":"0"},"Beifuss":{"tomorrow":"0","dayafter_to":"0","today":"0"},"Graeser":{"today":"2-3","dayafter_to":"3","tomorrow":"2-3"},"Birke":{"tomorrow":"0-1","dayafter_to":"0-1","today":"0-1"},"Esche":{"dayafter_to":"0","tomorrow":"0","today":"0"},"Ambrosia":{"today":"0","dayafter_to":"0","tomorrow":"0"}},"region_name":"Nordrhein-Westfalen"},{"region_id":40,"partregion_id":43,"region_name":"Nordrhein-Westfalen","Pollen":{"Hasel":{"tomorrow":"0","dayafter_to":"0","today":"0"},"Erle":{"dayafter_to":"0","tomorrow":"0","today":"0"},"Beifuss":{"dayafter_to":"0","tomorrow":"0","today":"0"},"Roggen":{"tomorrow":"0","dayafter_to":"0","today":"0"},"Ambrosia":{"dayafter_to":"0","today":"0","tomorrow":"0"},"Graeser":{"today":"2","dayafter_to":"2-3","tomorrow":"2-3"},"Birke":{"tomorrow":"0-1","dayafter_to":"0-1","today":"0-1"},"Esche":{"dayafter_to":"0","tomorrow":"0","today":"0"}},"partregion_name":"Mittelgebirge NRW"},{"partregion_name":"","Pollen":{"Roggen":{"dayafter_to":"1-2","today":"1-2","tomorrow":"1-2"},"Erle":{"today":"0","dayafter_to":"0","tomorrow":"0"},"Beifuss":{"tomorrow":"0","dayafter_to":"0","today":"0"},"Hasel":{"dayafter_to":"0","tomorrow":"0","today":"0"},"Ambrosia":{"dayafter_to":"0","today":"0","tomorrow":"0"},"Esche":{"dayafter_to":"0","tomorrow":"0","today":"0"},"Birke":{"tomorrow":"0-1","dayafter_to":"0-1","today":"0-1"},"Graeser":{"dayafter_to":"2-3","today":"2-3","tomorrow":"2-3"}},"region_name":"Brandenburg und Berlin ","region_id":50,"partregion_id":-1},{"region_id":60,"partregion_id":61,"region_name":"Sachsen-Anhalt","Pollen":{"Hasel":{"dayafter_to":"0","today":"0","tomorrow":"0"},"Roggen":{"dayafter_to":"1-2","tomorrow":"1-2","today":"1-2"},"Erle":{"dayafter_to":"0","today":"0","tomorrow":"0"},"Beifuss":{"tomorrow":"0","dayafter_to":"0","today":"0"},"Ambrosia":{"today":"0","dayafter_to":"0","tomorrow":"0"},"Birke":{"tomorrow":"0-1","dayafter_to":"0-1","today":"0-1"},"Graeser":{"today":"2-3","dayafter_to":"2-3","tomorrow":"2-3"},"Esche":{"today":"0","dayafter_to":"0","tomorrow":"0"}},"partregion_name":"Tiefland Sachsen-Anhalt"},{"region_name":"Sachsen-Anhalt","Pollen":{"Ambrosia":{"dayafter_to":"0","tomorrow":"0","today":"0"},"Graeser":{"dayafter_to":"2-3","today":"2","tomorrow":"2"},"Birke":{"tomorrow":"0-1","dayafter_to":"0-1","today":"0-1"},"Esche":{"tomorrow":"0","dayafter_to":"0","today":"0"},"Hasel":{"dayafter_to":"0","today":"0","tomorrow":"0"},"Beifuss":{"tomorrow":"0","dayafter_to":"0","today":"0"},"Roggen":{"dayafter_to":"0","today":"0","tomorrow":"0"},"Erle":{"today":"0","dayafter_to":"0","tomorrow":"0"}},"partregion_name":"Harz","region_id":60,"partregion_id":62},{"partregion_id":71,"region_id":70,"region_name":"Thüringen","partregion_name":"Tiefland Thüringen","Pollen":{"Esche":{"dayafter_to":"0","today":"0","tomorrow":"0"},"Birke":{"dayafter_to":"0-1","tomorrow":"0-1","today":"0-1"},"Graeser":{"tomorrow":"2-3","dayafter_to":"3","today":"2-3"},"Ambrosia":{"tomorrow":"0","dayafter_to":"0","today":"0"},"Beifuss":{"dayafter_to":"0","today":"0","tomorrow":"0"},"Erle":{"tomorrow":"0","dayafter_to":"0","today":"0"},"Roggen":{"today":"0-1","dayafter_to":"0-1","tomorrow":"0-1"},"Hasel":{"dayafter_to":"0","tomorrow":"0","today":"0"}}},{"region_name":"Thüringen","partregion_name":"Mittelgebirge Thüringen","Pollen":{"Ambrosia":{"tomorrow":"0","dayafter_to":"0","today":"0"},"Esche":{"dayafter_to":"0","tomorrow":"0","today":"0"},"Graeser":{"tomorrow":"2","dayafter_to":"2-3","today":"2"},"Birke":{"today":"0-1","dayafter_to":"0-1","tomorrow":"0-1"},"Beifuss":{"today":"0","dayafter_to":"0","tomorrow":"0"},"Erle":{"today":"0","dayafter_to":"0","tomorrow":"0"},"Roggen":{"dayafter_to":"0","today":"0","tomorrow":"0"},"Hasel":{"dayafter_to":"0","today":"0","tomorrow":"0"}},"region_id":70,"partregion_id":72},{"region_id":80,"partregion_id":81,"partregion_name":"Tiefland Sachsen","Pollen":{"Esche":{"tomorrow":"0","dayafter_to":"0","today":"0"},"Graeser":{"tomorrow":"2-3","dayafter_to":"2-3","today":"2-3"},"Birke":{"tomorrow":"0-1","dayafter_to":"0-1","today":"0-1"},"Ambrosia":{"dayafter_to":"0","today":"0","tomorrow":"0"},"Beifuss":{"tomorrow":"0","dayafter_to":"0","today":"0"},"Erle":{"tomorrow":"0","dayafter_to":"0","today":"0"},"Roggen":{"today":"1","dayafter_to":"1-2","tomorrow":"1"},"Hasel":{"dayafter_to":"0","tomorrow":"0","today":"0"}},"region_name":"Sachsen"},{"partregion_name":"Mittelgebirge Sachsen","Pollen":{"Hasel":{"dayafter_to":"0","today":"0","tomorrow":"0"},"Erle":{"dayafter_to":"0","today":"0","tomorrow":"0"},"Roggen":{"dayafter_to":"0","tomorrow":"0","today":"0"},"Beifuss":{"dayafter_to":"0","tomorrow":"0","today":"0"},"Ambrosia":{"tomorrow":"0","dayafter_to":"0","today":"0"},"Graeser":{"dayafter_to":"2-3","today":"2","tomorrow":"2"},"Birke":{"dayafter_to":"0-1","tomorrow":"0-1","today":"0-1"},"Esche":{"dayafter_to":"0","tomorrow":"0","today":"0"}},"region_name":"Sachsen","region_id":80,"partregion_id":82},{"partregion_id":91,"region_id":90,"Pollen":{"Hasel":{"tomorrow":"0","dayafter_to":"0","today":"0"},"Roggen":{"dayafter_to":"0-1","tomorrow":"0-1","today":"0-1"},"Erle":{"dayafter_to":"0","today":"0","tomorrow":"0"},"Beifuss":{"dayafter_to":"0","tomorrow":"0","today":"0"},"Birke":{"tomorrow":"0-1","dayafter_to":"0-1","today":"0-1"},"Graeser":{"dayafter_to":"3","tomorrow":"2-3","today":"2-3"},"Esche":{"dayafter_to":"0","tomorrow":"0","today":"0"},"Ambrosia":{"tomorrow":"0","dayafter_to":"0","today":"0"}},"partregion_name":"Nordhessen und hess. Mittelgebirge","region_name":"Hessen"},{"partregion_name":"Rhein-Main","Pollen":{"Ambrosia":{"today":"0","dayafter_to":"0","tomorrow":"0"},"Graeser":{"tomorrow":"3","dayafter_to":"3","today":"2-3"},"Birke":{"dayafter_to":"0-1","today":"0-1","tomorrow":"0-1"},"Esche":{"dayafter_to":"0","tomorrow":"0","today":"0"},"Hasel":{"dayafter_to":"0","today":"0","tomorrow":"0"},"Roggen":{"dayafter_to":"1","tomorrow":"1","today":"1"},"Erle":{"tomorrow":"0","dayafter_to":"0","today":"0"},"Beifuss":{"dayafter_to":"0","today":"0","tomorrow":"0"}},"region_name":"Hessen","region_id":90,"partregion_id":92},{"partregion_id":103,"region_id":100,"region_name":"Rheinland-Pfalz und Saarland","Pollen":{"Hasel":{"dayafter_to":"0","tomorrow":"0","today":"0"},"Erle":{"dayafter_to":"0","today":"0","tomorrow":"0"},"Roggen":{"tomorrow":"1","dayafter_to":"1","today":"1"},"Beifuss":{"tomorrow":"0","dayafter_to":"0","today":"0"},"Ambrosia":{"tomorrow":"0","dayafter_to":"0","today":"0"},"Birke":{"dayafter_to":"0-1","tomorrow":"0-1","today":"0-1"},"Graeser":{"dayafter_to":"3","tomorrow":"3","today":"2-3"},"Esche":{"tomorrow":"0","dayafter_to":"0","today":"0"}},"partregion_name":"Saarland"},{"Pollen":{"Hasel":{"dayafter_to":"0","today":"0","tomorrow":"0"},"Beifuss":{"dayafter_to":"0","today":"0","tomorrow":"0"},"Roggen":{"tomorrow":"1","dayafter_to":"1","today":"1"},"Erle":{"dayafter_to":"0","today":"0","tomorrow":"0"},"Birke":{"dayafter_to":"0-1","today":"0-1","tomorrow":"0-1"},"Graeser":{"today":"2-3","dayafter_to":"3","tomorrow":"3"},"Esche":{"dayafter_to":"0","today":"0","tomorrow":"0"},"Ambrosia":{"tomorrow":"0","dayafter_to":"0","today":"0"}},"partregion_name":"Rhein, Pfalz, Nahe und Mosel","region_name":"Rheinland-Pfalz und Saarland","partregion_id":101,"region_id":100},{"partregion_id":102,"region_id":100,"Pollen":{"Erle":{"dayafter_to":"0","tomorrow":"0","today":"0"},"Beifuss":{"tomorrow":"0","dayafter_to":"0","today":"0"},"Roggen":{"dayafter_to":"0","tomorrow":"0","today":"0"},"Hasel":{"dayafter_to":"0","today":"0","tomorrow":"0"},"Esche":{"tomorrow":"0","dayafter_to":"0","today":"0"},"Birke":{"today":"0-1","dayafter_to":"0-1","tomorrow":"0-1"},"Graeser":{"today":"2","dayafter_to":"2-3","tomorrow":"2-3"},"Ambrosia":{"dayafter_to":"0","tomorrow":"0","today":"0"}},"partregion_name":"Mittelgebirgsbereich Rheinland-Pfalz","region_name":"Rheinland-Pfalz und Saarland"},{"partregion_id":111,"region_id":110,"region_name":"Baden-Württemberg","partregion_name":"Oberrhein und unteres Neckartal","Pollen":{"Hasel":{"dayafter_to":"0","today":"0","tomorrow":"0"},"Erle":{"today":"0","dayafter_to":"0","tomorrow":"0"},"Roggen":{"today":"1","dayafter_to":"1","tomorrow":"1"},"Beifuss":{"dayafter_to":"0","today":"0","tomorrow":"0"},"Birke":{"dayafter_to":"0-1","today":"0-1","tomorrow":"0-1"},"Graeser":{"today":"3","dayafter_to":"3","tomorrow":"3"},"Esche":{"today":"0","dayafter_to":"0","tomorrow":"0"},"Ambrosia":{"dayafter_to":"0","today":"0","tomorrow":"0"}}},{"region_id":110,"partregion_id":112,"Pollen":{"Erle":{"dayafter_to":"0","tomorrow":"0","today":"0"},"Roggen":{"tomorrow":"0-1","dayafter_to":"0-1","today":"0-1"},"Beifuss":{"dayafter_to":"0","tomorrow":"0","today":"0"},"Hasel":{"today":"0","dayafter_to":"0","tomorrow":"0"},"Esche":{"tomorrow":"0","dayafter_to":"0","today":"0"},"Birke":{"today":"0-1","dayafter_to":"0-1","tomorrow":"0-1"},"Graeser":{"dayafter_to":"2-3","today":"2-3","tomorrow":"2-3"},"Ambrosia":{"dayafter_to":"0","tomorrow":"0","today":"0"}},"partregion_name":"Hohenlohe/mittlerer Neckar/Oberschwaben","region_name":"Baden-Württemberg"},{"region_name":"Baden-Württemberg","Pollen":{"Beifuss":{"dayafter_to":"0","tomorrow":"0","today":"0"},"Roggen":{"dayafter_to":"0","tomorrow":"0","today":"0"},"Erle":{"tomorrow":"0","dayafter_to":"0","today":"0"},"Hasel":{"today":"0","dayafter_to":"0","tomorrow":"0"},"Esche":{"dayafter_to":"0","today":"0","tomorrow":"0"},"Birke":{"tomorrow":"0-1","dayafter_to":"0-1","today":"0-1"},"Graeser":{"dayafter_to":"2-3","tomorrow":"2","today":"2"},"Ambrosia":{"dayafter_to":"0","tomorrow":"0","today":"0"}},"partregion_name":"Mittelgebirge Baden-Württemberg","region_id":110,"partregion_id":113},{"partregion_id":121,"region_id":120,"region_name":"Bayern","Pollen":{"Erle":{"today":"0","dayafter_to":"0","tomorrow":"0"},"Roggen":{"today":"0-1","dayafter_to":"0-1","tomorrow":"0-1"},"Beifuss":{"dayafter_to":"0","tomorrow":"0","today":"0"},"Hasel":{"tomorrow":"0","dayafter_to":"0","today":"0"},"Esche":{"tomorrow":"0","dayafter_to":"0","today":"0"},"Birke":{"dayafter_to":"0-1","tomorrow":"0-1","today":"0-1"},"Graeser":{"dayafter_to":"3","tomorrow":"2-3","today":"2-3"},"Ambrosia":{"dayafter_to":"0","tomorrow":"0","today":"0"}},"partregion_name":"Allgäu/Oberbayern/Bay. Wald"},{"Pollen":{"Erle":{"today":"0","dayafter_to":"0","tomorrow":"0"},"Roggen":{"dayafter_to":"0-1","today":"0-1","tomorrow":"0-1"},"Beifuss":{"dayafter_to":"0","tomorrow":"0","today":"0"},"Hasel":{"dayafter_to":"0","tomorrow":"0","today":"0"},"Esche":{"dayafter_to":"0","today":"0","tomorrow":"0"},"Graeser":{"dayafter_to":"3","tomorrow":"2-3","today":"2-3"},"Birke":{"today":"0-1","dayafter_to":"0-1","tomorrow":"0-1"},"Ambrosia":{"tomorrow":"0","dayafter_to":"0","today":"0"}},"partregion_name":"Donauniederungen","region_name":"Bayern","region_id":120,"partregion_id":122},{"region_id":120,"partregion_id":123,"Pollen":{"Hasel":{"dayafter_to":"0","today":"0","tomorrow":"0"},"Roggen":{"today":"0-1","dayafter_to":"0-1","tomorrow":"0-1"},"Erle":{"dayafter_to":"0","today":"0","tomorrow":"0"},"Beifuss":{"dayafter_to":"0","today":"0","tomorrow":"0"},"Birke":{"dayafter_to":"0-1","tomorrow":"0-1","today":"0-1"},"Graeser":{"dayafter_to":"3","today":"2-3","tomorrow":"2-3"},"Esche":{"tomorrow":"0","dayafter_to":"0","today":"0"},"Ambrosia":{"dayafter_to":"0","tomorrow":"0","today":"0"}},"partregion_name":"Bayern n. der Donau, o. Bayr. Wald, o. Mainfranken","region_name":"Bayern"},{"region_id":120,"partregion_id":124,"region_name":"Bayern","partregion_name":"Mainfranken","Pollen":{"Erle":{"dayafter_to":"0","tomorrow":"0","today":"0"},"Roggen":{"dayafter_to":"0-1","tomorrow":"0-1","today":"0-1"},"Beifuss":{"tomorrow":"0","dayafter_to":"0","today":"0"},"Hasel":{"tomorrow":"0","dayafter_to":"0","today":"0"},"Ambrosia":{"tomorrow":"0","dayafter_to":"0","today":"0"},"Esche":{"dayafter_to":"0","today":"0","tomorrow":"0"},"Graeser":{"today":"2-3","dayafter_to":"3","tomorrow":"2-3"},"Birke":{"dayafter_to":"0-1","tomorrow":"0-1","today":"0-1"}}}],"next_update":"2018-05-19 11:00 Uhr","sender":"Deutscher Wetterdienst - Medizin-Meteorologie"}'

(Stefan) #10

here is my final CONFIG:

Pollen.items

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

http:cacheDWD_Pollen.url=https://opendata.dwd.de/climate_environment/health/alerts/s31fg.json
http:cacheDWD_Pollen.updateInterval=3600000

Pollen.map

-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)

sitemap

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


[suggestion] Anyone willing to build a dwd_pollen binding?
(Vincent Regaud) #11

To do that you need another item and a rule:

DateTime PollenLastUpdateDateTime
rule "Pollen datetime"
when
    DWD_Pollen_last_update changed
then
    PollenLastUpdateDateTime.postUpdate(DWD_Pollen_last_update.toString.subString(0, 16))
end

(Markus S.) #12

Hi.
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?
Thanks,
Markus


(Stefan) #13

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:

example

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

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

hope this helps you


(Markus S.) #14

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


(Stefan) #15

I don´t think so.

I use weather underground for weather informations.


(Markus S.) #16

Okay.
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?
Greetings,
Markus


(Stefan) #17

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.

image

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

http://wiki.wunderground.com/index.php/FAQ_-_Sources

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

https://www.wunderground.com/weather/api/

image

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


(Udo Hartmann) #18

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


(Cernon) #19

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:
https://opendata.dwd.de/climate_environment/health/alerts/Beschreibung_uvi.pdf

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

In the http.cfg I write

http:cacheDWD_UVI.url=https://opendata.dwd.de/climate_environment/health/alerts/uvi.json
http:cacheDWD_UVI.updateInterval=3600000

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”


(Udo Hartmann) #20

I guess it would be something like

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