Weatherbit.io - Current Weather and Forecast data

Release 0.24

  • Language support for Wind Direction Text is now done in the IO Module, as Weatherbit did not handle 8Bit Characters very well. ENE which in danish is ØNØ, was translated to ONO. If I did not get this right for all Languages, please go here and add or change the relevant file. Mail it to me or make a PR.

  • Each weatherbit_forecast_day_x sensor now has an Attribute called cloudiness which shows the forecasted Cloud Cover in %.

  • Each weatherbit_forecast_day_x sensor now has an Attribute called snow which shows the forecasted accumulated snowfall for the day in either mm or inches.

  • A new sensor called weatherbit_snow is now added that shows the current snowfall in mm/hr or inches/hr.

  • Bumped weatherbitpypi to 0.23

1 Like

HI Bjarne,
looking forward to the changes to be, and thanks for the snow sensor :wink:
Please let me know where the translations for the weather text of the forecast cards are, since they have some peculiarities I think should be fixed. Partly cloudy should be improved to ‘Gedeeltelijk bewolkt’ eg.

since I dont see many other conditions now, I cant tell if the others need checking to. btw, is it correct these sensors don’t show a unit nor an icon? Maybe that’s an addition you could think of?

compare to:

Hi Marius,
The only translations that I can influence are those for the Wind Direction and for the Beaufort Text. The rest comes from the Weatherbit API directly, so I suggest you log it with them if the text they deliver is not correct. Maybe ask about the Visibility value which is always the same for all locations :sweat_smile:

got one for you:

attribution: Powered by Weatherbit.io
alerts:
  - city_name: Roosendaal
    title: Extreme High Temperature
    description: >-
      nederlands: Tijdens de volgende dagen bepaalt een droge en warme
      continentale luchtmassa ons weer. In het centrum van het land schommelen
      de maxima al boven 25 graden dinsdag, en rond of boven 30 graden van
      woensdag tot vrijdag.Zaterdag wordt het wat minder warm, maar
      waarschijnlijk liggen de maxima nog op of boven 25 graden in het centrum
      van het land.

      français: De l'air continental sec et tres chaud determinera notre temps
      durant les prochains jours. Dans le centre du pays, les maxima depasseront
      deja la barre des 25 degres ce mardi, puis seront de l'ordre de, ou
      superieurs a 30 degres de mercredi a vendredi.Samedi, les temperatures
      pourront quelque peu diminuer, mais resteront encore probablement egales
      ou legerement superieures a 25 degres sur le centre.
    severity: Advisory
    effective_local: '2020-06-23T12:25:00'
    expires_local: '2020-06-25T00:59:00'
    uri: 'https://www.meteoalarm.eu/fr_FR/0/0/BE002.html'
    regions:
      - 'Antwerpen / Anvers,BE'
friendly_name: Weatherbit Weather Alerts
icon: 'mdi:alert'

this tells us a few things:

Apparently weatherbit sets 2 languages, based on the thought I live in Antwerp region (which I do, but I live in the Netherlands…) Belgium has 2 official languages, Dutch and French, so this is kind of clever.
Still, it is incorrect. And it should also know that, since the city Roosendaal is correct :wink:

We could be able to set a country code, on which the integration could check the appropriate alerts?

As you can also see, it selects the meteoalarm.eu region (in French) for Belgium. This is noteworthy, since we have our ‘own’ region in my region, Noord-Brabant. As is used in the Meteoalarm integration:

  - platform: meteoalarm
    name: Meteoalarm Brabant
    country: 'NL'
    language: 'ne'
    province: 'Noord-Brabant'

