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

Hello,

Home Assistant is fairly new for me so i’m struggling with what I want to make and I’m not even sure if it would work with this integration.

We have around 7 screens/blinds around the house. Is there a way to create an automation that will open the blinds if there is rain expected within 15 minutes for example?

If it will start to rain within 15 minutes, it will trigger an automation to check if the blinds are closed or not. If they are closed, it will open them so that they don’t get wet.

Is it possible with this integration?

I monitored the “Volgende Waarschuwing/Next_warning” entity because I thought this would give me the value rain/snow/… But this is on a “unkown” state since I installed this integration 3 days ago.

Thanks!

@jdejaegh is this possible with your integration?

I am trying to make a sensor to display the amount of rain which fall today.
Any idea how to do this?

I tried some templates, but without succes

Hi,

That is expected: the warnings are for more extreme weather events like strong wind, heavy rainfall, thunder and so on. This is not meant to show when usual rain will fall.

What follows is not an automation, but a template sensor for the amount of rain expected in the next 20–30 minutes. From that, you should have a good starting point for your automation (monitor state change of this sensor, write your logic for the blinds).

Adding this in your configuration.yml file will create a new template sensor. This sensor will be updated every 10 minutes, on Home Assistant boot and whenever the weather state changes. It will fetch rain forecast from the radar and sum the forecast for the 3 next 10-minutes intervals. Note that the first interval will always be the current 10-minutes (e.g. at 11:01, the first interval will be 11:00 to 11:10).

template:
  - trigger:
      - platform: state
        entity_id: weather.home
      - platform: homeassistant
        event: start
      - platform: time_pattern
        minutes: 10
    action:
      - service: irm_kmi.get_forecasts_radar
        data:
          include_past_forecasts: false
        target:
          entity_id: weather.home
        response_variable: response
    sensor:
      - name: Rain in the next 20 minutes
        unique_id: rain_20_minutes_template
        state: "{{ response['weather.home'][:3] | map(attribute='native_precipitation') | sum }}"
        unit_of_measurement: mm

Make sure that weather.home is replaced with your actual IRM / KIM weather entity.

Hope this helps :slight_smile:

1 Like

Assuming your weather entity is weather.home, I would go with this. It gets the amount of rain from the daily forecast for today.

template:
  - trigger:
      - platform: state
        entity_id: weather.home
      - platform: homeassistant
        event: start
    action:
      - service: weather.get_forecasts
        data:
          type: daily
        target:
          entity_id: weather.home
        response_variable: response
    sensor:
      - name: Rain today
        unique_id: rain_today
        state: "{{ response['weather.home'].forecast[0].get('precipitation') }}"
        unit_of_measurement: mm
1 Like

Looks perfect! Thanks for the extra info!

I’ve been playing with what I’ve read here to get the forecast temperature of today. I’m close, but I can’t seem to figure out what I’m doing wrong.

I’ve added this to my configuration.yaml:

template:
  - trigger:
      - platform: state
        entity_id: weather.mystreet
      - platform: homeassistant
        event: start
    action:
      - service: weather.get_forecasts
        data:
          type: daily
        target:
          entity_id: weather.mystreet
        response_variable: response
    sensor:
      - name: Temperature today
        unique_id: temperature_today
        state: "{{ response['weather.mystreet'].forecast[0].temperature }}"
        unit_of_measurement: °C

I’m really trying to understand what it does:

  • The triggers are when my entity changes state or when HA starts
  • The service references to what I can find here, I use the type daily and the returned data goes into the variable response
  • Lastly I create a sensor with id temperature_today with the temperature value of the first forecast

This all seems correct with my current knowledge, I just can’t figure out what I’m doing wrong. I see the sensor.temperature_today in my HA, but the state is unknown.

Anyone with a little push in the right direction?

Depending on what time you get the forecast there is no max temperature available for the current day. Actually I’m struggling with the same issue.

It’s native to the KMI app. If you check in the evening you can see the night (min) temperature, but the max from the current day is gone. If you check during the day a max and min for the current day will be available.

That explains! At least I’ve learned how it works now. :grinning:

Wow, amazing work on this integration, props!

Everything works great, loving the custom pollen card made in this thread.

One quesiton though, is it possible to have the radar map without he graph underneath it?

Welcome to the forum!
Yes:

camera_view: live
type: picture-glance
entities: []
camera_image: camera.radar_home

