Offenbar habe ich mich schon mit einem einfach scheinenden Versuch über einen Karfreitag verhoben und hoffe auf barmherzige Hilfe:
Ich rufe vom DWD-OpenData-Server mit dem Modul diese Daten ab
{"name":"Pollenflug-Gefahrenindex für Deutschland ausgegeben vom Deutschen Wetterdienst","last_update":"2025-04-18 11:00 Uhr","sender":"Deutscher Wetterdienst - Medizin-Meteorologie","legend":{"id6":"2-3","id7_desc":"hohe Belastung","id1_desc":"keine Belastung","id4":"1-2","id5":"2","id5_desc":"mittlere Belastung","id1":"0","id6_desc":"mittlere bis hohe Belastung","id7":"3","id2":"0-1","id3_desc":"geringe Belastung","id2_desc":"keine bis geringe Belastung","id3":"1","id4_desc":"geringe bis mittlere Belastung"},"next_update":"2025-04-19 11:00 Uhr","content":[{"region_name":"Schleswig-Holstein und Hamburg","partregion_name":"Inseln und Marschen","partregion_id":11,"Pollen":{"Roggen":{"tomorrow":"0","today":"0","dayafter_to":"0"},"Erle":{"today":"0","dayafter_to":"0","tomorrow":"0"},"Graeser":{"today":"0","dayafter_to":"0","tomorrow":"0"},"Beifuss":{"dayafter_to":"0","today":"0","tomorrow":"0"},"Birke":{"dayafter_to":"1","today":"0-1","tomorrow":"1"},"Hasel":{"dayafter_to":"0","today":"0","tomorrow":"0"},"Ambrosia":{"today":"0","dayafter_to":"0","tomorrow":"0"},"Esche":{"today":"0-1","dayafter_to":"1","tomorrow":"1"}},"region_id":10},{"region_id":10,"Pollen":{"Graeser":{"tomorrow":"1","today":"0","dayafter_to":"1"},"Roggen":{"today":"0","dayafter_to":"0","tomorrow":"0"},"Erle":{"tomorrow":"0","dayafter_to":"0","today":"0"},"Birke":{"tomorrow":"2","dayafter_to":"2","today":"1"},"Beifuss":{"tomorrow":"0","dayafter_to":"0","today":"0"},"Hasel":{"tomorrow":"0","today":"0","dayafter_to":"0"},"Esche":{"today":"1","dayafter_to":"2","tomorrow":"2"},"Ambrosia":{"tomorrow":"0","dayafter_to":"0","today":"0"}},"partregion_id":12,"partregion_name":"Geest,Schleswig-Holstein und Hamburg","region_name":"Schleswig-Holstein und Hamburg"},{"region_name":"Mecklenburg-Vorpommern","partregion_name":"","partregion_id":-1,"Pollen":{"Hasel":{"tomorrow":"0","today":"0","dayafter_to":"0"},"Esche":{"today":"2","dayafter_to":"2","tomorrow":"2"},"Ambrosia":{"tomorrow":"0","dayafter_to":"0","today":"0"},"Graeser":{"tomorrow":"1","today":"0-1","dayafter_to":"1"},"Erle":{"tomorrow":"0","dayafter_to":"0","today":"0"},"Roggen":{"today":"0","dayafter_to":"0","tomorrow":"0"},"Birke":{"today":"2","dayafter_to":"2","tomorrow":"2"},"Beifuss":{"tomorrow":"0","dayafter_to":"0","today":"0"}},"region_id":20},{"region_name":"Niedersachsen und Bremen","partregion_name":"Westl. Niedersachsen/Bremen","partregion_id":31,"Pollen":{"Hasel":{"tomorrow":"0","today":"0","dayafter_to":"0"},"Esche":{"tomorrow":"2","dayafter_to":"2","today":"0-1"},"Ambrosia":{"today":"0","dayafter_to":"0","tomorrow":"0"},"Graeser":{"tomorrow":"1","dayafter_to":"1","today":"0"},"Roggen":{"today":"0","dayafter_to":"0","tomorrow":"0"},"Erle":{"tomorrow":"0","dayafter_to":"0","today":"0"},"Birke":{"dayafter_to":"2","today":"0-1","tomorrow":"2"},"Beifuss":{"tomorrow":"0","today":"0","dayafter_to":"0"}},"region_id":30},{"region_id":30,"Pollen":{"Ambrosia":{"today":"0","dayafter_to":"0","tomorrow":"0"},"Esche":{"today":"0-1","dayafter_to":"2","tomorrow":"2"},"Hasel":{"tomorrow":"0","today":"0","dayafter_to":"0"},"Beifuss":{"tomorrow":"0","today":"0","dayafter_to":"0"},"Birke":{"today":"0-1","dayafter_to":"2","tomorrow":"2"},"Graeser":{"today":"0","dayafter_to":"1","tomorrow":"1"},"Erle":{"today":"0","dayafter_to":"0","tomorrow":"0"},"Roggen":{"tomorrow":"0","today":"0","dayafter_to":"0"}},"region_name":"Niedersachsen und Bremen","partregion_id":32,"partregion_name":"Östl. Niedersachsen"},{"partregion_id":41,"partregion_name":"Rhein.-Westfäl. Tiefland","region_name":"Nordrhein-Westfalen","region_id":40,"Pollen":{"Hasel":{"tomorrow":"0","dayafter_to":"0","today":"0"},"Esche":{"dayafter_to":"2","today":"0-1","tomorrow":"2"},"Ambrosia":{"today":"0","dayafter_to":"0","tomorrow":"0"},"Roggen":{"tomorrow":"0","today":"0","dayafter_to":"0"},"Erle":{"tomorrow":"0","today":"0","dayafter_to":"0"},"Graeser":{"today":"0","dayafter_to":"1","tomorrow":"1"},"Birke":{"tomorrow":"2-3","today":"0-1","dayafter_to":"2-3"},"Beifuss":{"tomorrow":"0","dayafter_to":"0","today":"0"}}},{"Pollen":{"Birke":{"tomorrow":"2","today":"0-1","dayafter_to":"2"},"Beifuss":{"today":"0","dayafter_to":"0","tomorrow":"0"},"Graeser":{"today":"0","dayafter_to":"1","tomorrow":"1"},"Roggen":{"tomorrow":"0","today":"0","dayafter_to":"0"},"Erle":{"dayafter_to":"0","today":"0","tomorrow":"0"},"Esche":{"tomorrow":"2","dayafter_to":"2","today":"0-1"},"Ambrosia":{"tomorrow":"0","today":"0","dayafter_to":"0"},"Hasel":{"today":"0","dayafter_to":"0","tomorrow":"0"}},"region_id":40,"region_name":"Nordrhein-Westfalen","partregion_name":"Ostwestfalen","partregion_id":42},{"region_name":"Nordrhein-Westfalen","partregion_id":43,"partregion_name":"Mittelgebirge NRW","region_id":40,"Pollen":{"Beifuss":{"dayafter_to":"0","today":"0","tomorrow":"0"},"Birke":{"tomorrow":"2-3","dayafter_to":"2-3","today":"0-1"},"Graeser":{"dayafter_to":"0","today":"0","tomorrow":"0"},"Erle":{"today":"0","dayafter_to":"0","tomorrow":"0"},"Roggen":{"tomorrow":"0","dayafter_to":"0","today":"0"},"Ambrosia":{"dayafter_to":"0","today":"0","tomorrow":"0"},"Esche":{"tomorrow":"2","dayafter_to":"2","today":"0-1"},"Hasel":{"today":"0","dayafter_to":"0","tomorrow":"0"}}},{"Pollen":{"Beifuss":{"tomorrow":"0","today":"0","dayafter_to":"0"},"Birke":{"dayafter_to":"2","today":"2","tomorrow":"2"},"Roggen":{"tomorrow":"0","today":"0","dayafter_to":"0"},"Erle":{"tomorrow":"0","today":"0","dayafter_to":"0"},"Graeser":{"tomorrow":"1","dayafter_to":"1","today":"0-1"},"Ambrosia":{"dayafter_to":"0","today":"0","tomorrow":"0"},"Esche":{"today":"2","dayafter_to":"2","tomorrow":"2"},"Hasel":{"today":"0","dayafter_to":"0","tomorrow":"0"}},"region_id":50,"region_name":"Brandenburg und Berlin","partregion_name":"","partregion_id":-1},{"Pollen":{"Birke":{"today":"1-2","dayafter_to":"2","tomorrow":"2"},"Beifuss":{"tomorrow":"0","dayafter_to":"0","today":"0"},"Roggen":{"tomorrow":"0","dayafter_to":"0","today":"0"},"Erle":{"tomorrow":"0","dayafter_to":"0","today":"0"},"Graeser":{"tomorrow":"1","dayafter_to":"1","today":"0-1"},"Esche":{"today":"1-2","dayafter_to":"2","tomorrow":"2"},"Ambrosia":{"today":"0","dayafter_to":"0","tomorrow":"0"},"Hasel":{"dayafter_to":"0","today":"0","tomorrow":"0"}},"region_id":60,"region_name":"Sachsen-Anhalt","partregion_name":"Tiefland Sachsen-Anhalt","partregion_id":61},{"partregion_name":"Harz","partregion_id":62,"region_name":"Sachsen-Anhalt","Pollen":{"Graeser":{"today":"0","dayafter_to":"0","tomorrow":"0"},"Roggen":{"today":"0","dayafter_to":"0","tomorrow":"0"},"Erle":{"today":"0","dayafter_to":"0","tomorrow":"0"},"Beifuss":{"tomorrow":"0","today":"0","dayafter_to":"0"},"Birke":{"tomorrow":"2","dayafter_to":"2","today":"1"},"Hasel":{"dayafter_to":"0","today":"0","tomorrow":"0"},"Ambrosia":{"tomorrow":"0","today":"0","dayafter_to":"0"},"Esche":{"tomorrow":"2","today":"1","dayafter_to":"2"}},"region_id":60},{"region_name":"Thüringen","partregion_name":"Tiefland Thüringen","partregion_id":71,"Pollen":{"Ambrosia":{"tomorrow":"0","dayafter_to":"0","today":"0"},"Esche":{"today":"1","dayafter_to":"2","tomorrow":"2"},"Hasel":{"dayafter_to":"0","today":"0","tomorrow":"0"},"Beifuss":{"tomorrow":"0","today":"0","dayafter_to":"0"},"Birke":{"tomorrow":"2","today":"1","dayafter_to":"2"},"Graeser":{"tomorrow":"1","today":"0-1","dayafter_to":"1"},"Roggen":{"tomorrow":"0","today":"0","dayafter_to":"0"},"Erle":{"tomorrow":"0","dayafter_to":"0","today":"0"}},"region_id":70},{"Pollen":{"Erle":{"today":"0","dayafter_to":"0","tomorrow":"0"},"Roggen":{"tomorrow":"0","dayafter_to":"0","today":"0"},"Graeser":{"tomorrow":"0","dayafter_to":"0","today":"0"},"Beifuss":{"tomorrow":"0","dayafter_to":"0","today":"0"},"Birke":{"dayafter_to":"2-3","today":"1","tomorrow":"2-3"},"Hasel":{"tomorrow":"0","dayafter_to":"0","today":"0"},"Ambrosia":{"tomorrow":"0","today":"0","dayafter_to":"0"},"Esche":{"dayafter_to":"2-3","today":"1","tomorrow":"2-3"}},"region_id":70,"region_name":"Thüringen","partregion_name":"Mittelgebirge Thüringen","partregion_id":72},{"region_name":"Sachsen","partregion_id":81,"partregion_name":"Tiefland Sachsen","region_id":80,"Pollen":{"Roggen":{"dayafter_to":"0","today":"0","tomorrow":"0"},"Erle":{"tomorrow":"0","dayafter_to":"0","today":"0"},"Graeser":{"dayafter_to":"1","today":"0-1","tomorrow":"1"},"Beifuss":{"tomorrow":"0","today":"0","dayafter_to":"0"},"Birke":{"dayafter_to":"2","today":"1-2","tomorrow":"2"},"Hasel":{"tomorrow":"0","today":"0","dayafter_to":"0"},"Ambrosia":{"tomorrow":"0","dayafter_to":"0","today":"0"},"Esche":{"dayafter_to":"2","today":"1-2","tomorrow":"2"}}},{"region_id":80,"Pollen":{"Birke":{"dayafter_to":"2-3","today":"1-2","tomorrow":"2-3"},"Beifuss":{"tomorrow":"0","dayafter_to":"0","today":"0"},"Roggen":{"tomorrow":"0","today":"0","dayafter_to":"0"},"Erle":{"dayafter_to":"0","today":"0","tomorrow":"0"},"Graeser":{"tomorrow":"0","today":"0","dayafter_to":"0"},"Esche":{"today":"1-2","dayafter_to":"2-3","tomorrow":"2-3"},"Ambrosia":{"today":"0","dayafter_to":"0","tomorrow":"0"},"Hasel":{"tomorrow":"0","today":"0","dayafter_to":"0"}},"partregion_id":82,"partregion_name":"Mittelgebirge Sachsen","region_name":"Sachsen"},{"region_name":"Hessen","partregion_id":91,"partregion_name":"Nordhessen und hess. Mittelgebirge","region_id":90,"Pollen":{"Hasel":{"tomorrow":"0","today":"0","dayafter_to":"0"},"Esche":{"dayafter_to":"2","today":"0-1","tomorrow":"2"},"Ambrosia":{"today":"0","dayafter_to":"0","tomorrow":"0"},"Graeser":{"dayafter_to":"1","today":"0-1","tomorrow":"1"},"Erle":{"tomorrow":"0","dayafter_to":"0","today":"0"},"Roggen":{"today":"0","dayafter_to":"0","tomorrow":"0"},"Birke":{"tomorrow":"2-3","dayafter_to":"2-3","today":"0-1"},"Beifuss":{"today":"0","dayafter_to":"0","tomorrow":"0"}}},{"partregion_name":"Rhein-Main","partregion_id":92,"region_name":"Hessen","Pollen":{"Graeser":{"tomorrow":"1","dayafter_to":"1","today":"0-1"},"Roggen":{"tomorrow":"0","today":"0","dayafter_to":"0"},"Erle":{"today":"0","dayafter_to":"0","tomorrow":"0"},"Beifuss":{"today":"0","dayafter_to":"0","tomorrow":"0"},"Birke":{"tomorrow":"2","today":"0-1","dayafter_to":"2"},"Hasel":{"today":"0","dayafter_to":"0","tomorrow":"0"},"Ambrosia":{"dayafter_to":"0","today":"0","tomorrow":"0"},"Esche":{"tomorrow":"2","dayafter_to":"2","today":"0-1"}},"region_id":90},{"region_id":100,"Pollen":{"Graeser":{"tomorrow":"1","dayafter_to":"1","today":"0"},"Roggen":{"today":"0","dayafter_to":"0","tomorrow":"0"},"Erle":{"today":"0","dayafter_to":"0","tomorrow":"0"},"Beifuss":{"today":"0","dayafter_to":"0","tomorrow":"0"},"Birke":{"dayafter_to":"2-3","today":"0-1","tomorrow":"2-3"},"Hasel":{"today":"0","dayafter_to":"0","tomorrow":"0"},"Ambrosia":{"dayafter_to":"0","today":"0","tomorrow":"0"},"Esche":{"tomorrow":"2","dayafter_to":"2","today":"0-1"}},"partregion_id":101,"partregion_name":"Rhein, Pfalz, Nahe und Mosel","region_name":"Rheinland-Pfalz und Saarland"},{"region_id":100,"Pollen":{"Hasel":{"dayafter_to":"0","today":"0","tomorrow":"0"},"Esche":{"tomorrow":"2","today":"0-1","dayafter_to":"2"},"Ambrosia":{"dayafter_to":"0","today":"0","tomorrow":"0"},"Graeser":{"dayafter_to":"0","today":"0","tomorrow":"0"},"Roggen":{"dayafter_to":"0","today":"0","tomorrow":"0"},"Erle":{"dayafter_to":"0","today":"0","tomorrow":"0"},"Birke":{"tomorrow":"2-3","dayafter_to":"2-3","today":"0-1"},"Beifuss":{"dayafter_to":"0","today":"0","tomorrow":"0"}},"partregion_id":102,"partregion_name":"Mittelgebirgsbereich Rheinland-Pfalz","region_name":"Rheinland-Pfalz und Saarland"},{"partregion_id":103,"partregion_name":"Saarland","region_name":"Rheinland-Pfalz und Saarland","region_id":100,"Pollen":{"Hasel":{"today":"0","dayafter_to":"0","tomorrow":"0"},"Ambrosia":{"today":"0","dayafter_to":"0","tomorrow":"0"},"Esche":{"today":"0-1","dayafter_to":"2","tomorrow":"2"},"Roggen":{"today":"0","dayafter_to":"0","tomorrow":"0"},"Erle":{"tomorrow":"0","today":"0","dayafter_to":"0"},"Graeser":{"dayafter_to":"1","today":"0","tomorrow":"1"},"Beifuss":{"today":"0","dayafter_to":"0","tomorrow":"0"},"Birke":{"today":"0-1","dayafter_to":"2-3","tomorrow":"2-3"}}},{"partregion_name":"Oberrhein und unteres Neckartal","partregion_id":111,"region_name":"Baden-Württemberg","Pollen":{"Beifuss":{"tomorrow":"0","today":"0","dayafter_to":"0"},"Birke":{"tomorrow":"2","today":"0-1","dayafter_to":"2"},"Roggen":{"today":"0","dayafter_to":"0","tomorrow":"0"},"Erle":{"tomorrow":"0","today":"0","dayafter_to":"0"},"Graeser":{"tomorrow":"1","today":"0","dayafter_to":"1"},"Ambrosia":{"tomorrow":"0","today":"0","dayafter_to":"0"},"Esche":{"today":"0-1","dayafter_to":"2","tomorrow":"2"},"Hasel":{"today":"0","dayafter_to":"0","tomorrow":"0"}},"region_id":110},{"partregion_id":112,"partregion_name":"Hohenlohe/mittlerer Neckar/Oberschwaben","region_name":"Baden-Württemberg","region_id":110,"Pollen":{"Beifuss":{"today":"0","dayafter_to":"0","tomorrow":"0"},"Birke":{"tomorrow":"2-3","dayafter_to":"2-3","today":"0-1"},"Erle":{"dayafter_to":"0","today":"0","tomorrow":"0"},"Roggen":{"today":"0","dayafter_to":"0","tomorrow":"0"},"Graeser":{"dayafter_to":"1","today":"0-1","tomorrow":"1"},"Ambrosia":{"today":"0","dayafter_to":"0","tomorrow":"0"},"Esche":{"today":"0-1","dayafter_to":"2-3","tomorrow":"2-3"},"Hasel":{"dayafter_to":"0","today":"0","tomorrow":"0"}}},{"Pollen":{"Ambrosia":{"dayafter_to":"0","today":"0","tomorrow":"0"},"Esche":{"dayafter_to":"2-3","today":"0-1","tomorrow":"2-3"},"Hasel":{"today":"0","dayafter_to":"0","tomorrow":"0"},"Beifuss":{"tomorrow":"0","today":"0","dayafter_to":"0"},"Birke":{"dayafter_to":"2-3","today":"0-1","tomorrow":"2-3"},"Graeser":{"tomorrow":"0","today":"0","dayafter_to":"0"},"Roggen":{"today":"0","dayafter_to":"0","tomorrow":"0"},"Erle":{"today":"0","dayafter_to":"0","tomorrow":"0"}},"region_id":110,"region_name":"Baden-Württemberg","partregion_name":"Mittelgebirge Baden-Württemberg","partregion_id":113},{"partregion_name":"Allgäu/Oberbayern/Bay. Wald","partregion_id":121,"region_name":"Bayern","Pollen":{"Graeser":{"tomorrow":"1","dayafter_to":"1","today":"0-1"},"Roggen":{"tomorrow":"0","dayafter_to":"0","today":"0"},"Erle":{"tomorrow":"0","today":"0","dayafter_to":"0"},"Birke":{"tomorrow":"2-3","dayafter_to":"2-3","today":"1-2"},"Beifuss":{"tomorrow":"0","today":"0","dayafter_to":"0"},"Hasel":{"dayafter_to":"0","today":"0","tomorrow":"0"},"Esche":{"tomorrow":"2-3","today":"1-2","dayafter_to":"2-3"},"Ambrosia":{"today":"0","dayafter_to":"0","tomorrow":"0"}},"region_id":120},{"region_id":120,"Pollen":{"Roggen":{"tomorrow":"0","dayafter_to":"0","today":"0"},"Erle":{"tomorrow":"0","today":"0","dayafter_to":"0"},"Graeser":{"dayafter_to":"1","today":"0-1","tomorrow":"1"},"Birke":{"today":"1-2","dayafter_to":"2-3","tomorrow":"2-3"},"Beifuss":{"today":"0","dayafter_to":"0","tomorrow":"0"},"Hasel":{"tomorrow":"0","dayafter_to":"0","today":"0"},"Esche":{"dayafter_to":"2-3","today":"1-2","tomorrow":"2-3"},"Ambrosia":{"dayafter_to":"0","today":"0","tomorrow":"0"}},"partregion_id":122,"partregion_name":"Donauniederungen","region_name":"Bayern"},{"Pollen":{"Hasel":{"today":"0","dayafter_to":"0","tomorrow":"0"},"Esche":{"tomorrow":"2-3","dayafter_to":"2-3","today":"1"},"Ambrosia":{"tomorrow":"0","today":"0","dayafter_to":"0"},"Graeser":{"tomorrow":"1","today":"0-1","dayafter_to":"1"},"Roggen":{"tomorrow":"0","today":"0","dayafter_to":"0"},"Erle":{"dayafter_to":"0","today":"0","tomorrow":"0"},"Birke":{"dayafter_to":"2-3","today":"1","tomorrow":"2-3"},"Beifuss":{"tomorrow":"0","dayafter_to":"0","today":"0"}},"region_id":120,"region_name":"Bayern","partregion_name":"Bayern nördl. der Donau, o. Bayr. Wald, o. Mainfranken","partregion_id":123},{"Pollen":{"Hasel":{"tomorrow":"0","today":"0","dayafter_to":"0"},"Ambrosia":{"today":"0","dayafter_to":"0","tomorrow":"0"},"Esche":{"tomorrow":"2","today":"1","dayafter_to":"2"},"Erle":{"tomorrow":"0","dayafter_to":"0","today":"0"},"Roggen":{"tomorrow":"0","dayafter_to":"0","today":"0"},"Graeser":{"tomorrow":"1","dayafter_to":"1","today":"0-1"},"Beifuss":{"tomorrow":"0","dayafter_to":"0","today":"0"},"Birke":{"tomorrow":"2","today":"1","dayafter_to":"2"}},"region_id":120,"region_name":"Bayern","partregion_name":"Mainfranken","partregion_id":124}]}
mit einem
attr Readinglist complete()
erhalte ich Readings zu den Vorhersagewerte alle 8 Pflanzen aus allen Regionen. Mich interessiert aber nur die partregion_ID 31. Von einer im Emulator funktionierenden Filterung
$.content[?(@.partregion_id==31)]
bzw. dem Abruf eines einzigen Datenpunktes im FHEM z.B. über das
attr readinglist single(jsonPath('content.3.Pollen.Birke.tomorrow'),'Birke_morgen','N.a.');
gelingt mir einfach nicht der Transfer in eine Readinglist, die mir nur die Werte aus einer Region als Readings ausgibt.
Ist da draußen jemand, der mir Anschubhilfe geben kann?
Versuchs mal mit
multi(jsonPath("\$.content[?(\@.partregion_id in ['31'])]"), concat(property("..partregion_id"), "_name"), property("..partregion_name"));
multi(jsonPath("\$.content[?(\@.partregion_id in ['31'])]"), concat(property("..partregion_id"), "_Ambrosia_today"), property("..Pollen.Ambrosia.today"));
multi(jsonPath("\$.content[?(\@.partregion_id in ['31'])]"), concat(property("..partregion_id"), "_Ambrosia_tomorrow"), property("..Pollen.Ambrosia.tomorrow"));
multi(jsonPath("\$.content[?(\@.partregion_id in ['31'])]"), concat(property("..partregion_id"), "_Ambrosia_dayfter_to"), property("..Pollen.Ambrosia.dayafter_to"));
als readingList
Kannst Du mal bitte die URL posten, die Du verwendest?
Zitat von: yersinia am 19 April 2025, 09:50:02Versuchs mal mit
multi(jsonPath("\$.content[?(\@.partregion_id in ['31'])]"), concat(property("..partregion_id"), "_name"), property("..partregion_name"));
multi(jsonPath("\$.content[?(\@.partregion_id in ['31'])]"), concat(property("..partregion_id"), "_Ambrosia_today"), property("..Pollen.Ambrosia.today"));
multi(jsonPath("\$.content[?(\@.partregion_id in ['31'])]"), concat(property("..partregion_id"), "_Ambrosia_tomorrow"), property("..Pollen.Ambrosia.tomorrow"));
multi(jsonPath("\$.content[?(\@.partregion_id in ['31'])]"), concat(property("..partregion_id"), "_Ambrosia_dayafter_to"), property("..Pollen.Ambrosia.dayafter_to"));
als readingList
vielen Dank! Das funktioniert, ich müsste das dann praktisch für die 7 anderen Pollenarten ebenso jeweils zusammenfügen, oder gibt es da eine Möglichkeit, das zu generalisieren?
Zitat von: betateilchen am 19 April 2025, 10:15:43Kannst Du mal bitte die URL posten, die Du verwendest?
Gerne!
defmod DWD_Pollen JsonMod https://opendata.dwd.de/climate_environment/health/alerts/s31fg.json
attr DWD_Pollen interval 15 11 * * *
Nach Doku wird das täglich um 11 Uhr aktualisiert, deshalb das cron-Timing.
Wenn die partregion_id ohnehin mit 31 eingegrenzt ist, macht es doch auch wenig Sinn, diese mit property("..partregion_id") nochmal zu ermitteln? Was soll denn da anderes rauskommen als "31"?
Zitat von: cwagner am 18 April 2025, 23:50:15bzw. dem Abruf eines einzigen Datenpunktes im FHEM z.B. über das
attr readinglist single(jsonPath('content.3.Pollen.Birke.tomorrow'),'Birke_morgen','N.a.');
Die jsonPath Angabe ist falsch, es müsste so aussehen:
single(jsonPath('$.content.3.Pollen.Birke.tomorrow'),'Birke_morgen','N.a.');
Zitat von: betateilchen am 19 April 2025, 10:28:41Wenn die partregion_id ohnehin mit 31 eingegrenzt ist, macht es doch auch wenig Sinn, diese mit property("..partregion_id") nochmal zu ermitteln? Was soll denn da anderes rauskommen als "31"?
Es wird dem Namen des Readings vorangestellt (31_Ambrosia_today). Macht sicherlich Sinn, wenn man auf mehrere Regionen filtert. Bei einer einzigen führt Dein Einwand zu:
multi(jsonPath("\$.content[?(\@.partregion_id in ['31'])]"), concat("Ambrosia_heute"), property("..Pollen.Ambrosia.today"));
multi(jsonPath("\$.content[?(\@.partregion_id in ['31'])]"), concat("Ambrosia_morgen"), property("..Pollen.Ambrosia.tomorrow"));
multi(jsonPath("\$.content[?(\@.partregion_id in ['31'])]"), concat("Ambrosia_uebermorgen"), property("..Pollen.Ambrosia.dayafter_to"));
...
Sehe aktuell noch keinen Vorteil bei Verwendung von multi im Vergleich zu single:
single(jsonPath('$.content.3.Pollen.Birke.tomorrow'),'Birke_morgen','N.a.'); single(jsonPath('$.content.3.Pollen.Birke.today'),'Birke_heute','N.a.');
...
Im konkreten Anwendungsfall funktioniert der jsonPath auch ohne die Wurzel $. (jedenfalls bei mir)
Ich suche noch nach einer Idee, nicht jede Pflanze jeweils dreimal für die drei Tage in der readingslist aufführen zu müssen. Mit Copy an sich kein Problem, die 24 Zeilen sehen aber für mein Auge nicht elegant aus.
Zitat von: cwagner am 19 April 2025, 12:57:00Bei einer einzigen führt Dein Einwand zu:
multi(jsonPath("\$.content[?(\@.partregion_id in ['31'])]"), concat("Ambrosia_heute"), property("..Pollen.Ambrosia.today"));
Herr, schmeiß Hirn!
Du brauchst doch in dem Fall überhaupt kein concat() ausführen, um einen readingName zu erzeugen (insbesondere, wenn Du gar nicht mehr als einen Teil hast!), Du kannst den Namen doch direkt angeben, und wenn Du möchtest, sogar mit 31 am Anfang...
multi(jsonPath("\$.content[?(\@.partregion_id in ['31'])]"),"31_Ambrosia_heute", property("..Pollen.Ambrosia.today"));