Maybe not the most efficient …
You do need the hourly sensor defined (mine is called sensor.forecast_kmi_hourly) and the time-slots are min 1 hour.
Below looks at the next 3 hours. If you just want 1 hour replace the 3 with 1
{% set begin = (now() + timedelta(hours=1)).strftime('%Y-%m-%d %H') %}
{% set end = (now() + timedelta(hours=3)).strftime('%Y-%m-%d %H') %}
{% set forecasts = state_attr('sensor.forecast_kmi_hourly', 'forecast') %}
{% set rain_forecasts = forecasts | selectattr('datetime', 'ge', begin) | selectattr('datetime', 'le', end) | selectattr('precipitation', 'gt', 0 ) | list %}
{% set total_rain = rain_forecasts | map(attribute='precipitation') | select('!=', 0) | map('float') | sum %}
{{ total_rain | round(2) }}
I really want to work with the data that comes in from the radar attribute. I need this to close my blinds a few minutes before it starts raining at an intensity above a certain threshold.
This is a temporary solution to avoid water coming into my bedroom. I still need to order new windows and there is a waiting period as well. This should help me a lot
This is the yaml code of the card config. You only need to update the sensor filter in the include (use a * instead of the “pollen type” in the sensor and it will select all sensors at once.
type: custom:flex-table-card
title: Pollen
entities:
include: sensor.xxx_*_level
columns:
- name: Type
data: friendly_name
align: center
modify: x.split(" ")[1];
- name: None
data: state
align: center
modify: |-
if (x == 'none')
'<ha-icon icon="mdi:flower-pollen">'
else
''
- name: Active
data: state
align: center
modify: |-
if (x == 'active')
'<ha-icon icon="mdi:flower-pollen">'
else
''
- name: Green
data: state
align: center
modify: |-
if (x == 'green')
'<ha-icon icon="mdi:flower-pollen">'
else
''
- name: Yellow
data: state
align: center
modify: |-
if (x == 'yellow')
'<ha-icon icon="mdi:flower-pollen">'
else
''
- name: Orange
data: state
align: center
modify: |-
if (x == 'orange')
'<ha-icon icon="mdi:flower-pollen">'
else
''
- name: Red
data: state
align: center
modify: |-
if (x == 'red')
'<ha-icon icon="mdi:flower-pollen">'
else
''
- name: Purple
data: state
align: center
modify: |-
if (x == 'purple')
'<ha-icon icon="mdi:flower-pollen">'
else
''
css:
tbody tr td:nth-child(4): 'background-color: green;'
tbody tr td:nth-child(5): 'background-color: yellow;'
tbody tr td:nth-child(6): 'background-color: orange;'
tbody tr td:nth-child(7): 'background-color: red;'
tbody tr td:nth-child(8): 'background-color: purple;'
I know layout isn’t very good, not my strong suit, so if anyone wants to give it a go to further optimize, be my guest, but do share your results though
Made a (for me) slightly better version where the width of the columns are a bit better, but dropped the column names for it (the colours say enough I guess):
The integration seems to have very detailed allergy information, radar entity and weather alarm.
To my surprise, this was the first integration which implemented the “twice daily” weather forecast, but the data is incorrect. Also the state of the weather entity is unknown instead of showing the condition.
Regardless of the few small bugs, it looks like a usefull integration and a good contribution to the guide. It’s not ideal to have a sample size of one, to I wanted to ask for your input as well. It is usefull? Accurate? Stable?
Hi,
I am the author of the integration. Thanks for your feedback!
I am a bit surprised about the two issues you have with the integration. Could you elaborate a bit more: what makes you say that the twice daily forecast is incorrect? The state of the integration should be showing the current weather condition. Could you share your configuration?
Bugs are possible but I try to fix them whenever I can reproduce them. Here is what the weather entity should look like (from the GitHub repository)
Please note that the zone you set for the forecast should be in Belgium, Netherlands or Luxembourg to work properly.
I might be a bit biased about the integration, so I’ll rather share why I think this integration was missing from the Home Assistant ecosystem: the data from the IRM KMI (the Belgian meteorological institute) was not yet available in HA and many people use their app in Belgium (1M+ downloads on the Play Store). They provide daily, hourly and very short term forecast which may be useful for automation.
If you have more questions to list this integration in your linked post, feel free to ask
Most issues I encountered during testing weather integrations were related to my location / IP address.
The remaining issues varied from “common” to “rare” but hardly ever unique to my setup.
Thanks! You just helped me realize that the original IRM KMI app does not show the current condition for the Netherlands either. See the screenshots of their app: for Brussels it shows the temperature and condition next to the city name (19° cloudy) but it only shows the temperature for Amsterdam.
I’ll fix the missing condition by taking the one for the current hour forecast (14h hourly forecast in my screenshot)
For the repeating days in the twice daily forecast, I’ll fix the logic.
I checked your guide for weather integrations and it is really complete, great job! You just made a small typo in the name of this integration (MRI KMI instead of IRM KMI at multiple places)
I’ll have a look at it later this week, but you are free to edit the post yourself to keep it correct and up to date. Everyone can edit guides and it is highly encouraged.
I cannot find the option to edit the guide: there is no pencil icon at the bottom of the post on my side. Here are the options I have at the bottom of your guide
I see that others managed to edit but there’s no button when I go there either. Maybe my account level is not high enough yet. Anyway, thanks for fixing the typo
Made another iteration of this. I wanted to only show the ones that are actually active. To do that I had to use the custom “Auto Entities Card” (which the “Flex Table Card” also supports) to filter out the sensors with state “none”, but it does result in a cleaner table:
Using the service weather.get_forecasts (Weather - Home Assistant) will return the forecast for the next days (or hours). Using templates like the one share just above may help you getting it in an attribute if this is what you are looking for.
The IRM/KMI open data is kind of frustrating to me: they either have really specific datasets open to the public or interesting datasets but not open to the public.
Example of the first kind is the Weather Model Alaro, which include this warning
[The charts] aren’t corrected or interpreted by the forecasters of the RMI. A correct interpretation of these charts requires some expertise.
Their non-public datasets include Hourly Commune Forecast, which seems perfect for this integration, but “This product is not publically available.”
They are probably selling their non-public data to paid customers, which makes sense as that data is their core business.
That’s why this integration is not using their open data, rather it uses the API of their mobile application. It has some limitations, but already provides good data points.