Using this as an example, I keep getting this:

If I empty the cache, the picture is displayed properly. But if I go to another dashboard and come back, the picture disappear again.
I’m using the latest version of the integration, HA and Safari. I don’t have the problem with e.g. Chrome.
Any idea what the problem can be?
Thanks

Yes: Safari.

So many thanks for this card with allergens based on Belgian IRM weather integration. This works great for me.
I’ve polished a bit for my own needs :

  • I’ve dded the possibility to add a translation for the allergens. In first column (I renamed as Allergens), I’ve added a Javascript function using a table with English and French name for the allergens. Of course, french names can be changed by Ducth or German names. Set Translate=0 or 1 in the Javascript function to disable/enable the translation.
    You may have to change x.split(" “)[2] to x.split(” ")[1] ([2] on my case because my sensor name used an _ in the prefix name.
  • Despite the CSS at the end using column width, the column width was random in my case. So, I’ve set a small width but added an invisible icon ‘mdi:void’ in each column by default.
  • name: “” was retruning “undifined” in the column name. So I added a space as " "
  • Just added a sort by allergen name in auto-entities card (work only with English names)
  • In my case, I prefer to see all allergens even if they are not yet monitored. Remove my comment and let just ‘none’ in the exclude: -state: none for the auto-entities card if you prefer a minimalist table s suggested by Bollewolle.

Please note I’m not a specialist of YAML, Jinja2 neither Javascript but ChatGPT was a great mentor on these matters :wink:

type: custom:auto-entities
filter:
  include:
    - entity_id: sensor.myhome_gerpinnes_*_level
  exclude:
    - state: "put here none to get only the raw with monitored allergens"
sort:
  method: name
  reverse: false
  ignore_case: true
card:
  type: custom:flex-table-card
  title: Pollen
  columns:
    - name: Type
      data: friendly_name
      align: center
      modify: '(() => {
  const Translate = 0; // Mettre à 0 pour désactiver la traduction

  const translations = {
    "Oak": "Chêne",
    "Alder": "Aulne",
    "Grass": "Herbe",
    "Birch": "Bouleau",
    "Hazel": "Noisetier",
    "Mugwort": "Armoise",
    "Ash": "Frêne"
  };

  const allergen = x.split(" ")[2];
  return Translate ? (translations[allergen] || allergen) : allergen; 
})()'
    - name: "  "
      data: state
      align: center
      modify: |-
        if (x == 'active')
          '<ha-icon icon="mdi:flower-pollen">'
        else
          ''
    - name: "   "
      data: state
      align: center
      modify: |-
        if (x == 'green')
          '<ha-icon icon="mdi:flower-pollen">'
        else
          ''
    - name: "   "
      data: state
      align: center
      modify: |-
        if (x == 'yellow')
          '<ha-icon icon="mdi:flower-pollen">'
        else
          ''
    - name: ....
      data: state
      align: center
      modify: |-
        if (x == 'orange')
          '<ha-icon icon="mdi:flower-pollen">'
        else
          '     '
    - name: "   "
      data: state
      align: center
      modify: |-
        if (x == 'red')
          '<ha-icon icon="mdi:flower-pollen">'
        else
          ''
    - name: "  "
      data: state
      align: center
      modify: |-
        if (x == 'purple')
          '<ha-icon icon="mdi:flower-pollen">'
        else
          ''
  css:
    tbody tr td:nth-child(1): "width: 16px"
    tbody tr td:nth-child(2): "width: 16px"
    tbody tr td:nth-child(3): "background-color: green; width: 16px"
    tbody tr td:nth-child(4): "background-color: yellow; width: 16px"
    tbody tr td:nth-child(5): "background-color: orange; width: 1px"
    tbody tr td:nth-child(6): "background-color: red; width: 16px"
    tbody tr td:nth-child(7): "background-color: purple; width: 16px"

2025-01-29_17-02-50
2025-01-29_17-02-21

1 Like

Pollen level was broken for a few weeks (would always say ‘active’ no matter the level) because the IRM changed the way it is displayed in the application. I just released the version 0.2.26, which fixes the issue.

1 Like

I got the notification for the integration update and applied it.
Thanks so much for your nice job.

1 Like

Loving it, thanks!!! Applied this one as well for myself :slight_smile:

