Weatherbit.io - Current Weather and Forecast data

There is a 500 calls per day limit. So depending on your update frequency and number of active installations you could hit that roof. Fastest way to check is to paste the below in to a browser and see if you get an error:
https://api.weatherbit.io/v2.0/current?city=Amsterdam&key=API_KEY adding your own API instead of API_KEY

nice, thanks!
no errors yet, more info though: not all are translated in your integration (yet), some of the sun attributes there, and some I don’t understand the abbreviation yet…
ghi, dni, dhi (reading up now)
great tool.

looking forward to adding the new sensors! Maybe add Snow too?

On purpose I did not expose all values from the API, as I think most people would not ever use them, and there are already a lot of sensors created. For info here is the explanation of the abbrivations you saw:

  • dhi: Diffuse horizontal solar irradiance (W/m^2) [Clear Sky]
  • dni: Direct normal solar irradiance (W/m^2) [Clear Sky]
  • ghi: Global horizontal solar irradiance (W/m^2) [Clear Sky]
  • rh: Relative humidity (%).

I guess the first 3 of them make my point :sweat_smile:

I don’t know yet, but put it in Github as an issue, and I will look at it.

thanks! consider breaking out forecast sensors · Issue #16 · briis/weatherbit · GitHub
no worry, no hurry…

1 Like

Release 0.22

  • Added two Beaufort Sensors, one with the Beaufort Scale Value weatherbit_beaufort_value and one with the textual representation of that value weatherbit_beaufort_text. Default the text is in english but if you set the Forecast Language as described in release 0.21, then this text will also be translated. Not all Weatherbit languages are supported yet, but if you are missing a language go here and take on of the files, and make your translation to your language. Either make a PR or send me the file. The same goes if you find errors in any of the translations.

The following languages are currently supported for Beaufort Text:

  • en - English
  • da - Danish
  • de - German
  • fr - French
  • es - Spanish
  • it - Italian
  • nb - Norwegian Bokmål
  • nl - Dutch
  • sv - Swedish

another feature request… based on trying to template the alert:

could you split the actual description to follow the desired language?Or have it set per language? I now have to do this:

  - platform: template
    sensors:
      weatherbit_alert:
        friendly_name_template: >
          Weatherbit alert {{state_attr('sensor.weatherbit_weather_alerts','alerts')[0].city_name}}
        value_template: >
          {{state_attr('sensor.weatherbit_weather_alerts','alerts')[0].title}}
        attribute_templates:
          alert: >
            {{state_attr('sensor.weatherbit_weather_alerts','alerts')[0].description.split('nederlands:')[1].split('français')[0]}}

or binary_sensor even better:

binary_sensor:

  - platform: template
    sensors:

      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 %}
        device_class: safety

to get the dutch text description… it works, but is rather complicated :wink:

I am wondering how I can receive the forecast of the max temperature from today and tomorrow?

Here are the sensors that retrieves some info about forecast from overal forecast sensor (not individual ones):

sensor:
  - platform: template
    sensors:
      temp_max_0:
        friendly_name: 'Temerature Forecast max 0'
        value_template: "{{ state_attr('weather.weatherbit_zielonka', 'forecast')[0].temperature }}"
        unit_of_measurement: '°C'
      temp_min_0:
        friendly_name: 'Temerature Forecast min 0'
        value_template: "{{ state_attr('weather.weatherbit_zielonka', 'forecast')[0].templow }}"
        unit_of_measurement: '°C'
      condition_0:
        friendly_name: 'Condition Forecast 0'
        value_template: "{{ state_attr('weather.weatherbit_zielonka', 'forecast')[0].condition }}"
        icon_template: >
          {% set stat = state_attr('weather.weatherbit_zielonka', 'forecast')[0].condition %}
          {% if stat == 'clear-night' %} mdi:weather-night
          {% elif stat == 'cloudy' %} mdi:weather-cloudy
          {% elif stat == 'exceptional' %} mdi:weather-sunny-alert
          {% elif stat == 'fog' %} mdi:weather-fog
          {% elif stat == 'hail' %} mdi:weather-hail
          {% elif stat == 'lightning' %} mdi:weather-lightning
          {% elif stat == 'lightning-rainy' %} mdi:weather-lightning-rainy
          {% elif stat == 'partlycloudy' %} mdi:weather-partly-cloudy
          {% elif stat == 'pouring' %} mdi:weather-pouring
          {% elif stat == 'rainy' %} mdi:weather-rainy
          {% elif stat == 'snowy' %} mdi:weather-snowy
          {% elif stat == 'snowy-rainy' %} mdi:weather-snowy-rainy
          {% elif stat == 'sunny' %} mdi:weather-sunny
          {% elif stat == 'windy' %} mdi:weather-windy
          {% elif stat == 'windy-variant' %} mdi:weather-windy-variant
          {% else %} mdi:cloud-question
          {% endif %}
      precip_0:
        friendly_name: 'Precipitation Forecast 0'
        value_template: "{{ state_attr('weather.weatherbit_zielonka', 'forecast')[0].precipitation }}"
        unit_of_measurement: 'mm'

