Weatherbit.io - Current Weather and Forecast data

Yes, Bjarne, you are so right! Thanks for putting me onto the right track. I downgraded and now it works again.
Now I also see the warning in HACS, saying loud and clear that… “You must minimum be running Home Assistant 2022.7.0 for this release to work.” It was so big and headline style that I simply did not read it but skipped over to the smaller stuff. :face_with_raised_eyebrow:
Thanks for your help and for your work on this integration!

Noob here, I’m trying to make this work because Meteoalarm isn’t working anymore for me within Home assistant.

Trying to get a push notification when there is a alert:

service: notify.notify
data:
  title: Weeralarm!
  message: '{{state_attr(''sensor.weatherbit_weather_alerts'', ''description_local'')}}'
  data:
    push:
      sound:
        name: Fanfare.caf
        critical: 1

Don’t get any messages, any idea why?

WeatherBit uses Meteoalarm as their Alert provider in Europe, and until yesterday, this did not work. As far as we could tell Meteoalarm had made some changes in their API. As of today, this should be working again, a user tells me. (Which might be the reason the Official Metoalarm Integration is not working)

I have not looked in to in to your template, but just wanted to give this more general information.

I tested it this morning, still not working for me. So I thought i switch to Weatherbit because that was working :-).

I have not tested it myself, but I got feedback from another WeatherBit user saying that it now works (He is located in Austria)

Weatherbit is working like I said. But the official meteoalarm not for now.

1 Like

Anyone experiencing issues with cloud coverage info? I noticed that it has tendency to change values from something reasonable to 0 and back. E.g. I see it being reported at level of 80% than jumps instantly to 0% for several minutes and wents back to ~80%. So this is not gradual fluctuation of claudines, but something wrongly reported, either by service of integration. I use this along with sun elevation to estimate light level to determine when to switch the light on/off… so such changes in particular situation get annoying :slight_smile:

This does not work… I checked Meteoalarm and I can see they provide some alarms for my area, yet these does not show in Weatherbit integration. So perhaps still something wrong with their API?

I can confirm this does also not work for me here in Denmark. Right now the Core Meteoalarm Integration returns a warning at my location, but WeatherBit does not. I did test it directly on their Swagger site with the same result.
Unfortunately there is nothing I can do from my site, as this seems broken at WeatherBit.

Thats pity… Hope they will be able to fix this…
In meantime I created simple rest sensor, that retrieves alarms stright from rss feed Meteoalarm provides. Perhaps in meantime someone will find it useful :slight_smile:

  - platform: rest
    resource: https://feeds.meteoalarm.org/feeds/meteoalarm-legacy-rss-poland
    name: meteoalarm
    value_template: >-
      {% for item_id in value_json.rss.channel.item %}
        {% if item_id.title == 'Dolnośląskie Province Świdnicki County' %}
          {% set list1 = item_id.description.split('Polish(pl-PL): ') %}
          {% set list2 = list1[1].split('English(en-GB)')%}
          {{ list2[0] }}
        {% endif %}
      {% endfor %}