all in all, not sure if there is anything you can do about this, and I might be forced to use the template as I do:

      weatherbit_alert:
        friendly_name: Weatherbit Alert
        value_template: >
          {{states('sensor.weatherbit_weather_alerts')|int > 0}}
        attribute_templates:
          Title: >
            {% if states('sensor.weatherbit_weather_alerts')|int > 0 %}
              {{state_attr('sensor.weatherbit_weather_alerts','alerts')[0].title}}
            {% else %} No alert
            {% endif %}
          City: >
            Weatherbit alert {{state_attr('sensor.weatherbit_weather_alerts','alerts')
                               [0].city_name}}
          Description: >
            {% if states('sensor.weatherbit_weather_alerts')|int > 0 %}
              {{state_attr('sensor.weatherbit_weather_alerts','alerts')
                [0].description.split('nederlands:')[1].split('français')[0]}}
            {% else %} No alert
            {% endif %}
          Severity: >
            {{state_attr('sensor.weatherbit_weather_alerts','alerts')[0].severity}}
          Effective: >
            {{as_timestamp(state_attr('sensor.weatherbit_weather_alerts','alerts')
              [0].effective_local)|timestamp_custom('%X %d %B')}}
          Expires: >
            {{as_timestamp(state_attr('sensor.weatherbit_weather_alerts','alerts')
              [0].expires_local)|timestamp_custom('%X %d %B')}}

please have a look and see if you can improve?

1 Like

Did more digging on the issue, and Weather Alerts are unfortunately NOT standard. It depends on where you live, who is the source of the Alerts, and thus the formatting is different from provider to provider. Just checked some alerts from the US, and they look completely different than the alerts you are getting. So unless I implement a different handler for each provider (And I have no clue how many they use at Weatherbit), there is not much I can do. So for now, I will leave it up to you, doing some nice templating :grin:

Release 0.25

  • Issue #19 - Added the following new Attributes to the Solar Ration Sensor:

    • dhi: Diffuse horizontal solar irradiance (W/m^2)
    • dni: Direct normal solar irradiance (W/m^2)
    • ghi: Global horizontal solar irradiance (W/m^2)
    • elev_angle: Solar elevation angle (degrees)
    • h_angle: Solar hour angle (degrees).
    • sunrise: The time of the next sunrise at location
    • sunset: The time of the next sunset at location

    They were added as Attributes here as they are closely linked to Solar Radiation, and I did not want to create more sensors for values that only a few people will use.

  • Added Polish translation for Integration and Options setup. If other people would like to contribute to the translation of the Integration Setup page, please go here and take a copy of the en.json file, edit the content and save under your language code. Upload the file to the directory and make a PR or send me the file, and I will add it.

  • Updated Dutch Language file for Wind Direction

  • Updated README.md to show how to disable Sensors if you don’t need them all.

  • Bumped weatherbitpypi to V0.24.1

1 Like

cool:

thank you very much for adding these, will now hopefully be able to see and illustrate a relation to the solar panel production.

Makes this integration unique on that account :wink:

Ok… no bells and whistles just yet, but for now it gets the job done fine:

  - type: conditional
    conditions:
      - entity: binary_sensor.weatherbit_alert
        state: 'on'
    card:
      type: markdown
#      style: |
#        ha-card {
#          box-shadow: none;
#        }
      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')}} </font>

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

1 Like

Hi Briis,

great job; I really like this component. I noticed the sensor: sensor.weatherbit_air_quality

