Meteoalarm push message don't work

Any tips how I can fix this so I get push message if there is something going on:

#configuration.yaml:
binary_sensor:
  - platform: meteoalarm
    country: "BE"
    province: "Limburg"
    language: "ne"
Automation:
alias: 'Bericht: MeteoAlarm'
description: ''
trigger:
  - platform: state
    entity_id: binary_sensor.meteoalarm
    from: 'off'
    to: 'on'
condition: []
action:
  - service: notify.notify
    data:
      title: '{{state_attr(''binary_sensor.meteoalarm'', ''headline'')}}'
      message: >-
        {{state_attr('binary_sensor.meteoalarm', 'description')}} is effective
        on {{state_attr('binary_sensor.meteoalarm', 'effective')}}
mode: single

But this doesn’t work, I don’t get any push message, this is directly from: https://www.home-assistant.io/integrations/meteoalarm/.

Hope anyone can help.

Did you setup a notifier?

Sorry i’m a noob, what do you mean? If you mean within my iphone, yes, push messages are working properly for other integrations.

Ok, do you gwt any errors in the logs? When you send notifications from other integrations do you usethe notify.notify service as well? When you execute the automation manually, do you get the message?

No errors in the log, and when I do it manuelly, no message. Yes, I use notify.notify for everything :slight_smile:

Can you show how the binary_sensor.meteoalarm looks under Developer Tools -> States?

This is a horribly difficult and unreliable integration. Or, to be more precise, a terribly unreliable service from metro alarm. I use it since its inception and the binary sensor often isn’t there when you expect it looking out of the window :wink: also, when it is available and you check the website source, a completely different code might be displayed.

Long story short: can you check the template itself in the editor to see if it is alive and what the result is ?

We see this now:

fwiw, this works, (if the binary_sensor works)

  - alias: Meteoalarm Alert
    trigger:
      platform: state
      entity_id: binary_sensor.meteoalarm_brabant
      from: 'off'
    action:
      service: notify.notify
      data:
        title: >
          {{state_attr('binary_sensor.meteoalarm_brabant','headline')}}
        message: >
          {{state_attr('binary_sensor.meteoalarm_brabant','description')}} is effective on
          {{state_attr('binary_sensor.meteoalarm_brabant','effective')}}

note that the binary_sensor is named in my case, because I use the ‘name’ option

Hi, Yes i see it:

attribution: Information provided by MeteoAlarm
friendly_name: meteoalarm
device_class: safety

And did the sensor ever turn on during your testing? And when it turned on, did it have the attributes headline, description and effective?

Hi, when I set it to on, nothing change. Still the same message as above. I think I change the country to test it again if that works or not.

Update:

binary_sensor:
  - platform: meteoalarm
    country: "NL"
    province: "Limburg"
    language: "ne"

Works!

binary_sensor:
  - platform: meteoalarm
    country: "BE"
    province: "Limburg"
    language: "ne"

Not. Weird, it excist: https://www.meteoalarm.eu/ne_NL/0/0/BE007-Limburg%20/%20Limbourg.html. Maybe something wrong in the conf?

I mean when the binary_sensor changes to on by itself.

How did you test this automation? Did you set the state of the binary_sensor manually to on from Developer Tools → States? If so, this is not going to work, this will only temporarily ovverride the state of the sensor and the attributes also won’t appear.
You need to wait for the sensor to change the state by itself, then you’ll also have the attributes and your notification should work.

Yes, I updated the info, something is off:

binary_sensor:
  - platform: meteoalarm
    country: "NL"
    province: "Limburg"
    language: "ne"

Works!

binary_sensor:
  - platform: meteoalarm
    country: "BE"
    province: "Limburg"
    language: "ne"

Not. Weird, it excist: https://www.meteoalarm.eu/ne_NL/0/0/BE007-Limburg%20/%20Limbourg.html. Maybe something wrong in the conf?

@rolfberkenbosch maybe you know how I can fix this? :slight_smile:

and this is the issue, the service doesn’t deliver a spontaneous change, or even a manual update through the update_entity service. As example, I am still seeing the Flooding alerts while there has been a snow alert for 2 days now. It must have something to do with the ‘effective’ and ‘expires’ attribute.

Also, we get a ‘wrong country’ error, while the conf hasn’t changed since original configuration, and the setting is 100% correct
@hjalmarr don’t you get wrong country errors in the log? Seems you are suffering from something like that

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 358, in _async_add_entity
    await entity.async_device_update(warning=False)
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 466, in async_device_update
    await task
  File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/components/meteoalarm/binary_sensor.py", line 88, in update
    alert = self._api.get_alert()
  File "/usr/local/lib/python3.8/site-packages/meteoalertapi/meteoalertapi.py", line 26, in get_alert
    raise(WrongCountry())

Hi @Mariusthvdb no, I don’t get any error in my logs. I fixed it now for myself to use country NL with language NL and province Limburg. If I go to country BE, I only can use the FR language which I don’t want :slight_smile:

PS: I also tested it, and with the automation the push message will be send correctly. But I hope I can somehow use the ne language?

I wouldn’t know sorry, but it seems you really want your info to be geo-locationally correct, first of all and language is of secondary importance.

You should raise an issue on the integration though, maybe it is a core HA thing. If its on the server Meteoalarm side of things, I fear there’s nothing much that ca be done

If the info you get back is bi-lingual, can’t you template the dutch part? It’s what I do on the Weatherbit icon that is bilingual too:

  - type: conditional
    conditions:
      - entity: binary_sensor.weatherbit_alert
        state: 'on'
    card:
      type: markdown
      content: >
        ## <font color= red> {{state_attr('binary_sensor.weatherbit_alert','Title')}}</font>

        <font color= green> **Severity:**</font> <font color= grey> {{state_attr('binary_sensor.weatherbit_alert','Severity')}} </font>

        <font color= green> **Description:**</font>

        <font color= grey> {{state_attr('binary_sensor.weatherbit_alert','Description').split('english')[0]}} </font>

        <font color= green> {{state_attr('sensor.weatherbit_weather_alerts','attribution')}}</font>

Hi, thanks for your replies :D.
This fixed it for me: https://github.com/xlcnd/meteoalarmeu. Happy :smiley:

o nice, hadn’t seen that before. Though, I wonder what the advantage over the core integration would be considering the identical issues described in the disclaimer:

If by any reason the server becames unavailable or sends an error status (and this happens a lot with meteoalarm.eu!) the sensor becomes unavailable too , if in the next update the server is ok, it becomes available again .

Hi

I also don’t understand what the correct settings are to get a Belgian Province.

When replacing ‘region’ by ‘province’ I get an error validation the config.
So Belgium needs a region.

So I tried ‘BE002’ as region (= Province ‘Antwerpen’).
I tried ‘Antwerpen’ and ‘002’.

I keep getting an error in the log file that I have to check the site for the correct region name.
I just don’t know where to look.

Any help from people in Belgium is appreciated.

The site is Antwerpen / Anvers. So the exact name of your region is “Antwerpen / Anvers”.

1 Like