Weatherbit.io - Current Weather and Forecast data

Hi all,
Just keep the requests coming. If it is possible to get the data, and it makes sense to a broader audience, I am happy to add it.
Next thing up will be the Weather Alerts. Based on feedback it will be 1 extra sensor, with the data in Attribute Arrays, and the option in the config, to de-select this sensor.

Release 0.14

  • Added new sensor weather_icon holding the icon code for the current condition. Static icons, that works with this icon code, can be downloaded from this site.
  • Added Precipitaion Probability (precip_prop) as an attribute for each Forecast Day on the sensors and to the Weather Entity.
  • Added Weather Description (weather_text) as an attribute for each Forecast Day on the sensors.
  • Added Weather Icon Code (weather_icon) as an attribute for each Forecast Day on the sensors.
3 Likes

Thanks so much for adding that data, and for being open to requests. This is not really important, but should precip_prop be precip_prob?

You are right. Will fix that next release. Thx.

1 Like

Release 0.16 is out

  • Added Weather Alerts. If selected during config, there will now be a new sensor added, called weather_alerts. The state of the sensor shows the number of alerts for the selected location, and the Attributes hold the details for the alert. See the README.md file for an example on how to use this.
    • Update frequency for the Weather Alerts follows what you set for the Forecast - Default 30 min.
    • NOTE: You must remove the Integration and Re-Add it before given the option of adding the Weather Alerts sensor.

I have made a very basic example of how to use this in Lovelace, by modifying the code from @eggman and fitting it to the data that Weatherbit delivers for Alerts. I would be happy if someone could make a more beautiful example, as templating is not my strong side.

To get this to work, I had to make more changes to the core code than I hoped. My own testing does not uncover any errors, so hopefully it does not break anything for anyone else.

2 Likes

Fantastic work on the intergration so far. One request please, can you add an options button on the intergration page so that we can either enable or disable alerts. I cannot think of any other way of changing the setting apart from removing the intergration and addint it again.

Iā€™ve updated and see an alert. I donā€™t have much time to play with a markdown card today, but Iā€™ll see what I can come up with when I get some time.

I see you made the change from precip_prop to precip_prob, but itā€™s not mentioned in the release notes. I caught it because I asked for it, but it might catch others by surprise.

Thanks for all you hard work on this - itā€™s great!

Hi @Sibiu ,
I would like to give you the option of changing all the settings without having to delete and re-add, but currently I have not found a way to do that in Home Assistant. As long as you are not updating the code, you can do this, without restarting Home Assistant - so that is a plus.
And if it was not clear, there IS an option in the Setup page, where you can enable or disable alerts.

Yes, sorry, missed to document that. I do most of the coding early in the morning, so sometimes stuff like that slips. But glad you caught it. :smile:

1 Like

Iā€™ve been working on making the Dark Sky Weather card originally by Mark Frankland into a card customized for Weatherbit to my liking. This is what I have so far:

2020-06-06 Weatherbit card

Iā€™ve added the dewpoint (not thrilled with the mdi icon I have, but itā€™s the best I came up with) and changed/added a bunch of other things. Iā€™m pretty happy with it, especially since I am not a JS programmer and basically hacked my way through it. My thanks to @m.p.frankland for the original and to @DavidFW1960 - I used his BOM Weather card (adaptation of the same original card) to help me figure out some of the changes I wanted to make.

Iā€™m going to try to figure out how to put this on my GitHub so I can share itā€¦

1 Like

Hi @briis, I was thinking about something similar to using https://developers.home-assistant.io/docs/config_entries_options_flow_handler to trigger the setup configuration screen, but obviously I am new to HA so could be missing something

This clearly shows how much I did NOT read the documentation :smile: Thanks for spotting this, I will look in to this. If anyone has spotted a live example on when this has been used, please post it here. Seeing what others have done is a good way to learn.

This custom integration can be reconfigured ā€œon the flyā€ - https://github.com/bruxy70/Garbage-Collection - not sure if you can learn anything there.

Donā€™t worry about thinking you didnā€™t read the docs - I think ā€œon the flyā€ reconfiguration (as opposed to deleting - re-adding) is a new-ish thing, and certainly one the devs would like software authors to use.

PS HACS itself is reconfigurable on the fly, as is the favicon custom component.

PPS. an official integration that can be recofigured is the Harmony Hub.

1 Like

@briis Yesterday when I updated to the latest version of the integration, I had two weather alerts. Later in the day, it dropped to one, but my sensor still showed the old alerts. This morning, there are no alerts, but my sensor still shows the same two alerts from yesterday. So it doesnā€™t appear to be updating at allā€¦

OK, thanks. I will look in to that.

I belive I fixed it now. Update to 0.17 and restart Home Assistant.

Release 0.18 - Configuration Options

As @Sibiu asked for, this release introduces the possibility to change some of the Settings without having to delete and re-add the Integration.
With this release you can only change the Forecast and Current Data Update Intervals.

I am working on the possibility to add and remove the Sensors and Weather Alerts, dynamically, but currently I have only managed to Add sensors and not remove them, so I left this out for now.

No other changes. Just update the code and restart Home Assistant, and you should see a new menu item on the Weatherbit Integration Widget called Options.

1 Like

@briis

I believe your datetime for sensor.weatherbit_forecast_day_X is one day behind (or at least thatā€™s the case in the US).
In states I read today (06/08 - June 8th):

sensor.weatherbit_forecast_day_1 partlycloudy attribution:
datetime: 2020-06-07T20:01:00-04:00

BUT

weather.weatherbit_tolland partlycloudy
forecast: - datetime: ā€˜2020-06-08T04:01:00+00:00ā€™

(and thatā€™s the first forecast in the array -checked temperature etc. and it is your day_1 sensor).

Sorry for the bad formatting (lack thereof). First time posting here.

When I updated HA yesterday, it cleared out the old messages. No alerts at the moment - I will check on how it works now next time we get an alert.

The icon set I am using has a different icon for partly-cloudy-day and partly-cloudy-night. Is it possible for the integration to distinguish these in the same way it does for clear-day and clear-night?

Hi George
Would you mind sharing your city and country so that I can see whatā€™s going on? You can send me a personal message if you want
/B

Let me check how these icons would work on the standard weather card.

Not sure I know how to PM here. I am in Connecticut, USA. Weatherbit found my city from the HASS coordinates. If you need a city put Hartford, but thatā€™s not where I live.
I removed the integration and installed it again this morning and the problem persists.
Here is what my customization shows right now:

Unfortunately it is Monday here todayā€¦
Here is how I read days in Javascript (this is a standard horizontal stuck of templated custom card components).

      [[[  
        var d = new Date(entity.attributes.datetime);
        var nd = d.toLocaleDateString('en-US', { weekday: 'short' });
        return nd;
      ]]]

Then I checked the states in the developerā€™s tab on HASS and saw that the error is not mine. I think the time is wrong also (but I can live with that).

EDIT: the temperature and everything else is of today (Monday). It is only the datetime that is incorrect.