Is it possible that we could also get all Air Quality sensors of weatherbit as there are:

   "data":[  
            {  
               "aqi":47,
               "o3":101.2,
               "so2":3.8594,
               "no2":5.42472,
               "co":251.9,
               "pm10":16,
               "pm25":11,
               "pollen_level_tree": 4,
               "pollen_level_grass": 2,
               "pollen_level_weed": 2,
               "mold_level": 0,
               "predominant_pollen_type": "Trees"

You are welcome. Glad it is useful for you.

The sensor.weatherbit_air_quality is pulled from the 16-days Forecast API, which is available for the Free Tier API users. If you want the remaining Air Quality Sensors you must have a paid API Key, which starts at 35 USD pr. month - and to get Air Quality you will have to pay 470 USD pr. month :cold_face: For that money, you could buy your own HW and pull the data locally.

I made a decision only to work with the Free data, as I honestly think 35 USD pr. month is very expensive and personally I would not spend that money. So the short answer is: No I have no plans in delivering that data as long as it is not free. Sorry.

Hi Briis,

thank you, that’s okay. I wasn’t aware you had to pay for it.

EDIT: Seems there’s a similar post above whilst I was trying it out !

Thanks for this, I just tried this in ARC with a free API key:

https://api.weatherbit.io/v2.0/current/airquality?postal_code=XXXX%20XXX&key=XXXXXXXXXXXXXXXXXXXXXXXXXXX

and got this, any chance of adding them ?

{
"data": [
  {
"mold_level": 1,
"aqi": 45,
"pm10": 24.0342,
"co": 276.208,
"o3": 98.3477,
"predominant_pollen_type": "Molds",
"so2": 2.78652,
"pollen_level_tree": 1,
"pollen_level_weed": 1,
"no2": 4.35906,
"pm25": 6.77281,
"pollen_level_grass": 1
}
],
"city_name": "E Riding of Yorkshire",
"lon": "-x.xxxx",
"timezone": "Europe/London",
"lat": "xx.xxxx",
"country_code": "GB",
"state_code": "ENG"
}

That is really strange. When I do this I get

{"error":"Your API Key does not allow access to this endpoint. Consider upgrading your API Key at https://www.weatherbit.io."}

And according to the Pricing Documentation it should also not be possible. Could anyone else try?

For me this works aswell:

https://api.weatherbit.io/v2.0/current/airquality?lat=XXXXX&lon=XXXXXX&key=XXX

returning

{“data”:[{“mold_level”:1,“aqi”:52,“pm10”:18.1653,“co”:287.89,“o3”:121.772,“predominant_pollen_type”:“Molds”,“so2”:0.923872,“pollen_level_tree”:1,“pollen_level_weed”:1,“no2”:3.0899,“pm25”:5.65494,“pollen_level_grass”:1}],“city_name”:“XXXXX”,“lon”:XXXX,“timezone”:“Europe/Amsterdam”,“lat”:XXXX,“country_code”:“NL”,“state_code”:“05”}

haha I get to see this:

{"data":[{"mold_level":null,"aqi":14,"pm10":1.62534,"co":480.652,"o3":30.8007,"predominant_pollen_type":null,"so2":0.141561,"pollen_level_tree":null,"pollen_level_weed":null,"no2":0.141074,"pm25":1.57529,"pollen_level_grass":null}],"city_name":"","lon":"-65.5139","timezone":"America\/Argentina\/Catamarca","lat":"-28.7833","country_code":"AR","state_code":"K"}

but must have filled out the postal code incorrectly, as I don’t live in Argentina…

how to use this field:

postal_code=XXXX%20XXX

?

1 Like

Try defining LAT and ION as I did

yep, that works:

{"data":[{"mold_level":1,"aqi":37,"pm10":27.4992,"co":304.997,"o3":79.2146,"predominant_pollen_type":"Molds","so2":1.73226,"pollen_level_tree":1,"pollen_level_weed":1,"no2":20.178,"pm25":6.0338,"pollen_level_grass":1}],"city_name":"Roosendaal","lon":redacted,"timezone":"Europe\/Amsterdam","lat":redacted,"country_code":"NL","state_code":"06"}

not sure if this weighs in against the polling threshold…

Lat and Lon works for me too

Not now I can’t but I’ve been playing with a few weather services recently and I am pretty sure one (maybe weatherbit) gives unlimited access to all endpoints for 30 days.

I did try the other ones and they would work with my API key, but not 5 day / 3 hour Forecast

That might be the reason why some of you can get the data, and I cannot. My key is a bit older than that. The only place Air Quality data is mentioned in the pricing sheet on Weatherbit.io is under the Advanced Option where you get access to:

Includes:

  • Daily forecasts
  • Current weather data
  • Hourly forecasts
  • Historical data (10 years)
  • Air Quality / Energy / Climate / Agweather API access
  • Commercial Use License