Belgium weather provider: IRM / KMI (meteo.be)

I couldn’t do this with a call service but I managed to make it work by using the “API” node.
Thanks for leading me in the right direction.

For those interested:

[{“id”:“44be6abe51315453”,“type”:“ha-api”,“z”:“777f7153b5872de3”,“name”:“”,“server”:“d02ea838.224ec8”,“version”:1,“debugenabled”:false,“protocol”:“websocket”,“method”:“get”,“path”:“”,“data”:" {\t "type": "execute_script",\t "sequence": [\t {\t "service": "weather.get_forecasts",\t "data": {\t "type": "hourly"\t },\t "target": {\t "entity_id": [\t "weather.thuis"\t ]\t },\t "response_variable": "service_result"\t },\t {\t "stop": "done",\t "response_variable": "service_result"\t }\t ]\t}“,“dataType”:“jsonata”,“responseType”:“json”,“outputProperties”:[{“property”:“payload”,“propertyType”:“msg”,“value”:”",“valueType”:“results”}],“x”:610,“y”:820,“wires”:[[“c9f5d92ea706558d”]]},{“id”:“d02ea838.224ec8”,“type”:“server”,“name”:“Home Assistant”,“addon”:true}]

1 Like

not found in hacs integration … release 2023.12.4

It is not in HACS by default. You have to add repository of the integration in your custom repositories using HACS.

To do so, go to HACS on your Home Assistant instance, then select “Integrations”. In the top right, you have the three dots menu: select “custom repositories”. Add https://github.com/jdejaegh/irm-kmi-ha for the URL and “Integration” for the type

very nice integration, and for the Belgian users a lot more accurate than the Dutch ‘buienradar’. The installation went perfect.

One question:

when I go to the weather entity and ask the history, it shows the cloudy, fog, sunny, …

Is it possible to have the temperature in the history instead of the weather condition ?

Thanks for the cool integration!
After installing using HACS (and restarting Home Assistant), when I try to add the integration, it first says “Please wait, starting configuration wizard for irm_kmi” and then after a while I get this error:
image
Any clue why?

@FrankDC: glad you find this useful.

The weather entity will always have the weather condition as state so this is what will be saved to your history. However, you can create a new template sensor for the attribute you want to have in your history (e.g. temperature).

One way is to do the following: go to Settings > Devices & services > Helpers (on top ribbon) > Create Helper (bottom right) > Template > Template a sensor. There you can create a new sensor to get your temperature (see the screenshot). This will add an entity called sensor.home_temperature and its history will be saved. Repeat this for every other attribute you want to have in your history.

Credit to How to get temperature from a template - #2 by Brett_C for the idea.

I could have created many such sensors in the integration, but it adds many sensors that are not always useful. With the template, you can create whatever sensor you want or need.

@quizzical I don’t have any clue about this one, sorry. From the screenshot, it seems like an internal error of Home Assistant (this is not code I wrote). I never encountered this error during development and testing. Seems similar to Error when starting HACS intergration Reolink.

Could you provide a bit more insights?

  • What kind of Home Assistant setup do you run? OS, supervised, container, other?
  • Do you have logs of this error?
  • What version of Home Assistant and the integration are you running?
  • What are the steps to reproduce the error?

Thanks for the insights on my error.
I tried multiple times and had the error every time. This morning however when I tried again everything worked fine.
So probably it has nothing to do with your custom integration…
Case closed :⁠-⁠)
(I run the full home assistant stack on a virtual machine, using the latest version of home assistant and your integration. To produce the error I installed first trough hacs and then when trying to add it in the integrations section I got the error. But all fine now.)

1 Like

Your code doesn’t work, I’m pretty sure because the forum transformed some elements (you can paste it as code to avoid this). I managed to reconstruct your code (which is very useful thanks!). Here it is:

