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
70.07k stars 29.14k forks source link

Problem with alerts from Meteoalarm - Not working #65699

Closed koles142 closed 1 year ago

koles142 commented 2 years ago

The problem

Weather alerts not working from Meteoalarm:

My config seems to be good. On website of meteoalarm I see active alerts for my localization but in Home Assistant sensor has state: safety.

What version of Home Assistant Core has the issue?

2022.02.1

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

Meteoalarm

Link to integration documentation on our website

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

Example YAML snippet

binary_sensor:
  - platform: meteoalarm
    country: "poland"
    province: "Zielona Góra"
    language: "pl"

I've tried language: pl-PL also.

Anything in the logs that might be useful for us?

Log is clean - no errors

Additional information

Actually meteoalarm is available from: meteoalarm.ORG not from meteoalarm.eu like previously-> it could be source of the problem?

probot-home-assistant[bot] commented 2 years ago

meteoalarm documentation meteoalarm source (message by IssueLinks)

probot-home-assistant[bot] commented 2 years ago

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

taker218 commented 2 years ago

I had the same problem, but it seems to work again.

Maybe you need to update to the latest version of HA

koles142 commented 2 years ago

Hi, I have latest version of HA. I’ll check it again

koles142 commented 2 years ago

Unfortunately, not working for me.

taker218 commented 2 years ago

seems to be broken for me again, I don't know why.

rolfberkenbosch commented 2 years ago

Hmmm, interesting. I'm still using an older version of HA and that's working. That mean's that someone of the HA community has change some core components. Have you have some error logs ?

taker218 commented 2 years ago

The only thing in the log for me was this:

2022-02-07 14:29:39 WARNING (MainThread) [homeassistant.components.binary_sensor] Setup of binary_sensor platform meteoalarm is taking over 10 seconds.

But I just changed the city to one, where there is a warning and this seems to work. When I change it back to my city it is shown as safe (which is correct). There only seems to be the case, that when there is no warning, the attributes are not filled. I have one card with the current status and with the attribute event, which now says it's unknown.

But I don't know, if this was the case before it stopped working for one or two days on my end.

taker218 commented 2 years ago

So I just tested something with the following configuration:

binary_sensor:
  - platform: meteoalarm
    country: "Poland"
    province: "Małopolskie Province Nowosądecki County"
    language: "de-DE"

This doesn't seem to work:

2022-02-09 13:52:14 ERROR (MainThread) [homeassistant.components.binary_sensor] meteoalarm: Error on device update! Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 431, in _async_add_entity await entity.async_device_update(warning=False) File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 709, in async_device_update await task File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 52, in run result = self.fn(*self.args, **self.kwargs) File "/usr/src/homeassistant/homeassistant/components/meteoalarm/binary_sensor.py", line 83, in update expiration_date = dt_util.parse_datetime(alert["expires"]) KeyError: 'expires'

But when I remove the language section from the config, the sensor get's loaded, but doesn't show a warning, which it should, since there is one for that region in Poland.

koles142 commented 2 years ago

For Poland language should be: pl or pl-PL . I had tested it, and not working. I have still status safe, even when is warning. I don’t know when it had stops but I’m sure that everything was working 2-3 months ago. Second question: It is possibile to self change interval of refresh data from meteoalarm.eu by adding position to config section of binary sensor?

rolfberkenbosch commented 2 years ago

I have tested it, and it is still working. Below you will find an active alert in poland.

  - platform: meteoalarm
    country: "poland"
    province: "Eastern coastal zone"
    language: "pl-PL"
    scan_interval: 60

You need to be very carefull with the language and country name. I have already merged a pull request to make it more stable with capitals.

I found out that the documentation is outdated. And it is not clear for users what kind of languages each country support. I will look if I can make a wizard within home-assistant to set up meteoalarm.

ps: scan_interval is in seconds.

koles142 commented 2 years ago

Thank you, now I'm checking it and for this time - not working.

My test config:

