home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
73.31k stars 30.62k forks source link

NINA integration displays a DWD warning multiple times and does not filter results for configured municipality #83992

Closed mondbaron closed 1 year ago

mondbaron commented 1 year ago

The problem

Problem Description

In larger counties with multiple municipalities the integration displays the same DWD weather warning multiple times and other warnings may get lost due to a limited number of available slots.

Background / Problem Analysis

This issue mainly exists to large extend due to the internal structure of the German Warning System and missing documentation of the used API, but it should be finally resolvable within the Home Assistant integration with the provided information.

The NINA API used by this integration requires a user to query warnings by a region identifier, called Amtlicher Gebietsschlüssel (AGS) which needs to be provided on a county level, instead of a municipality level. For example if one wants to retreive warnings for the City of "Garching b.München" (AGS 091840119119) the user needs to request all warnings for the county (AGS 091840000000) calling the endpoint api31/dashboard/091840000000.json.

The result (example provided below) is a response containing the same DWD weather warning multiple times, because each warning is issued to specific areas specified in a data field under $.[i].payload.data.area, e.g. municipalities which could not directly be used in the request. In the Home Assistant integrations all these warnings are now blocking the available warning slots without providing new information or actually being relevant for the configured region "Garching b.München". The warning area is provided as a ZGEM code. I could not yet find a list of available codes, but for the given example I figured out, that "Stadt Garching b. München" is represented by the area code 8209, listed in one warning of the results. All other warnings are irrelevant.

Suggestion / Discussion

Maybe we could have an additional option to filter specific areas by a list of configured ZGEM ids? This filter should be applied before filling the warning slots.

What version of Home Assistant Core has the issue?

2022.12.5

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

NINA

Link to integration documentation on our website

https://www.home-assistant.io/integrations/nina

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

Example API Results

