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.
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.
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.
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ā¦
This clearly shows how much I did NOT read the documentation 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.
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.
@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ā¦
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.
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):
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?
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.