xlcnd / meteoalarmeu

A 'custom component' for Home-Assistant for Weather Warnings from meteoalarm.eu

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

awareness_type property seems to be mandatory

viktak opened this issue · comments

when using this integration without specifying awareness_types, I get the following error:

Source: config.py:416
First occurred: 8:20:40 AM (1 occurrences)
Last logged: 8:20:40 AM

Invalid config for [binary_sensor.meteoalarmeu]: value must be one of ['Avalanches', 'Coastal Event', 'Extreme high temperature', 'Extreme low temperature', 'Flood', 'Fog', 'Forestfire', 'Rain', 'Rain-Flood', 'Snow/Ice', 'Thunderstorms', 'Wind'] @ data['awareness_types'][0]. Got None. (See /config/configuration.yaml, line 113). Please check the docs at https://github.com/xlcnd/meteoalarmeu```

My config:
```binary_sensor:
  - platform: meteoalarmeu
    country: 'GR'
    region: 'Attiki'

If I also specify (all the) awareness_types, it works properly.

commented

Please, update to Release v2021.2.2.

commented

You are right! I will fix that... Thanks!

awareness_types were declared optional but then they are mandatory! A bug in HA?

@xlcnd I just did the update, and it is now NOT mandatory. Check configuration doesn't report it wrong.

However, if I don't specify it, I don't get any updates from the service. Sometimes I get Bad response in the logs, sometimes not. I tried it several times and when I specify awareness_types, it consistently succeeds in getting me updates, without it consistently fails.

commented

I will check the issue...

@xlcnd Thanks for investigating this.

I just got this error again, so I can give you the exact message from the log:

Source: custom_components/meteoalarmeu/binary_sensor.py:116
Integration: meteoalarmeu (documentation, issues)
First occurred: 9:46:16 AM (1 occurrences)
Last logged: 9:46:16 AM

Bad response from meteoalarm.eu
commented

Please, can you test it with the Release v2021.2.3?

By the way, the server meteoalarm.eu has been with intermittent problems, so some of those error messages are OK. Another thing that could happen is the 'binary_sensor' be 'unavailable'. That is OK if the server has problems.

Yepp, looks OK now.

I don't think it was the web site itself, as I could always get a proper response with awareness_types provided and never without.

Now it works properly. No errors, and proper state/attributes:
Screenshot 2021-02-09 124447

Thank you, it's a great extra for HA!

commented

Thanks! There was a real issue caused by a last minute (innocent) change from a list to a tuple...

What I was referring to was messages like Bad response from meteoalarm.eu that are caused by the server.

Once more Thank You.

@xlcnd yes, got it, thanks!