After restart HA, I was waiting for refresh ~10 minutes and nothing - status is safe. Actually this location has an active alarm. meteo meteo1

nepozs commented 2 years ago

@koles142 my working configuration for Wrocław

  - platform: meteoalarm
    country: "Poland"
    province: "Dolnośląskie Province Wrocław County"
    language: "en-GB"

and for Drawsko

  - platform: meteoalarm
    country: "Poland"
    province: "Zachodniopomorskie Province Drawski County"
    language: "pl-PL"

You can check proper names and language code in RSS feed https://feeds.meteoalarm.org/feeds/meteoalarm-legacy-rss-poland for Poland works "pl-PL" and "en-GB" - it changes language of attributes

language: en-GB
category: Met
event: Yellow snow-ice warning
responseType: None
urgency: Expected
severity: Moderate
certainty: Likely
effective: '2022-02-11T12:21:00+01:00'
onset: '2022-02-11T23:00:00+01:00'
expires: '2022-02-12T08:00:00+01:00'
senderName: IMGW-PIB, Meteorological Forecast Centre, Wroclaw Team
headline: Yellow Icing warning for Poland - Dolnoslaskie Province Wroclaw County
description: >-
  It is expected roads and pavements icing caused by wet surface freezing after
  sleet, wet snow falls. The minimum temperature around -2°C,  minimum
  temperature near the ground around -4°C.
instruction: >-
  BE AWARE of widespread ice or/and snow on roads and pavements. Localized
  disruption of outdoor activities. Take care when walking, cycling or driving
  due to slippery surfaces.
web: https://meteo.imgw.pl/dyn/?osmet=true
contact: meteo.wroclaw@imgw.pl
awareness_level: 2; yellow; Moderate
awareness_type: 2; snow-ice
attribution: Information provided by MeteoAlarm
device_class: safety
friendly_name: meteoalarm
language: pl-PL
category: Met
event: Żółty alert na oblodzenie
responseType: None
urgency: Expected
severity: Moderate
certainty: Likely
effective: '2022-02-11T12:21:00+01:00'
onset: '2022-02-11T23:00:00+01:00'
expires: '2022-02-12T08:00:00+01:00'
senderName: IMGW-PIB Centralne Biuro Prognoz Meteorologicznych - Wydział we Wrocławiu
headline: Żółty alert na oblodzenie dla Polski - województwo dolnośląskie powiat Wrocław
description: >-
  Prognozuje się zamarzanie mokrej nawierzchni dróg i chodników po opadach
  deszczu deszczu ze śniegiem, mokrego śniegu powodujące ich oblodzenie.
  Temperatura minimalna około -2°C, temperatura minimalna przy gruncie około
  -4°C.
instruction: >-
  Spodziewaj się utrudnień. Oblodzenie chodników i dróg wpływające na
  pogorszenie warunków ruchu drogowego. Z powodu śliskiej nawierzchni należy
  zachować ostrożność w ruchu pieszym i podczas prowadzenia pojazdów.
web: https://meteo.imgw.pl/dyn/?osmet=true
contact: meteo.wroclaw@imgw.pl
awareness_level: 2; yellow; Moderate
awareness_type: 2; snow-ice
attribution: Information provided by MeteoAlarm
device_class: safety
friendly_name: meteoalarm
language: pl-PL
category: Met
event: Żółty alert na oblodzenie
responseType: None
urgency: Expected
severity: Moderate
certainty: Likely
effective: '2022-02-11T12:34:00+01:00'
onset: '2022-02-11T20:00:00+01:00'
expires: '2022-02-12T08:00:00+01:00'
senderName: IMGW-PIB Biuro Meteorologicznych Prognoz Morskich - Wydział w Szczecinie
headline: >-
  Żółty alert na oblodzenie dla Polski - województwo zachodniopomorskie powiat
  drawski
description: >-
  Prognozuje się zamarzanie mokrej nawierzchni dróg i chodników po opadach
  deszczu, deszczu ze śniegiem lub mokrego śniegu powodujące ich oblodzenie.
  Temperatura minimalna od -4°C do -2°C, temperatura minimalna przy gruncie do
  -6°C.