Resource URL can be found here. it need to be legacy rss link specific to country.
In ilem_id.title there should be name of region/city specified, exactly as it appears in the rss feed. Note that it appears in the feed only if there is active alarm available for this region, so finding this out might require some patince :slight_smile: I have some temporary one spefied at this time, as I missed opportunity when it was available…
Finally important are parameters specified in split finction ( 'Polish(pl-PL): ’ and ‘English(en-GB)’ ) that indicate start and end of alert text in language of your choice… Polish in my case. Again you might need to look at actual feed to figure out what the proper values are.
Sensor returns alarm as its state and, obviously, if there is no alert it will return null string.

EDIT: Unfortunately it fails when the alert is longer than 255 characters :frowning: Need to figure out how to put alert into attribute.

EDIT 2: OK, I did a bit more digging into getting proper Meteoalarm data into sensors and here is what I come with:
sensor.meteoalarm_index reads data from rss feed (should be configured as described above). It returns as state index of specific region data inside the feed and as attributes returns full description of conditions and name of region:

sensor:
  - platform: rest
    resource: https://feeds.meteoalarm.org/feeds/meteoalarm-legacy-rss-poland
    name: meteoalarm_index
    value_template: >-
      {% for x in range(value_json.rss.channel.item | length) %}
        {% if value_json.rss.channel.item[x].title == 'Śląskie Province Katowice County' %}
          {{ x }}
        {% endif %}
      {% endfor %}
    json_attributes_path: "$.rss.channel.item[?(@.title=='Śląskie Province Katowice County')]"
    json_attributes:
      - title
      - description

Then sensor.meteoalarm_weather_alert returns as state Awareness Type (translated to text). As attributes it returns Alert (full, untruncated description), Title (name of area) and Awarness Level (description of alert severity).

template:
  - sensor:
      - name: Meteoalarm Weather Alert
        state: >
            {% set list1 = states.sensor.meteoalarm_index.attributes.description %}
            {% set list2 = list1.split('awt:') %}
            {% set list1 = list2[1].split(' level:') %}
            {% set awt = list1[0] | int %}
            {% if awt == 1 %} Wind
            {% elif awt == 2 %} Snow / Ice
            {% elif awt == 3 %} Thunderstorm
            {% elif awt == 4 %} Fog
            {% elif awt == 5 %} Extreme high temperature
            {% elif awt == 6 %} Extreme low temperature
            {% elif awt == 7 %} coastal event
            {% elif awt == 8 %} Forest fire
            {% elif awt == 9 %} Avalanches
            {% elif awt == 10 %} Rain
            {% elif awt == 11 %} Flood
            {% elif awt == 12 %} Rain-Flood
            {% else %} N/A
            {% endif %}
        attributes:
          alert: >
            {% set list1 = states.sensor.meteoalarm_index.attributes.description %}
            {% set list2 = list1.split('Polish(pl-PL): ') %}
            {% set list1 = list2[1].split('English(en-GB)') %}
            {{ list1[0] }}
          title: >
            {{ states.sensor.meteoalarm_index.attributes.title }}
          level: >
            {% set list1 = states.sensor.meteoalarm_index.attributes.description %}
            {% set list2 = list1.split('level:') %}
            {% set list1 = list2[1].split('\"') %}
            {% set level = list1[0] | int %}
            {% if level == 0 %} No data or invalid data
            {% elif level == 1 %} GREEN No particular awareness of the weather is required
            {% elif level == 2 %} YELLOW The weather is potentially dangerous. The weather phenomena that have been forecast are not unusual, but be attentive if you intend to practice activities exposed to meteorological risks
            {% elif level == 3 %} ORANGE The weather is dangerous. Unusual meteorological phenomena have been forecast. Damage and casualties are likely to happen
            {% elif level == 4 %} RED The weather is very dangerous. Exceptionally intense meteorological phenomena have been forecast. Major damage and accidents are likely, in many cases with threat to life and limb, over a wide area
            {% else %} N/A
            {% endif %}

Here is sample output:

Hi all,
I don’t know if it is a core update of 2022.80+ issue because it started to happen when I update to 2022.8 (now 2022.8.4). Whenever I reboot HA, the weatherbit integration is unable to load my settings. After an hour, maybe less, it is ok. Anyone experience this after a HA reboot/restart??

I have tried to reload the integration couple of times. No change.

2022-08-14_7-54-10

Error in log:

I can’t replicate this error. Just updated to 2022.8.4 and WeatherBit loads just fine. Could be a glitch on Weatherbits servers during startup. Try and go to Devices & Services, find the WeatherBit integration and click the the 3 dots in the lower right corner, then click reload, and see if it loads now.

click reload, and see if it loads now.

I have tried that.

yea. I think it maybe a server error, but it has been 2 days. Sometimes a reboot works and sometimes it doesn’t.

Just checked for the error code 429, and this is the response from WeatherBit

Yes, the HTTP 429 response means that your rate quota has been reached. You will either need to reduce your usage, or upgrade your API key to a plan that fits your usage.

Do you have this running for more than 1 location or have you increased the refresh rate? Try and disable it for a day, and then try again. If you use the standard intervals (5 min for sensor updates and 30 min for Forecast AND only have one instance), then you should not run in to these problems

Oh. I didn’t know I went over. I’ve keep all the default settings. I’ve just checked now and it is at 5mins and 30mins with only one instance.

I am not sure why you went over, but then try and set the sensor updates to 10 minutes, and let it run like that for a day and two. I don’t know however, when your counter is reset, so that you will receive data again - but if you are inactive for a day or so, it might work again.

I am not sure why you went over, but then try and set the sensor updates to 10 minutes, and let it run like that for a day and two.

Done. Thanks.

I think something may have happened in one of the latest updates. I’ve been using Weatherbit for some time now and all of a sudden after a recent update I am blowing through my daily limit of API calls. I checked earlier today and about 2 hours later I was now showing an additional 90+ calls. I was configured to query every 5 minutes, but at the time I checked 2 hours earlier I set it to 10 minutes. I only have home assistant using this API.

Is there a retry on error in the code? I was just looking in the logs and see it trying to query every 80 seconds. If there is a retry on error it should either be configurable or should just retry at the next interval. I’ve tried digging through the scripts and don’t see a retry, but I could be missing it.

Ok, so some more information. My 24 hour reset occurred and I’ve been able to watch the API counter to see what it is doing. For some reason the weatherbit integration is now polling 2 times at each 10 minute interval and 2 times on the 30 minute interval. This causes you to burn very quickly through your API count. At the defaults this ends up being 672 calls in a 24 hour period. I have mine bumped to 10 minutes which should keep things working for now, but it would be nice to be able to go back to the default 5 minute polling.

EDIT: The 30 minute interval is still only polling once as it should. The 5 minute default is polling 2 times.

Interesting analysis, thanks @Sinfonia97
I will do some debugging on this as soon as I have time, and see what really happens.