You can easily create similar sensor for consequtive days just replacing index _0 or [0] - representing today to _1 or [1] for tomorrow and so on. Also it should be easy to create sensors for other conditions, just replacing, for example, .templow to other attribute.
BT. somehow complex sensor for confdition deals with clear night icon issue, setting proper mdi icon for sensor.

Hello. I installed HA on to a RPI3 a few days. Still learning how to navigate/use HA. I cannot find Weatherbit in the add-on store. The Weatherbit instruction says this integration is part of the default HACS store. Do I need to first install HACS store prior using these steps?

Welcome to the HA Community! Yes, you need to install HACS, and then you can add the Weatherbit custom component through the HACS store.

I am not completely sure what it is you want me to do?
I understand your Yaml Template, but you could you give me an example of the data, so that I can see what the issue is.

Thanks for the integration!

Does Weatherbit.io have a place to test their API? I’m used to fairly inaccurate weather forecasts for my area (Pretoria, South Africa), so want to give it a brief check before installing it into Home Assistant.

Yes and no. :slightly_smiling_face:
You will need to get a free API Key, and then you can go to Weatherbit.io site and get the commands for retrieving data for a specific position or city. You will get raw JSON Formatted data, and not a nice UI.

The API’s used in this Integration are:

You could also just install it, if it is not accurate, just remove it again. It cleans up after itself.

should have thought about that while the alert was active… it has calmed now, and I cant give you anything now, will post if and when arising. sorry.

1 Like

Hi Bjarne,

I do have another issue though, and that is more than once the integration doesnt load a startup, and shows all unknowns.
Ive added my local url (as you suggested earlier) to the hold_action of my card header, so to easily check if there’s anything wrong with my api, and they show just fine, all day is there.

{"data":[{"rh":62,"pod":"d","lon":redacted,"pres":1011.18,"timezone":"Europe\/Amsterdam","ob_time":"2020-06-18 10:15","country_code":"NL","clouds":100,"ts":1592475354,"solar_rad":221.908,"state_code":"07","city_name":"Amsterdam","wind_spd":3.82574,"last_ob_time":"2020-06-18T10:01:00","wind_cdir_full":"south-southwest","wind_cdir":"SSW","slp":1010.99,"vis":22.3716,"h_angle":-20,"sunset":"20:05","dni":898.38,"dewpt":12.2,"snow":0,"uv":2.57197,"precip":0,"wind_dir":210,"sunrise":"03:17","ghi":887.63,"dhi":118.11,"aqi":49,"lat":redacted,"weather":{"icon":"c04d","code":"804","description":"Overcast clouds"},"datetime":"2020-06-18:10","temp":19.8,"station":"AV169","elev_angle":55.12,"app_temp":19.5}],"count":1}

what else could be wrong, preventing the integration from loading correctly?

Unexpected error fetching weatherbit data: Error requesting data from forecast/daily?lat=redacted&lon=redacted&lang=nl&units=M&key=redacted: 500, message='Internal Server Error', url='https://api.weatherbit.io/v2.0/forecast/daily?

Hi
Nothing wrong at your site or with the Integration - I got the same error, and it was Weatherbit that had some issues for the last 30 minutes or so. If you restart now it should be working again.

I need to look at implementing some kind of retry if we get this error.

ok cool.

yeah retry would be nice. better than restart

also, maybe add some alert the remote server is unavailable? (could even be a binary_sensor)
btw, still no server weatherbit connection here…

Unexpected error fetching weatherbit data: 'ClientConnectorError' object has no attribute 'message'
Traceback (most recent call last):

Thanks, I did discover that with your key you can go to https://www.weatherbit.io/api/swaggerui/weather-api-v2 to test out the API.

But I also installed your custom component and it is looking really good!! Slightly different values than Dark Sky, so we’ll see who’s more accurate. Their low temperature was already a bit more accurate than Dark Sky (I measure temperature outside my house too).

Any chance you can add cloud coverage to the forecasted values? I have PV panels and can use the data.

Sure thing. I’ll add it on the to-do list

1 Like