I did change a few things because I initially couldn’t get it to run. I thought it was perhaps due to some syntax error so tried changing it into a function and calling the function. Eventually it turned out that my label from the KMI integration was just different, so had to use a different array (x.split(" “)[1] instead of x.split(” ")[2]), which actually made your version working just perfectly :man_facepalming:

Anyway, thought I’d share it anyway, added some more comments for myself if I ever have to update it again later (know thyself :slight_smile: )

type: custom:auto-entities
filter:
  include:
    - entity_id: sensor.ev04_*_level
  exclude:
    - state: put here none to get only the raw with monitored allergens
sort:
  method: name
  reverse: false
  ignore_case: true
card:
  type: custom:flex-table-card
  title: Pollen
  columns:
    - name: Type
      data: friendly_name
      align: center
      modify: |-
        function getTranslations(pollentype) {
          const Translate = 1; // Set to 1 to apply translation table, set 0 to use originals

          // Add your wanted translations here
          const translations = {
            "Oak": "Eik",
            "Alder": "Els",
            "Grass": "Gras",
            "Birch": "Berk",
            "Hazel": "Notelaar",
            "Mugwort": "Bijvoet",
            "Ash": "Es"
          };

          // if Translate is turned on then retrieve the translation, othwerise use the original value
          return Translate ? (translations[pollentype] || pollentype) : pollentype;
        } 
        // note that depending on your setup a different item of the array might need to be set (e.g. [2] instead of [1])
        var pollen = x.split(" ")[1];
        // call the translation function
        getTranslations(pollen); 
    - name: "  "
      data: state
      align: center
      modify: |-
        if (x == 'active')
          '<ha-icon icon="mdi:flower-pollen">'
        else
          ''
    - name: "   "
      data: state
      align: center
      modify: |-
        if (x == 'green')
          '<ha-icon icon="mdi:flower-pollen">'
        else
          ''
    - name: "   "
      data: state
      align: center
      modify: |-
        if (x == 'yellow')
          '<ha-icon icon="mdi:flower-pollen">'
        else
          ''
    - name: ....
      data: state
      align: center
      modify: |-
        if (x == 'orange')
          '<ha-icon icon="mdi:flower-pollen">'
        else
          '     '
    - name: "   "
      data: state
      align: center
      modify: |-
        if (x == 'red')
          '<ha-icon icon="mdi:flower-pollen">'
        else
          ''
    - name: "  "
      data: state
      align: center
      modify: |-
        if (x == 'purple')
          '<ha-icon icon="mdi:flower-pollen">'
        else
          ''
  css:
    tbody tr td:nth-child(1): "width: 16px"
    tbody tr td:nth-child(2): "width: 16px"
    tbody tr td:nth-child(3): "background-color: green; width: 16px"
    tbody tr td:nth-child(4): "background-color: yellow; width: 16px"
    tbody tr td:nth-child(5): "background-color: orange; width: 1px"
    tbody tr td:nth-child(6): "background-color: red; width: 16px"
    tbody tr td:nth-child(7): "background-color: purple; width: 16px"

Thanks Bollewolle,
Your Javascript is more robust.