instruction: >-
  Spodziewaj się utrudnień. Oblodzenie chodników i dróg wpływające na
  pogorszenie warunków ruchu drogowego. Z powodu śliskiej nawierzchni należy
  zachować ostrożność w ruchu pieszym i podczas prowadzenia pojazdów.
web: https://meteo.imgw.pl/dyn/?osmet=true
contact: meteo.szczecin@imgw.pl
awareness_level: 2; yellow; Moderate
awareness_type: 2; snow-ice
attribution: Information provided by MeteoAlarm
device_class: safety
friendly_name: meteoalarm
koles142 commented 2 years ago

Hi, yesterday i've received alert :) Now, I think everything is working now.

Thanks

joohann commented 2 years ago

There are still some problem https://community.home-assistant.io/t/meteoalarm/394097/4

@rolfberkenbosch is there any way we can support you to make this up and running again?

iamnikv commented 2 years ago

Currently not working for me.

MeteoAlarm Config:

- platform: meteoalarm
  country: "bulgaria"
  province: "Vratsa"
  scan_interval: 60

image image

And I have no log entries.

iamnikv commented 2 years ago

I updated HA to v.2022.4.2 and now I get and error in the logs:

...
meteoalertapi.meteoalertapi.WrongCountry
rolfberkenbosch commented 2 years ago

I will update my ha tonight to see if there is a new problem or if there is a problem with meteoalarm.eu api website.

martkopecky commented 2 years ago

Any updates here? Currently the thunderstorm season is approaching and I would really love to have my warnings working...

rolfberkenbosch commented 2 years ago

Can you share me your config. Meteoalarm is still working as aspected.

martkopecky commented 2 years ago

My config is as follows

package_meteoalarm:
  binary_sensor:
    - platform: meteoalarm
      country: "czechia"
      province: "Středočeský kraj (Benešov, Beroun, Brandýs nad Labem-Stará Boleslav, Čáslav, Černošice, Český Brod, Dobříš, Hořovice, Kladno, Kolín, Kralupy nad Vltavou, Kutná Hora, Lysá nad Labem, Mělník, Mladá Boleslav, Mnichovo Hradiště, Neratovice, Nymburk, Poděbrady, Rakovník, Říčany, Slaný)"

Looking into the atom feed, the site tends to change the "province" name arbitrarily for my country.

link href="https://meteoalarm.org?geocode=EMMA_ID:CZ009" hreflang="en" title="Středočeský kraj (Benešov, Dobříš, Příbram, Říčany, Sedlčany, Votice)"

link href="https://meteoalarm.org?geocode=EMMA_ID:CZ009" hreflang="en" title="Středočeský kraj (Čáslav, Český Brod, Hořovice, Kolín, Kutná Hora, Lysá nad Labem, Nymburk, Poděbrady)"

link href="https://meteoalarm.org?geocode=EMMA_ID:CZ009" hreflang="en" title="Středočeský kraj (Vlašim)"

Is there any way around it? For now I am using feedreader integration and collecting relevant events from the database using SQL sensor, filtering for EMMA_ID:CZ009.

Not great, but does the job.

martkopecky commented 2 years ago

I see that meteoalarmapi now has new commits in master which support regex for provinces, which is exactly what I am looking for. Any chance to publish a new version of meteoalarmapi and bump manifest in hass core?

Sadly, my workaround with feedreader does not work either, the events do not seem to be triggered for each record in the atom feed - not sure why.

nepozs commented 1 year ago

@rolfberkenbosch I'm sure that Meteoalarm integration isn't working now edit: I can't understand this - it works OK with HA 2022.08.0beta-x OK I've missed this https://github.com/home-assistant/core/pull/75840

