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

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
image

Several other people made edits. How about at the top?

I (finally) fixed the typo’s btw

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

Ohw i really like this look, care to share your YAML for this? :slight_smile:

sure

This is what’s in the dashboard/lovelace yaml

              - type: markdown
                  title: Pollen
                  content: |-
                      <ha-alert alert-type="error">  {{ states ('sensor.my_kmi_pollen_hi') }}</ha-alert>
                      <ha-alert alert-type="warning">{{ states ('sensor.my_kmi_pollen_me') }}</ha-alert>
                      <ha-alert alert-type="info"   >{{ states ('sensor.my_kmi_pollen_lo') }}</ha-alert>

The sensors are built like this (ps: my kmi weather sensors have been renamed like sensor.forecast_kmi_alder_level )

  - name: my_kmi_pollen_lo      
    state: >
        {% set pollen = states 
            | select('search', 'kmi') 
            | select('search', 'level')
            | selectattr('state', 'eq', 'yellow')    
            | map(attribute='attributes.friendly_name')
            | list
            | join(', ')
            | replace ("Pollen ","")     
        %} 
        {{ pollen if pollen else '-' }}

  - name: my_kmi_pollen_me     
    state: >
        {% set pollen = states 
            | select('search', 'kmi') 
            | select('search', 'level')
            | selectattr('state', 'eq', 'orange')    
            | map(attribute='attributes.friendly_name')
            | list
            | join(', ')
            | replace ("Pollen ","")     
        %} 
        {{ pollen if pollen else '-' }}

  - name: my_kmi_pollen_hi
    state: >
        {% set pollen = states 
            | select('search', 'kmi') 
            | select('search', 'level')
            | selectattr ('state','in',['red','purple'])
            | map(attribute='attributes.friendly_name')
            | list
            | join(', ')
            | replace ("Pollen ","")     
        %} 
        {{ pollen if pollen else '-' }}

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:

The yaml of the Cards look like this:

type: custom:auto-entities
filter:
  include:
    - entity_id: sensor.ev04_*_level
  exclude:
    - state: none
card:
  type: custom:flex-table-card
  title: Pollen
  columns:
    - name: Type
      data: friendly_name
      align: center
      modify: x.split(" ")[1];
    - name: Active
      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: 32px'
    tbody tr td:nth-child(2): 'width: 32px'
    tbody tr td:nth-child(3): 'background-color: green; width: 32px'
    tbody tr td:nth-child(4): 'background-color: yellow; width: 32px'
    tbody tr td:nth-child(5): 'background-color: orange; width: 32px'
    tbody tr td:nth-child(6): 'background-color: red; width: 32px'
    tbody tr td:nth-child(7): 'background-color: purple; width: 32px'
2 Likes

Anyone can explain me how to set forecast value in attribute ?
And how to get the data for the next day ?

Thanks

Well I was looking at the IRM/KMI Open data site for an api and while searching stumble on this !
Great ! Let’s try!

And it works ! So thanks !

1 Like

The author of this issue shared its template sensor for this: Problem pasing daily forecast · Issue #49 · jdejaegh/irm-kmi-ha · GitHub. There are other topics discussing this exact matter on this forum as it is common to all weather integrations (e.g. Update from using weather attributes with the new service: weather.get_forecasts)

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.

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: