Is meteoalarm.eu down?

The site is up again

site is up, but the alert in progress is not shown in home assistant. Strange.

I’m also getting meteoalarm errors in my log:

2019-06-13 17:30:24 ERROR (MainThread) [homeassistant.components.binary_sensor] meteoalarm: Error on device update!
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/urllib/request.py", line 1317, in do_open
    encode_chunked=req.has_header('Transfer-encoding'))
  File "/usr/local/lib/python3.7/http/client.py", line 1229, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/usr/local/lib/python3.7/http/client.py", line 1275, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/usr/local/lib/python3.7/http/client.py", line 1224, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/usr/local/lib/python3.7/http/client.py", line 1016, in _send_output
    self.send(msg)
  File "/usr/local/lib/python3.7/http/client.py", line 956, in send
    self.connect()
  File "/usr/local/lib/python3.7/http/client.py", line 928, in connect
    (self.host,self.port), self.timeout, self.source_address)
  File "/usr/local/lib/python3.7/socket.py", line 727, in create_connection
    raise err
  File "/usr/local/lib/python3.7/socket.py", line 716, in create_connection
    sock.connect(sa)
TimeoutError: [Errno 110] Operation timed out
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/meteoalertapi/meteoalertapi.py", line 35, in get_alert
    file = urlopen('http://meteoalarm.eu/ATOM/'+ country +'.xml')
  File "/usr/local/lib/python3.7/urllib/request.py", line 222, in urlopen
    return opener.open(url, data, timeout)
  File "/usr/local/lib/python3.7/urllib/request.py", line 525, in open
    response = self._open(req, data)
  File "/usr/local/lib/python3.7/urllib/request.py", line 543, in _open
    '_open', req)
  File "/usr/local/lib/python3.7/urllib/request.py", line 503, in _call_chain
    result = func(*args)
  File "/usr/local/lib/python3.7/urllib/request.py", line 1345, in http_open
    return self.do_open(http.client.HTTPConnection, req)
  File "/usr/local/lib/python3.7/urllib/request.py", line 1319, in do_open
    raise URLError(err)
urllib.error.URLError: <urlopen error [Errno 110] Operation timed out>
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 261, in _async_add_entity
    await entity.async_device_update(warning=False)
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 377, in async_device_update
    await self.hass.async_add_executor_job(self.update)
  File "/usr/local/lib/python3.7/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 93, in update
    alert = self._api.get_alert()
  File "/usr/local/lib/python3.7/site-packages/meteoalertapi/meteoalertapi.py", line 39, in get_alert
    raise(WrongCountry())
meteoalertapi.meteoalertapi.WrongCountry
2019-06-13 17:45:30 ERROR (MainThread) [aiohttp.server] Unhandled exception
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/aiohttp/web_protocol.py", line 447, in start
    await resp.prepare(request)
  File "/usr/local/lib/python3.7/site-packages/aiohttp/web_response.py", line 353, in prepare
    return await self._start(request)
  File "/usr/local/lib/python3.7/site-packages/aiohttp/web_response.py", line 667, in _start
    return await super()._start(request)
  File "/usr/local/lib/python3.7/site-packages/aiohttp/web_response.py", line 410, in _start
    await writer.write_headers(status_line, headers)
  File "/usr/local/lib/python3.7/site-packages/aiohttp/http_writer.py", line 112, in write_headers
    self._write(buf)
  File "/usr/local/lib/python3.7/site-packages/aiohttp/http_writer.py", line 67, in _write
    raise ConnectionResetError('Cannot write to closing transport')
ConnectionResetError: Cannot write to closing transport

Does anyone else have a working MeteoAlarm sensor?

Could the HA component have been blocked by MeteoAlarm?

For days I have the meteoalarm sensor at “off” state regardless that we had several yellow and orange alerts at their webpage.

Perhaps someone knows how to ping the developer?

The component, python library or website is flaky. The last time my sensor was updated is 24 hours ago.

{{states.binary_sensor.meteoalarm.last_updated}}

Lots of different timeouts and errors in the logs.

Cc @rolfberkenbosch

I’ve removed it now, it’s a nice idea for a component but if it’s not reliable then it’s not worth using IMO.

1 Like

yes, not wanting to cross-post, please accept this link to another thread on the subject: Love the new Meteoalarm - how do I put the alert in a card?