my last config (after language changes,, because pl-PL nor en-GB don't work, but feed has changed, so it was my last try):

  - platform: meteoalarm
    country: "Poland"
    province: "Dolnośląskie Province Wrocław County"
    language: "en"

some new documentation https://edrop.zamg.ac.at/owncloud/index.php/s/FegwJnoC3XiesnE https://edrop.zamg.ac.at/owncloud/index.php/s/mZqRkH3t9767NfN https://edrop.zamg.ac.at/owncloud/index.php/s/5dwRiKmsF3r54tb https://edrop.zamg.ac.at/owncloud/index.php/s/GxPbmaRFpzrDmjn#pdfviewer https://edrop.zamg.ac.at/owncloud/index.php/s/KLnQATfay8FAREQ#pdfviewer

ddppddpp commented 1 year ago

I've checked the links provided and they're full with typos. There are standards for i.e. country and province names in Europe and those guys are not following them. Can you please suggest a way of submitting issues to meteoalarm?

schumi2309 commented 1 year ago

Hello, I try to configure my country and my province but it always tells me "no alert" off, I do have an alert on the site for the moment. did I configure my country or province incorrectly?

i have try too "Liège" and "Liege" do not change ! Thanks.

Virgo29 commented 1 year ago

Hello to all. I have something that occurs in my installation, with my setup for "porto" (portugal) i also get alerts from "porto santo" another region of portugal. Something to do ? Thanks

Meteoalarm

Tahuwa commented 1 year ago

Hello, I try to configure my country and my province but it always tells me "no alert" off, I do have an alert on the site for the moment. did I configure my country or province incorrectly?

  • platform: meteoalarm name: Alerte Météo country: "Belgium" province: "Luik" language: fr-FR

i have try too "Liège" and "Liege" do not change ! Thanks.

Hi, did you manage to get this working? Having the exact same issue but with Antwerp:

Currently there are multiple alerts but getting none.

joohann commented 1 year ago

Mine says it's safe probably because there are multiple alarms. image

image

ekranas13 commented 1 year ago

Mine says its safe but on the meteoalarm.org my target area has a single Snow or Ice warning active.

my config is:

Somewhere data is lost along the way :(

ekranas13 commented 1 year ago

Mine says its safe but on the meteoalarm.org my target area has a single Snow or Ice warning active.

my config is:

  • platform: meteoalarm country: "lithuania" province: "Vilniaus apskritis" I wasnt confident if my input parameters were correct so I looked up deeper. It uses meteoalarmapi which takes the country to finish the feed url: https://feeds.meteoalarm.org/feeds/meteoalarm-legacy-atom-{country} and uses the province to text match the cap:areaDesc in the above xml response: if re.search(rf"{self.province}", entry.get('cap:areaDesc'), re.IGNORECASE) == None:

Somewhere data is lost along the way :(

After 24 hours or so passed started to work. Getting warning messages about snow which are visible in the website as well

tiimsvk commented 1 year ago

Yes, today I realized again that the weather alarm is not working. And based on the answer

Mine says it's safe probably because there are multiple alarms.

That seems really true. Because several alarms are detected in my area, but the meteoalarm says that everything is ok.

can someone fix it. I have some esp modules that work based on these alarms.

ge8020 commented 1 year ago

At the time, meteoalarm stopped working, after it worked well for a couple of months with my installation now. I have one active stormwarning on meteoalarm.org since yesterday, but the integration shows "off". Please have a look at it.

themysteq commented 1 year ago

Hi @rolfberkenbosch! Maybe it's a good time to redesign and rewrite this integration as different kind of sensor? i.e. SensorDeviceClass.ENUM or at least as additional alongside current binary "safety" sensor. What do you think?

I can help you with this but I have to be sure you will accept any meaningful PRs before storm season start in EU ;) as I would like also to benefit from this integration :)

P.S. is it possible to migrate from unittest to pytest? especially for meteoalarm-api project https://github.com/rolfberkenbosch/meteoalert-api/pull/30 Or give us a sign if you have not enough time to actively develop this integration

Cheers!

issue-triage-workflows[bot] commented 1 year ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.