api31/dashboard/091840000000.json ``` [ { "id": "dwd.2.49.0.0.276.0.DWD.PVW.1671023640000.38685509-27df-4f14-b930-f5d4032f37a3.MUL", "payload": { "version": 3, "type": "ALERT", "id": "dwd.2.49.0.0.276.0.DWD.PVW.1671023640000.38685509-27df-4f14-b930-f5d4032f37a3.MUL", "hash": "02404aabec7f656b66fa3b5c83c194b101f1ba37fc1595df6fac66d45668e0dc", "data": { "headline": "Amtliche UNWETTERWARNUNG vor GLATTEIS", "provider": "DWD", "severity": "Severe", "msgType": "Update", "area": { "type": "ZGEM", "data": "7729,7763,7768+1,7778+1,8212" }, "valid": true } }, "i18nTitle": { "de": "Amtliche UNWETTERWARNUNG vor GLATTEIS", "en": "Official SEVERE WEATHER WARNING for BLACK ICE", "ar": "تحذير رسمي من جليد مزلّج", "es": "AVISO oficial de MAL TIEMPO por SUPERFICIES HELADAS", "fr": "ALERTE officielle FORTES INTEMPÉRIES pour VERGLAS", "pl": "Oficjalne OSTRZEŻENIE METEOROLOGICZNE (3. STOPNIA) przed GOŁOLEDZIĄ", "ru": "Официальное штормовое предупреждение: Гололед", "tr": "ŞEFFAF BUZ için resmi KÖTÜ HAVA UYARISI" }, "sent": "2022-12-14T14:14:57+01:00", "onset": "2022-12-14T14:14:00+01:00", "expires": "2022-12-14T16:00:00+01:00", "effective": "2022-12-14T14:14:00+01:00" }, { "id": "dwd.2.49.0.0.276.0.DWD.PVW.1671023640000.399cc31a-148c-4a99-9b8f-22947f5dbc6c.MUL", "payload": { "version": 3, "type": "ALERT", "id": "dwd.2.49.0.0.276.0.DWD.PVW.1671023640000.399cc31a-148c-4a99-9b8f-22947f5dbc6c.MUL", "hash": "da2a2133c98bee03e0274be0c1dec1182b4ab17620efcf5f6d016b1b448bca06", "data": { "headline": "Amtliche UNWETTERWARNUNG vor GLATTEIS", "provider": "DWD", "severity": "Severe", "msgType": "Update", "area": { "type": "ZGEM", "data": "7720,7759,7764" }, "valid": true } }, "i18nTitle": { "de": "Amtliche UNWETTERWARNUNG vor GLATTEIS", "en": "Official SEVERE WEATHER WARNING for BLACK ICE", "ar": "تحذير رسمي من جليد مزلّج", "es": "AVISO oficial de MAL TIEMPO por SUPERFICIES HELADAS", "fr": "ALERTE officielle FORTES INTEMPÉRIES pour VERGLAS", "pl": "Oficjalne OSTRZEŻENIE METEOROLOGICZNE (3. STOPNIA) przed GOŁOLEDZIĄ", "ru": "Официальное штормовое предупреждение: Гололед", "tr": "ŞEFFAF BUZ için resmi KÖTÜ HAVA UYARISI" }, "sent": "2022-12-14T14:15:02+01:00", "onset": "2022-12-14T14:14:00+01:00", "expires": "2022-12-14T16:00:00+01:00", "effective": "2022-12-14T14:14:00+01:00" }, { "id": "dwd.2.49.0.0.276.0.DWD.PVW.1671023640000.4a932d0c-07bb-4528-a7d0-0fad3a22407d.MUL", "payload": { "version": 3, "type": "ALERT", "id": "dwd.2.49.0.0.276.0.DWD.PVW.1671023640000.4a932d0c-07bb-4528-a7d0-0fad3a22407d.MUL", "hash": "8ea941975325e90f2375070529929d23cca550240c47326ac3fb0fb1b3652875", "data": { "headline": "Amtliche UNWETTERWARNUNG vor GLATTEIS", "provider": "DWD", "severity": "Severe", "msgType": "Update", "area": { "type": "ZGEM", "data": "7755,7760+1,7764,8204+1" }, "valid": true } }, "i18nTitle": { "de": "Amtliche UNWETTERWARNUNG vor GLATTEIS", "en": "Official SEVERE WEATHER WARNING for BLACK ICE", "ar": "تحذير رسمي من جليد مزلّج", "es": "AVISO oficial de MAL TIEMPO por SUPERFICIES HELADAS", "fr": "ALERTE officielle FORTES INTEMPÉRIES pour VERGLAS", "pl": "Oficjalne OSTRZEŻENIE METEOROLOGICZNE (3. STOPNIA) przed GOŁOLEDZIĄ", "ru": "Официальное штормовое предупреждение: Гололед", "tr": "ŞEFFAF BUZ için resmi KÖTÜ HAVA UYARISI" }, "sent": "2022-12-14T14:15:17+01:00", "onset": "2022-12-14T14:14:00+01:00", "expires": "2022-12-14T16:00:00+01:00", "effective": "2022-12-14T14:14:00+01:00" }, { "id": "dwd.2.49.0.0.276.0.DWD.PVW.1671023640000.af5bb47e-b86f-4c3e-894e-de7ba6151388.MUL", "payload": { "version": 3, "type": "ALERT", "id": "dwd.2.49.0.0.276.0.DWD.PVW.1671023640000.af5bb47e-b86f-4c3e-894e-de7ba6151388.MUL", "hash": "c9500ff26a547b00b0228486f4afde568439f57300cde3d52e290c32a5650217", "data": { "headline": "Amtliche UNWETTERWARNUNG vor GLATTEIS", "provider": "DWD", "severity": "Severe", "msgType": "Update", "area": { "type": "ZGEM", "data": "7645,7647+1,7650,7676,7678,7737,7746,7750,7752,7754,7764,8192,8194+1" }, "valid": true } }, "i18nTitle": { "de": "Amtliche UNWETTERWARNUNG vor GLATTEIS", "en": "Official SEVERE WEATHER WARNING for BLACK ICE", "ar": "تحذير رسمي من جليد مزلّج", "es": "AVISO oficial de MAL TIEMPO por SUPERFICIES HELADAS", "fr": "ALERTE officielle FORTES INTEMPÉRIES pour VERGLAS", "pl": "Oficjalne OSTRZEŻENIE METEOROLOGICZNE (3. STOPNIA) przed GOŁOLEDZIĄ", "ru": "Официальное штормовое предупреждение: Гололед", "tr": "ŞEFFAF BUZ için resmi KÖTÜ HAVA UYARISI" }, "sent": "2022-12-14T14:16:23+01:00", "onset": "2022-12-14T14:14:00+01:00", "expires": "2022-12-14T16:00:00+01:00", "effective": "2022-12-14T14:14:00+01:00" }, { "id": "dwd.2.49.0.0.276.0.DWD.PVW.1671023640000.b414708e-37ff-4c35-ad09-e369d1131ea9.MUL", "payload": { "version": 3, "type": "ALERT", "id": "dwd.2.49.0.0.276.0.DWD.PVW.1671023640000.b414708e-37ff-4c35-ad09-e369d1131ea9.MUL", "hash": "dfb985e339d26ff30e3bf50f96c85691a7140b4ceaab477035c65f290e1a9135", "data": { "headline": "Amtliche UNWETTERWARNUNG vor GLATTEIS", "provider": "DWD", "severity": "Severe", "msgType": "Update", "area": { "type": "ZGEM", "data": "7736,7739,7742,7744,8189,8197" }, "valid": true } }, "i18nTitle": { "de": "Amtliche UNWETTERWARNUNG vor GLATTEIS", "en": "Official SEVERE WEATHER WARNING for BLACK ICE", "ar": "تحذير رسمي من جليد مزلّج", "es": "AVISO oficial de MAL TIEMPO por SUPERFICIES HELADAS", "fr": "ALERTE officielle FORTES INTEMPÉRIES pour VERGLAS", "pl": "Oficjalne OSTRZEŻENIE METEOROLOGICZNE (3. STOPNIA) przed GOŁOLEDZIĄ", "ru": "Официальное штормовое предупреждение: Гололед", "tr": "ŞEFFAF BUZ için resmi KÖTÜ HAVA UYARISI" }, "sent": "2022-12-14T14:16:26+01:00", "onset": "2022-12-14T14:14:00+01:00", "expires": "2022-12-14T16:00:00+01:00", "effective": "2022-12-14T14:14:00+01:00" }, { "id": "dwd.2.49.0.0.276.0.DWD.PVW.1671023640000.ce5278b3-c3d1-4aca-973f-70bc0ec30d77.MUL", "payload": { "version": 3, "type": "ALERT", "id": "dwd.2.49.0.0.276.0.DWD.PVW.1671023640000.ce5278b3-c3d1-4aca-973f-70bc0ec30d77.MUL", "hash": "42f5d145902b7d3f4a00b013498381114b12bbb3b0cf0b6f5471dbc0dd4cbd78", "data": { "headline": "Amtliche UNWETTERWARNUNG vor GLATTEIS", "provider": "DWD", "severity": "Severe", "msgType": "Update", "area": { "type": "ZGEM", "data": "7649,7732+3,7740+1,7762,8134,8190,8196" }, "valid": true } }, "i18nTitle": { "de": "Amtliche UNWETTERWARNUNG vor GLATTEIS", "en": "Official SEVERE WEATHER WARNING for BLACK ICE", "ar": "تحذير رسمي من جليد مزلّج", "es": "AVISO oficial de MAL TIEMPO por SUPERFICIES HELADAS", "fr": "ALERTE officielle FORTES INTEMPÉRIES pour VERGLAS", "pl": "Oficjalne OSTRZEŻENIE METEOROLOGICZNE (3. STOPNIA) przed GOŁOLEDZIĄ", "ru": "Официальное штормовое предупреждение: Гололед", "tr": "ŞEFFAF BUZ için resmi KÖTÜ HAVA UYARISI" }, "sent": "2022-12-14T14:16:33+01:00", "onset": "2022-12-14T14:14:00+01:00", "expires": "2022-12-14T16:00:00+01:00", "effective": "2022-12-14T14:14:00+01:00" }, { "id": "dwd.2.49.0.0.276.0.DWD.PVW.1671023640000.d342008e-989f-4271-bc13-1dacf0397982.MUL", "payload": { "version": 3, "type": "ALERT", "id": "dwd.2.49.0.0.276.0.DWD.PVW.1671023640000.d342008e-989f-4271-bc13-1dacf0397982.MUL", "hash": "2a4aef8e4cf8c87bbf9b8b0e32d0740fa042869c43e7433b71c8b6564bf27869", "data": { "headline": "Amtliche UNWETTERWARNUNG vor GLATTEIS", "provider": "DWD", "severity": "Severe", "msgType": "Update", "area": { "type": "ZGEM", "data": "7719,7747+1,7758,7764,8203" }, "valid": true } }, "i18nTitle": { "de": "Amtliche UNWETTERWARNUNG vor GLATTEIS", "en": "Official SEVERE WEATHER WARNING for BLACK ICE", "ar": "تحذير رسمي من جليد مزلّج", "es": "AVISO oficial de MAL TIEMPO por SUPERFICIES HELADAS", "fr": "ALERTE officielle FORTES INTEMPÉRIES pour VERGLAS", "pl": "Oficjalne OSTRZEŻENIE METEOROLOGICZNE (3. STOPNIA) przed GOŁOLEDZIĄ", "ru": "Официальное штормовое предупреждение: Гололед", "tr": "ŞEFFAF BUZ için resmi KÖTÜ HAVA UYARISI" }, "sent": "2022-12-14T14:16:37+01:00", "onset": "2022-12-14T14:14:00+01:00", "expires": "2022-12-14T16:00:00+01:00", "effective": "2022-12-14T14:14:00+01:00" }, { "id": "dwd.2.49.0.0.276.0.DWD.PVW.1671023640000.eaea2c78-7e71-43d8-9575-ea64502d95d0.MUL", "payload": { "version": 3, "type": "ALERT", "id": "dwd.2.49.0.0.276.0.DWD.PVW.1671023640000.eaea2c78-7e71-43d8-9575-ea64502d95d0.MUL", "hash": "62923845d57a2b322bf18e1ecdeaf46a02f93e599775a05688c5fe45b71a8bdf", "data": { "headline": "Amtliche UNWETTERWARNUNG vor GLATTEIS", "provider": "DWD", "severity": "Severe", "msgType": "Update", "area": { "type": "ZGEM", "data": "7646,7738,8188" }, "valid": true } }, "i18nTitle": { "de": "Amtliche UNWETTERWARNUNG vor GLATTEIS", "en": "Official SEVERE WEATHER WARNING for BLACK ICE", "ar": "تحذير رسمي من جليد مزلّج", "es": "AVISO oficial de MAL TIEMPO por SUPERFICIES HELADAS", "fr": "ALERTE officielle FORTES INTEMPÉRIES pour VERGLAS", "pl": "Oficjalne OSTRZEŻENIE METEOROLOGICZNE (3. STOPNIA) przed GOŁOLEDZIĄ", "ru": "Официальное штормовое предупреждение: Гололед", "tr": "ŞEFFAF BUZ için resmi KÖTÜ HAVA UYARISI" }, "sent": "2022-12-14T14:16:52+01:00", "onset": "2022-12-14T14:14:00+01:00", "expires": "2022-12-14T16:00:00+01:00", "effective": "2022-12-14T14:14:00+01:00" }, { "id": "dwd.2.49.0.0.276.0.DWD.PVW.1671023640000.f455a7ae-2ac9-4c07-be8b-fde54c8c2cdd.MUL", "payload": { "version": 3, "type": "ALERT", "id": "dwd.2.49.0.0.276.0.DWD.PVW.1671023640000.f455a7ae-2ac9-4c07-be8b-fde54c8c2cdd.MUL", "hash": "126655164c2515b2b005310c0cba48526a75625f68ed8cf6b2b4daf5461d5ec3", "data": { "headline": "Amtliche UNWETTERWARNUNG vor GLATTEIS", "provider": "DWD", "severity": "Severe", "msgType": "Update", "area": { "type": "ZGEM", "data": "7751,7756+1,7764,7770,8207,8209,8236" }, "valid": true } }, "i18nTitle": { "de": "Amtliche UNWETTERWARNUNG vor GLATTEIS", "en": "Official SEVERE WEATHER WARNING for BLACK ICE", "ar": "تحذير رسمي من جليد مزلّج", "es": "AVISO oficial de MAL TIEMPO por SUPERFICIES HELADAS", "fr": "ALERTE officielle FORTES INTEMPÉRIES pour VERGLAS", "pl": "Oficjalne OSTRZEŻENIE METEOROLOGICZNE (3. STOPNIA) przed GOŁOLEDZIĄ", "ru": "Официальное штормовое предупреждение: Гололед", "tr": "ŞEFFAF BUZ için resmi KÖTÜ HAVA UYARISI" }, "sent": "2022-12-14T14:17:04+01:00", "onset": "2022-12-14T14:14:00+01:00", "expires": "2022-12-14T16:00:00+01:00", "effective": "2022-12-14T14:14:00+01:00" }, { "id": "dwd.2.49.0.0.276.0.DWD.PVW.1671023640000.f7e5cf25-c057-412b-95f4-9e2068921268.MUL", "payload": { "version": 3, "type": "ALERT", "id": "dwd.2.49.0.0.276.0.DWD.PVW.1671023640000.f7e5cf25-c057-412b-95f4-9e2068921268.MUL", "hash": "b780dbee567a7a4b42c829440e11a6aeb6ffb5c56c127397f8355d23199c55dc", "data": { "headline": "Amtliche UNWETTERWARNUNG vor GLATTEIS", "provider": "DWD", "severity": "Severe", "msgType": "Update", "area": { "type": "ZGEM", "data": "7743,7745,7749,7753,8191,8193,8199" }, "valid": true } }, "i18nTitle": { "de": "Amtliche UNWETTERWARNUNG vor GLATTEIS", "en": "Official SEVERE WEATHER WARNING for BLACK ICE", "ar": "تحذير رسمي من جليد مزلّج", "es": "AVISO oficial de MAL TIEMPO por SUPERFICIES HELADAS", "fr": "ALERTE officielle FORTES INTEMPÉRIES pour VERGLAS", "pl": "Oficjalne OSTRZEŻENIE METEOROLOGICZNE (3. STOPNIA) przed GOŁOLEDZIĄ", "ru": "Официальное штормовое предупреждение: Гололед", "tr": "ŞEFFAF BUZ için resmi KÖTÜ HAVA UYARISI" }, "sent": "2022-12-14T14:17:09+01:00", "onset": "2022-12-14T14:14:00+01:00", "expires": "2022-12-14T16:00:00+01:00", "effective": "2022-12-14T14:14:00+01:00" } ] ```
api31/warnings/dwd.2.49.0.0.276.0.DWD.PVW.1671023640000.f455a7ae-2ac9-4c07-be8b-fde54c8c2cdd.MUL.json ``` { "identifier": "dwd.2.49.0.0.276.0.DWD.PVW.1671023640000.f455a7ae-2ac9-4c07-be8b-fde54c8c2cdd.MUL", "sender": "opendata@dwd.de", "sent": "2022-12-14T14:17:04+01:00", "status": "Actual", "msgType": "Update", "source": "PVW", "scope": "Public", "code": [ "DVN:3", "id:2.49.0.0.276.0.DWD.PVW.1671023640000.f455a7ae-2ac9-4c07-be8b-fde54c8c2cdd" ], "references": "opendata@dwd.de,dwd.2.49.0.0.276.0.DWD.PVW.1671017520000.40cb5806-f0bd-4503-a4f4-f7f618c6abb3.MUL,2022-12-14T12:32:00+01:00", "info": [ { "language": "de-DE", "category": [ "Met" ], "event": "GLATTEIS", "responseType": [ "Prepare" ], "urgency": "Immediate", "severity": "Severe", "certainty": "Likely", "eventCode": [ { "valueName": "PROFILE_VERSION", "value": "2.1.13" }, { "valueName": "LICENSE", "value": "© GeoBasis-DE / BKG 2021 (Daten modifiziert)" }, { "valueName": "II", "value": "85" }, { "valueName": "GROUP", "value": "SLIPPERINESS" }, { "valueName": "GROUP", "value": "BLACK_ICE" }, { "valueName": "AREA_COLOR", "value": "229 57 53" } ], "effective": "2022-12-14T14:14:00+01:00", "onset": "2022-12-14T14:14:00+01:00", "expires": "2022-12-14T16:00:00+01:00", "senderName": "Deutscher Wetterdienst", "headline": "Amtliche UNWETTERWARNUNG vor GLATTEIS", "description": "Es besteht Glättegefahr mit Gefährdungspotenzial durch gefrierenden Regen.", "instruction": "Gefahr für Leib und Leben durch schlagartig gefrierenden Regen.
Handlungsempfehlungen:
Aufenthalt im Freien und Fahrten vermeiden bzw. Verhalten im Straßenverkehr anpassen; auf Beeinträchtigungen auf allen Verkehrswegen bis hin zu Sperrungen/Schließungen einstellen, notfalls Fahrweise anpassen, möglichst volltanken, Decken und warme Getränke mitführen", "web": "https://www.wettergefahren.de", "contact": "Deutscher Wetterdienst", "parameter": [ { "valueName": "cause", "value": "due to freezing rain" }, { "valueName": "PHGEM", "value": "7751,7756+1,7764,7770,8207,8209,8236" }, { "valueName": "ZGEM", "value": "7751,7756+1,7764,7770,8207,8209,8236" } ], "area": [ { "areaDesc": "Gemeinde Finsing, Gemeinde Karlsfeld, Gemeinde Pliening, Gemeinde Ismaning, Gemeinde Markt Schwaben, München-Feldmoching, Stadt Garching b. München, Gemeinde Oberschleißheim" } ] }, { "language": "en", "category": [ "Met" ], "event": "black ice", "responseType": [ "Prepare" ], "urgency": "Immediate", "severity": "Severe", "certainty": "Likely", "eventCode": [ { "valueName": "PROFILE_VERSION", "value": "2.1.13" }, { "valueName": "LICENSE", "value": "© GeoBasis-DE / BKG 2021 (Daten modifiziert)" }, { "valueName": "II", "value": "85" }, { "valueName": "GROUP", "value": "SLIPPERINESS" }, { "valueName": "GROUP", "value": "BLACK_ICE" }, { "valueName": "AREA_COLOR", "value": "229 57 53" } ], "effective": "2022-12-14T14:14:00+01:00", "onset": "2022-12-14T14:14:00+01:00", "expires": "2022-12-14T16:00:00+01:00", "senderName": "Deutscher Wetterdienst", "headline": "Official SEVERE WEATHER WARNING for BLACK ICE", "description": "There is a risk of dangerous icy surfaces (level 3 of 4).
Cause: due to freezing rain", "instruction": "Danger to life and limb due to: sudden freezing rain.
Recommendations for what to do:
Avoid staying outside and travelling - adapt behaviour in road traffic. Be prepared for disruptions to all transport routes, including blockages and closures - if necessary, adapt driving to the conditions; fill up petrol tank, if possible; take blankets and warm drinks.", "web": "https://www.wettergefahren.de", "contact": "Deutscher Wetterdienst", "parameter": [ { "valueName": "cause", "value": "due to freezing rain" } ], "area": [ { "areaDesc": "Gemeinde Finsing, Gemeinde Karlsfeld, Gemeinde Pliening, Gemeinde Ismaning, Gemeinde Markt Schwaben, München-Feldmoching, Stadt Garching b. München, Gemeinde Oberschleißheim" } ] }, { "language": "ar", "category": [ "Met" ], "event": "جليد مزلّج", "responseType": [ "Prepare" ], "urgency": "Immediate", "severity": "Severe", "certainty": "Likely", "eventCode": [ { "valueName": "PROFILE_VERSION", "value": "2.1.13" }, { "valueName": "LICENSE", "value": "© GeoBasis-DE / BKG 2021 (Daten modifiziert)" }, { "valueName": "II", "value": "85" }, { "valueName": "GROUP", "value": "SLIPPERINESS" }, { "valueName": "GROUP", "value": "BLACK_ICE" }, { "valueName": "AREA_COLOR", "value": "229 57 53" } ], "effective": "2022-12-14T14:14:00+01:00", "onset": "2022-12-14T14:14:00+01:00", "expires": "2022-12-14T16:00:00+01:00", "senderName": "Deutscher Wetterdienst", "headline": "تحذير رسمي من جليد مزلّج", "description": "هناك خطر من حدوث جليد مزلّج (الدرجة 4 من 3)
السبب: بسبب المطر المتجمد أو رذاذ المطر", "instruction": "تحذير! تنبيه إلى المخاطر المُمكنة التالية: تعطل قوي في حركة المرور و القطارات. تجنّبوا ركوب السيّارة! تجنّبوا ركوب السيّارة! إبقوا في المنزل.", "web": "https://www.wettergefahren.de", "contact": "Deutscher Wetterdienst", "parameter": [ { "valueName": "cause", "value": "due to freezing rain" } ], "area": [ { "areaDesc": "Gemeinde Finsing, Gemeinde Karlsfeld, Gemeinde Pliening, Gemeinde Ismaning, Gemeinde Markt Schwaben, München-Feldmoching, Stadt Garching b. München, Gemeinde Oberschleißheim" } ] }, { "language": "es", "category": [ "Met" ], "event": "superficies heladas", "responseType": [ "Prepare" ], "urgency": "Immediate", "severity": "Severe", "certainty": "Likely", "eventCode": [ { "valueName": "PROFILE_VERSION", "value": "2.1.13" }, { "valueName": "LICENSE", "value": "© GeoBasis-DE / BKG 2021 (Daten modifiziert)" }, { "valueName": "II", "value": "85" }, { "valueName": "GROUP", "value": "SLIPPERINESS" }, { "valueName": "GROUP", "value": "BLACK_ICE" }, { "valueName": "AREA_COLOR", "value": "229 57 53" } ], "effective": "2022-12-14T14:14:00+01:00", "onset": "2022-12-14T14:14:00+01:00", "expires": "2022-12-14T16:00:00+01:00", "senderName": "Deutscher Wetterdienst", "headline": "AVISO oficial de MAL TIEMPO por SUPERFICIES HELADAS", "description": "Existe el riesgo de que se produzca superficies heladas. (Nivel 3 de 4)
causa: debido a la lluvia engelante", "instruction": "CUIDADO, riesgo de los peligros siguientes: Se prevén fuertes perturbaciones del tráfico rodado y ferroviario. Evite desplazarse en un vehículo. No salga a la calle", "web": "https://www.wettergefahren.de", "contact": "Deutscher Wetterdienst", "parameter": [ { "valueName": "cause", "value": "due to freezing rain" } ], "area": [ { "areaDesc": "Gemeinde Finsing, Gemeinde Karlsfeld, Gemeinde Pliening, Gemeinde Ismaning, Gemeinde Markt Schwaben, München-Feldmoching, Stadt Garching b. München, Gemeinde Oberschleißheim" } ] }, { "language": "fr", "category": [ "Met" ], "event": "Verglas", "responseType": [ "Prepare" ], "urgency": "Immediate", "severity": "Severe", "certainty": "Likely", "eventCode": [ { "valueName": "PROFILE_VERSION", "value": "2.1.13" }, { "valueName": "LICENSE", "value": "© GeoBasis-DE / BKG 2021 (Daten modifiziert)" }, { "valueName": "II", "value": "85" }, { "valueName": "GROUP", "value": "SLIPPERINESS" }, { "valueName": "GROUP", "value": "BLACK_ICE" }, { "valueName": "AREA_COLOR", "value": "229 57 53" } ], "effective": "2022-12-14T14:14:00+01:00", "onset": "2022-12-14T14:14:00+01:00", "expires": "2022-12-14T16:00:00+01:00", "senderName": "Deutscher Wetterdienst", "headline": "ALERTE officielle FORTES INTEMPÉRIES pour VERGLAS", "description": "Il y a un risque de verglas généralisé (Niveau 3 sur 4).
cause: par suite de pluies verglaçantes", "instruction": "ATTENTION aux risques suivants: Le trafic routier et ferroviaire connaît de fortes perturbations. Évitez les déplacements en voiture! Restez à l’intérieur!", "web": "https://www.wettergefahren.de", "contact": "Deutscher Wetterdienst", "parameter": [ { "valueName": "cause", "value": "due to freezing rain" } ], "area": [ { "areaDesc": "Gemeinde Finsing, Gemeinde Karlsfeld, Gemeinde Pliening, Gemeinde Ismaning, Gemeinde Markt Schwaben, München-Feldmoching, Stadt Garching b. München, Gemeinde Oberschleißheim" } ] }, { "language": "pl", "category": [ "Met" ], "event": "gołoledź", "responseType": [ "Prepare" ], "urgency": "Immediate", "severity": "Severe", "certainty": "Likely", "eventCode": [ { "valueName": "PROFILE_VERSION", "value": "2.1.13" }, { "valueName": "LICENSE", "value": "© GeoBasis-DE / BKG 2021 (Daten modifiziert)" }, { "valueName": "II", "value": "85" }, { "valueName": "GROUP", "value": "SLIPPERINESS" }, { "valueName": "GROUP", "value": "BLACK_ICE" }, { "valueName": "AREA_COLOR", "value": "229 57 53" } ], "effective": "2022-12-14T14:14:00+01:00", "onset": "2022-12-14T14:14:00+01:00", "expires": "2022-12-14T16:00:00+01:00", "senderName": "Deutscher Wetterdienst", "headline": "Oficjalne OSTRZEŻENIE METEOROLOGICZNE (3. STOPNIA) przed GOŁOLEDZIĄ", "description": "Istnieje ryzyko wystąpienia: Gołoledź (stopień 3 z 4).
Przyczyna: z powodu zamarzającego deszczu", "instruction": "UWAGA! Informacja o możliwych zagrożeniach: Występują poważne utrudnienia w ruchu drogowym i szynowym. Unikać jazdy samochodem! Należy pozostać w domu!", "web": "https://www.wettergefahren.de", "contact": "Deutscher Wetterdienst", "parameter": [ { "valueName": "cause", "value": "due to freezing rain" } ], "area": [ { "areaDesc": "Gemeinde Finsing, Gemeinde Karlsfeld, Gemeinde Pliening, Gemeinde Ismaning, Gemeinde Markt Schwaben, München-Feldmoching, Stadt Garching b. München, Gemeinde Oberschleißheim" } ] }, { "language": "ru", "category": [ "Met" ], "event": "Гололед", "responseType": [ "Prepare" ], "urgency": "Immediate", "severity": "Severe", "certainty": "Likely", "eventCode": [ { "valueName": "PROFILE_VERSION", "value": "2.1.13" }, { "valueName": "LICENSE", "value": "© GeoBasis-DE / BKG 2021 (Daten modifiziert)" }, { "valueName": "II", "value": "85" }, { "valueName": "GROUP", "value": "SLIPPERINESS" }, { "valueName": "GROUP", "value": "BLACK_ICE" }, { "valueName": "AREA_COLOR", "value": "229 57 53" } ], "effective": "2022-12-14T14:14:00+01:00", "onset": "2022-12-14T14:14:00+01:00", "expires": "2022-12-14T16:00:00+01:00", "senderName": "Deutscher Wetterdienst", "headline": "Официальное штормовое предупреждение: Гололед", "description": "Существует риск от: Гололед (уровень 3 из 4).
Причина: ввиду ледяного дождя", "instruction": "ВНИМАНИЕ! Информация о возможных угрозах: Ожидаются серьезные сбои авто- и железнодорожного сообщения. Избегайте пользования автотранспортом! Не покидайте помещения!", "web": "https://www.wettergefahren.de", "contact": "Deutscher Wetterdienst", "parameter": [ { "valueName": "cause", "value": "due to freezing rain" } ], "area": [ { "areaDesc": "Gemeinde Finsing, Gemeinde Karlsfeld, Gemeinde Pliening, Gemeinde Ismaning, Gemeinde Markt Schwaben, München-Feldmoching, Stadt Garching b. München, Gemeinde Oberschleißheim" } ] }, { "language": "tr", "category": [ "Met" ], "event": "şeffaf buz", "responseType": [ "Prepare" ], "urgency": "Immediate", "severity": "Severe", "certainty": "Likely", "eventCode": [ { "valueName": "PROFILE_VERSION", "value": "2.1.13" }, { "valueName": "LICENSE", "value": "© GeoBasis-DE / BKG 2021 (Daten modifiziert)" }, { "valueName": "II", "value": "85" }, { "valueName": "GROUP", "value": "SLIPPERINESS" }, { "valueName": "GROUP", "value": "BLACK_ICE" }, { "valueName": "AREA_COLOR", "value": "229 57 53" } ], "effective": "2022-12-14T14:14:00+01:00", "onset": "2022-12-14T14:14:00+01:00", "expires": "2022-12-14T16:00:00+01:00", "senderName": "Deutscher Wetterdienst", "headline": "ŞEFFAF BUZ için resmi KÖTÜ HAVA UYARISI", "description": "Şeffaf buz bekleniyor (Seviye 3 / 4).
Sebep: donan yağış veya çisenti nedeniyle", "instruction": "DİKKAT! Olası tehlikelere yönelik bilgilendirme: Yol ve demir yolu trafiğinde yoğun engeller ortaya çıkar. Araç kullanımından kaçının! Evde kalın!", "web": "https://www.wettergefahren.de", "contact": "Deutscher Wetterdienst", "parameter": [ { "valueName": "cause", "value": "due to freezing rain" } ], "area": [ { "areaDesc": "Gemeinde Finsing, Gemeinde Karlsfeld, Gemeinde Pliening, Gemeinde Ismaning, Gemeinde Markt Schwaben, München-Feldmoching, Stadt Garching b. München, Gemeinde Oberschleißheim" } ] } ] } ```
home-assistant[bot] commented 1 year ago