[{"id":"1ca3b8275e453020","type":"ha-api","z":"34843a6c.50d986","name":"naam","server":"5c29d263.09d2ac","version":1,"debugenabled":false,"protocol":"websocket","method":"get","path":"","data":"{\t   \"type\": \"execute_script\",\t   \"sequence\": [\t       {\t           \"service\": \"weather.get_forecasts\",\t           \"data\": {\"type\": \"hourly\"},\t           \"target\": {\t               \"entity_id\": [\"weather.huis_2\"]\t           },\t           \"response_variable\": \"service_result\"\t       },\t       {\t           \"stop\": \"done\",\t           \"response_variable\": \"service_result\"\t       }\t   ]\t}","dataType":"jsonata","responseType":"json","outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"results"}],"x":1330,"y":5780,"wires":[["15905ee7b853e1e6"]]},{"id":"a09ab2afbf59d121","type":"inject","z":"34843a6c.50d986","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":1200,"y":5780,"wires":[["1ca3b8275e453020"]]},{"id":"15905ee7b853e1e6","type":"debug","z":"34843a6c.50d986","name":"debug 105","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1470,"y":5780,"wires":[]},{"id":"5c29d263.09d2ac","type":"server","name":"Home Assistant","version":5,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":false,"cacheJson":true,"heartbeat":false,"heartbeatInterval":30,"areaSelector":"friendlyName","deviceSelector":"friendlyName","entitySelector":"friendlyName","statusSeparator":"at: ","statusYear":"hidden","statusMonth":"short","statusDay":"numeric","statusHourCycle":"h23","statusTimeFormat":"h:m","enableGlobalContextStore":true}]

You did a great work, thank you! Considering the current weather, I think it would maybe be more accurate to place this icon into the “partlycloudy” category.

image

Thanks for trying the integration!

Regarding the current weather, in the early versions of the integration, this icon was mapped to partly_cloudy. I changed it to sunny for the following reasons:

  • The weather outside, when this icon is in the IRM app, was mainly sunny: the only clouds were very light at high altitudes (you had to look for them to notice them)
  • The forecast text in the app, when this icon is shown for a future day, generally mentions a sunny day

Overall, I feel like the current categories represent quite well the outside weather. I agree that the categories are a bit subjective and they may change in the future if there is a general consensus for an update

Hello,
it works like a charm, thanks.

Hi thanks a lot for the integration!
I’m really glad you did it as the IRM/KMI is really sharp in its forecast in Belgium…

I have a question, what card do you use to display the radar and rain information?

Thx!

1 Like

Thank you so much! It was really missing!
Just wondering: why not adding humidity?
Actually, it is more about precipitation chance and quantity. I don’t see these data in the UI (HA card). They appear however on the custom card when the ‘forecast in attribute’ option is selected. So the problem seems to be with the HA card: the entity allows to get plenty of forecast info, but the official card does not display them.

1 Like

picture-glance, and select the live view.

1 Like

For those using the custom card, you can edit it (at /homeassistant/www/community/weather-card/weather-card.js once installed) and replace the line 264 from:

<div class="day">

to:

<div class="day" title="${daily.text}">

You then get (after flushing your cache) the text of the daily forecast in a tooltip (hoover over the day column):
image

It’s not perfect, as it is not accessible to screen readers and not mobile-friendly (in short, only for your computer’s browser). And It will disappear at the next card update (but no release for more than 3 years).
Still somehow useful in the meantime.

Another option is to use the Picture entity card. On the dashboard it will show a still radar image for the current time and when clicked, it will play the animation.

1 Like

Indeed, humidity is not in the app, only precipitation probability. The default weather card for the dashboard does not show a lot of data.

There are other cards that can be used to show the weather. Here are the ones I know (thanks to people here and on Github). Most custom cards for weather should work with this integration as I followed Home Assistant documentation when writing code. If you have issues with a custom card, I can have a look to see if I can make the integration work with it

Thanks @jdejaegh! I was frustrated not to be able to use the forecast info, so I made up a markdown card in the meantime, to get most of it:
image

Code for those interested (use the option to have the forecast in an attribute in the config):

{% if is_state('binary_sensor.weather_warning_HOME','on') %}
  <ha-alert alert-type="warning">{{ states.binary_sensor.weather_warning_HOME.attributes.active_warnings_friendly_names }}</ha-alert>
{% endif %}
{% for fc in states.weather.HOME.attributes.forecast -%}
  {% set temp = ("|" ~ fc.temperature | int ~ "°" ~ " ") if fc.temperature is not none else "" %}
  <ha-icon icon="mdi:weather-{{ fc.condition | replace("partlycloudy","partly-cloudy") }}"></ha-icon> {{ "**" ~ as_timestamp(fc.datetime) | timestamp_custom("%d/%m",true) ~ 
  "** : " ~ fc.templow | int ~ "°" ~ temp }} <ha-icon icon="mdi:weather-rainy"></ha-icon>{{ fc.precipitation | int ~ states.weather.HOME.attributes.precipitation_unit ~ 
  " " }}<ha-icon icon="mdi:water-percent"></ha-icon>{{ fc.precipitation_probability ~ "%" ~ 
  " " }} <ha-icon icon="mdi:weather-windy"></ha-icon>{{ fc.wind_speed | int ~ states.weather.HOME.attributes.wind_speed_unit ~ 
  " "}}<ha-icon icon="mdi:compass-rose"></ha-icon>{{ fc.wind_bearing | replace("W","O") }}
  {{ fc.text ~ " " }}  
  ***
{%- endfor %}

Just replace HOME with your entity. Note the replace() filter, used to simply translate West in Ouest for French. To be adapted to NL if needed (replace("E","O") | replace("S","Z"), I guess).
It should also show at the top the weather warnings, if any (not tested, waiting for one).

2 Likes

This one is really great, I recommend:

1 Like

I just released a new version (0.2.6), adding support for pollen level monitoring. Each sensor reports the same value as in the IRM KMI app.

For example, this data in the app translates directly into the sensor values in Home Assistant.

image

3 Likes