Indeed, the x;split is (x.split(" “)[2] for my case because my entity name prefix held already an underscore.

Here is still another variation with only cosmetic changes :slight_smile:

  • use lighter colors for cells
  • use various circle icons to give the idea of a grading severity.

Here is the code and the resulting imaging :slight_smile:

  • One with the full table (including all allergens even those not yet season monitored).
    Use
    exclude:
    – state: replace here by none to get only the raw with monitored allergens

2025-02-04_17-11-02

  • One with the summary table (including only with allergens that are season monitored).
    Use
    exclude:
    – state: none

2025-02-04_17-11-32

Here is the card :

type: custom:auto-entities
filter:
  include:
    - entity_id: sensor.myhome_gerpinnes_*_level
  exclude:
    - state: put here none to get only the raw with monitored allergens
sort:
  method: name
  reverse: false
  ignore_case: true
card:
  type: custom:flex-table-card
  title: null
  columns:
    - name: Allergène
      data: friendly_name
      align: center
      modify: >-
        function getTranslations(pollentype) {
          const Translate = 1; // Set to 1 to apply translation table, set 0 to use originals

          // Add your wanted translations here
          const translations = {
            "Oak": "Chêne",
            "Alder": "Aulne",
            "Grass": "Graminée",
            "Birch": "Bouleau",
            "Hazel": "Noisetier",
            "Mugwort": "Armoise",
            "Ash": "Frêne"
          };

          // if Translate is turned on then retrieve the translation, othwerise use the original value
          return Translate ? (translations[pollentype] || pollentype) : pollentype;
        } 

        // note that depending on your setup a different item of the array might
        need to be set (e.g. [2] instead of [1])

        var pollen = x.split(" ")[2];

        // call the translation function

        getTranslations(pollen);          
    - name: Saison
      data: state
      align: center
      modify: |-
        if (x == 'none')
          '<ha-icon icon="mdi:void">'
        else
          '<ha-icon icon="mdi:eye-check-outline">'
    - name: <ha-icon icon="mdi:circle-outline">
      data: state
      align: center
      modify: |-
        if (x == 'green')
          '<ha-icon icon="mdi:flower-pollen">'
        else
          '<ha-icon icon="mdi:void">'
    - name: <ha-icon icon="mdi:circle-slice-2">
      data: state
      align: center
      modify: |-
        if (x == 'yellow')
          '<ha-icon icon="mdi:flower-pollen">'
        else
          '<ha-icon icon="mdi:void">'
    - name: <ha-icon icon="mdi:circle-slice-4">
      data: state
      align: center
      modify: |-
        if (x == 'orange')
          '<ha-icon icon="mdi:flower-pollen">'
        else
          '<ha-icon icon="mdi:void">'
    - name: <ha-icon icon="mdi:circle-slice-6">
      data: state
      align: center
      modify: |-
        if (x == 'red')
          '<ha-icon icon="mdi:flower-pollen">'
        else
          '<ha-icon icon="mdi:void">'
    - name: <ha-icon icon="mdi:circle-slice-8">
      data: state
      align: center
      modify: |-
        if (x == 'purple')
          '<ha-icon icon="mdi:flower-pollen">'
        else
          '<ha-icon icon="mdi:void">'
  css:
    tbody tr td:nth-child(1): "width: 16px; "
    tbody tr td:nth-child(2): "width: 16px; "
    tbody tr td:nth-child(3): "background-color: lightgreen; width: 16px"
    tbody tr td:nth-child(4): "background-color: gold; width: 16px"
    tbody tr td:nth-child(5): "background-color: coral; width: 1px"
    tbody tr td:nth-child(6): "background-color: indianred; width: 16px"
    tbody tr td:nth-child(7): "background-color: orchid; width: 16px"

I tried also a very short table but it does not work as I would like. For a better rendering the background of the last column should be green, yellow, orange, … depending on the severity but I’m not good enough to achieve it. And by the way, I’m against too heavy code.
Here is any way the result. Note that I use a unique background for all cells in the table otherwise some colors are not contrasted enough over a white or light gray. And, the colors are back to pure yellow, green, orange to get the right contrast. For severity, the circle will be filled up progressively and colored based on the level of allergens (but so far, it is the beginning of the season and the image cant show all variations)

2025-02-04_17-27-15

type: custom:auto-entities
filter:
 include:
   - entity_id: sensor.myhome_gerpinnes_*_level
 exclude:
   - state: replace here by none to get only the raw with monitored allergens
sort:
 method: name
 reverse: false
 ignore_case: true
card:
 type: custom:flex-table-card
 title: null
 columns:
   - name: Allergène
     data: friendly_name
     align: center
     modify: >-
       function getTranslations(pollentype) {
         const Translate = 1; // Set to 1 to apply translation table, set 0 to use originals

         // Add your wanted translations here
         const translations = {
           "Oak": "Chêne",
           "Alder": "Aulne",
           "Grass": "Graminée",
           "Birch": "Bouleau",
           "Hazel": "Noisetier",
           "Mugwort": "Armoise",
           "Ash": "Frêne"
         };

         // if Translate is turned on then retrieve the translation, othwerise use the original value
         return Translate ? (translations[pollentype] || pollentype) : pollentype;
       } 

       // note that depending on your setup a different item of the array might
       need to be set (e.g. [2] instead of [1])

       var pollen = x.split(" ")[2];

       // call the translation function

       getTranslations(pollen);          
   - name: Saison
     data: state
     align: center
     modify: |-
       if (x == 'none')
         '<ha-icon icon="mdi:void">'
       else
         '<ha-icon icon="mdi:eye-check-outline">'
   - name: Severity
     data: state
     align: center
     modify: |-
       switch ( x ) {
         case 'green':
           '<ha-icon icon="mdi:circle-outline" style="color: green" >'
           break;
         case 'yellow':
           '<ha-icon icon="mdi:circle-slice-2" style="color: yellow" >'
           break;
         case 'orange':
           '<ha-icon icon="mdi:circle-slice-4" style="color: orange">'
           break;
         case 'red':
           '<ha-icon icon="mdi:circle-slice-6" style="color: red">'
           break;
         case 'purple':
           '<ha-icon icon="mdi:circle-slice-8" style="color: purple">'
           break;
         default:
           '<ha-icon icon="mdi:void">' 
               }
 css:
   tbody tr td:nth-child(1): "background-color: silver;width: 16px; "
   tbody tr td:nth-child(2): "background-color: silver;width: 16px; "
   tbody tr td:nth-child(3): "background-color: silver; width: 16px; "

1 Like

Could the felt temperature be added in the IRM HA integration ? Same for uv_index ?
I’ve added another integration with Meteorologisk institutt (Met.no) just to get the uv_index.
I know there is a also another OpenUV integration but I don’t use it so far.

I would prefer to use all from our own good Belgian IRM institute :wink:

1 Like

Nice, like the updates!

As for your second test, I think you can do it by using card_mod. I did some looking around and got to this result:


So 3 columns, first 2 are the same as the other card, 3rd column should be coloured with the severity colours if it is applicable and with a white icon the severity is also shown. You’ll notice that the full cell isn’t coloured, that’s because it uses a

inside it to change the colour (it’s the only way I found to make a changeable background colour).

I’m no expert though, so not sure if it will work for other lines as well to be honest, but perhaps it can help you further with what you want to achieve (I personally like the full view :slight_smile: ).

type: custom:auto-entities
filter:
  include:
    - entity_id: sensor.ev04_*_level
  exclude:
    - state: replace here by none to get only the raw with monitored allergens
sort:
  method: name
  reverse: false
  ignore_case: true
card:
  type: custom:flex-table-card
  title: null
  columns:
    - name: Pollen
      data: friendly_name
      align: center
      modify: >-
        function getTranslations(pollentype) {
          const Translate = 1; // Set to 1 to apply translation table, set 0 to use originals

          // Add your wanted translations here
          const translations = {
            "Oak": "Eik",
            "Alder": "Els",
            "Grass": "Gras",
            "Birch": "Berk",
            "Hazel": "Notelaar",
            "Mugwort": "Bijvoet",
            "Ash": "Es"
          };

          // if Translate is turned on then retrieve the translation, othwerise use the original value
          return Translate ? (translations[pollentype] || pollentype) : pollentype;
        } 

        // note that depending on your setup a different item of the array might
        need to be set (e.g. [2] instead of [1])

        var pollen = x.split(" ")[1];

        // call the translation function

        getTranslations(pollen);          
    - name: Seizoen
      data: state
      align: center
      modify: |-
        if (x == 'none')
          '<ha-icon icon="mdi:void">'
        else
          '<ha-icon icon="mdi:eye-check-outline">'
    - name: Zwaarte
      data: state
      align: center
      modify: |-
        var ICON = 'mdi:void';
        var COLOUR = 'white';
        switch ( x ) {
          case 'green':
            ICON = 'mdi:circle-outline';
            COLOUR = 'green';
            break;
          case 'yellow':
            ICON = 'mdi:circle-slice-2';
            COLOUR = 'yellow';
            break;
          case 'orange':
            ICON = 'mdi:circle-slice-4';
            COLOUR = 'orange';
            break;
          case 'red':
            ICON = 'mdi:circle-slice-6';
            COLOUR = 'red';
            break;
          case 'purple':
            ICON = 'mdi:circle-slice-8';
            COLOUR = 'purple'
            break;
          default:
            ICON = 'mdi:void';
            COLOUR = ''
                }
          '<div style="background-color: ' + COLOUR + ';"><ha-icon icon="' + ICON + '" style="color: white"></div>'
          
  css:
    tbody tr td:nth-child(1): "width: 16px; "
    tbody tr td:nth-child(2): "width: 16px; "
    tbody tr td:nth-child(3): "width: 16px; "