Hey there @deermaximum, mind taking a look at this issue as it has been labeled with an integration (nina) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `nina` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Change the title of the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign nina` Removes the current integration label and assignees on the issue, add the integration domain after the command.

(message by CodeOwnersMention)


nina documentation nina source (message by IssueLinks)

DeerMaximum commented 1 year ago

Thanks for the hint.

Since the warnings you attached as an example only differ in ID and send time. So if I ignore warnings with the same headline and expire timestamp, the warnings would not be duplicated and the user would not have to configure anything further.

Vulpeculus commented 1 year ago

Hi DeerMaximimum,

how did you arrive at zgem=8209 for Garching?

In the NINA app, I found a database which has a value labaled 'z_id' for each commune (Gemeinde). I assume (but do not really know) that this corresponds to the zgem ('gem' like 'Gemeinde'?) in the warnings.

From this database, 8209 would be Pliening, and Garching b.München would be 7756

But I have to admit that I started to look into the NINA API only yesterday and do not have much experience yet. And since Garching and Pliening are not far apart, the warnings I have are valid for both of them.

DeerMaximum commented 1 year ago

@Vulpeculus you probably mean @mondbaron , he wrote that 8209 stands for Garching

Vulpeculus commented 1 year ago

Sorry for that

mondbaron commented 1 year ago

@DeerMaximum Thanks for the quick response! Indeed, this should fix the main issue for most users. On the downside you'll still receive irrelevant warnings from a neighbour municipality, but I guess that's acceptable or maybe even useful. Do you think it would be possible to keep the ZGEM data by joining the region codes of all duplicates? That way we could still use it or filter warnings in the future.

@Vulpeculus That's interesting and you might be correct. I just assumed that names and ids are in the same order, wich might not be the case. Can you provide a reference to the database you mentioned as I could not find it, but it would be very helpful. Maybe, if the list is publically available, we could even add an optional target filter to the config flow?

DeerMaximum commented 1 year ago

@mondbaron Currently, the ZGEM data is not passed through for the integration and therefore not taken into account. However, if in the future the ZGEM data becomes relevant for filtering the warnings, I will consider your suggestion.

Vulpeculus commented 1 year ago

@mondbaron The database is in the NINA app itself. You can download the apk file e.g. at https://www.bbk.bund.de/DE/Warnung-Vorsorge/Warn-App-NINA/NINA-Download/nina-download_node.html (Use the 3rd option, not Google or Apple store, this gives you a zip file with the apk file and an md5 checksum file) The apk file technically is also a zip file. Unpack it, then you will find in assets/database three sqlite databases. The youngest of them (NINA2019.sqlite) has the mentioned table „Gemeinden“ with the z_id values. (The other 2 older databases only have „Landkreise“)