Have to cancel the integration for now, hope to be of help when the dev takes it on to improve.

The component logging says that it times out because it takes too long to update:

Updating meteoalarm binary_sensor took longer than the scheduled update interval 0:30:00
15:30 helpers/entity_platform.py (WARNING) - message first occured at 12:00 and shows up 8 times

The xml is quick to load though:

https://www.meteoalarm.eu/ATOM/NL.xml

I’m not at home currently but when I am I will enable debug logging for the component and see what is happening behind the scenes.

hi, if you get to that, please have a look if this is explainable too:
38
Its safe so should show the mdi:shield-check icon… nothing really important, but it shows the integration isn’t functioning correctly.

I already know why that is the case. The component HAD set a fixed icon, instead of relying on the device class. This has already been fixed and will probably be released soon (tagged with 0.95.0b0).

The component will probably (hopefully :wink:) be updated in the next release.

The api update is also tagged with the same release.

1 Like

Ok, thanks for the update, missed that, sorry.
Hope they also fix the attributes, or better said, the absence of attributes in the ‘Off’ state.

Too bad @rolfberkenbosch isn’t chiming in on this discussion. :cry:

Sorry, I was not logged in. I will look into it!

The problem that I’m facing right now is that the website is totally not responsive enough. I have send them several emails, but get 0 response back. I’m looking if we can setup a mirror of meteoalarm.eu. Does anyone has some knowledge how to do this ?

What did you mean with “Hope they also fix the attributes, or better said, the absence of attributes in the ‘Off’ state.”

What do you expect ?

thanks for getting back to this, I probably should have been more explicit, sorry for that…

using:

  - type: markdown
    content: >
      # <font color= grey> Weer Alarm Brabant:  [[ binary_sensor.meteoalarm_brabant.state ]] </font>

      ___

      **Alarm code**

      <font color= [[ sensor.weer_alarm.state ]]> - [[ sensor.weer_alarm.state ]] </font>

      <font color= [[ sensor.weer_alarm.state ]]> - [[ binary_sensor.meteoalarm_brabant.attributes.awareness_level ]] </font>

      <font color= [[ sensor.weer_alarm.state ]]> - [[ binary_sensor.meteoalarm_brabant.attributes.awareness_type ]] </font>

      **Headline**

      <font color= #4caf50> - [[ binary_sensor.meteoalarm_brabant.attributes.headline ]] </font>

      **Event**

      <font color= #4caf50> - [[ binary_sensor.meteoalarm_brabant.attributes.event ]] </font>

      **Status**

      <font color= #4caf50> - [[ binary_sensor.meteoalarm_brabant.attributes.description ]] </font>

      ___

renders:

35

because the attributes aren’t set when the binary_sensor is Off.

would be really nice if the attributes could be set to None, or some other informative setting.

Ive created a template sensor based on the meteo_alarm binary_sensor:

      weer_alarm:
        friendly_name: Weeralarm
        value_template: >
          {% if is_state('binary_sensor.meteoalarm_brabant','on') %}
          {% set code = state_attr('binary_sensor.meteoalarm_brabant','awareness_level').split(';')[1] %}
          {{code|title}}
          {% else %} Green
          {% endif %}
        icon_template: >
          {% if is_state('binary_sensor.meteoalarm_brabant','on') %}
          {% set code = state_attr('binary_sensor.meteoalarm_brabant','awareness_level').split(';')[0] %}
          {% else %} {% set code = '0' %} 
          {% endif %}
          {{'mdi:numeric-' + code + '-box'}}

and customizations:

    sensor.weer_alarm:
      templates:
        icon_color: >
          return state;

    binary_sensor.meteoalarm_brabant:
      friendly_name: Meteoalarm Brabant
      templates:
        icon_color: >
          return entities['sensor.weer_alarm'].state;

to help out somewhat, but it would be really nice if this could be done without all this extra coding :wink:

I will into it. I haven’t seen that meteoalarm has a standard XML output. I have created a loop that will give all the attributes back when there is an “weather alarm”. Not every country is giving back the same attributes, that’s why it makes it difficult to set all the attributes to none.

You can look if you can use jinja2 for you markdown. That will solve your problem.

I hope you can at least fix the issue that an entity currently is not created if the site is down when restarting HA. When timing out, you should at least create the sensor with an Unknown state, that will be updated as soon as the site is back online.