vd Brink Home Automations

Home automations: Home Assistant, ESPHome, Node-RED and more.

Follow me on GitHub

Home Assistant -
HACS Kleenex Pollen Radar

advanced Kleenx pollen Home Assistant logo

Here you find Home Assistant (lovelace) dashboard examples related to the custom HACS integration Kleenex Pollen Radar which you can easily add to your own dashboard.

This integration shows Pollen information for grass, trees and weeds.

It’s available for the countries: The Netherlands, France, Italy, the United Kingdom and the United States of America.
Check the git repository to find out all options: https://github.com/MarcoGos/kleenex_pollenradar

Alternative integration

If your country isn’t in the list, or you want to try another data provider, you can also look at the Google Pollen integration.


Table of Contents


Installation

Here are the steps to install this HACS Kleenex Pollen Radar integration.

  • Use this button to add the Kleenex pollen radar / Scottex integration:

    Open your Home Assistant instance and open a repository inside the Home Assistant Community Store.

  • Click Add integration
    Now you get one search result.

  • Select the Kleenex integration

  • Click on the detail page, in the right bottom corner on Download

Now is the integration added, but not yet installed.

  • Click this button to install the integration:

    Open your Home Assistant instance and start setting up a new integration.

  • Select your country and press the Submit button.

    setup Kleenex

Now you have these five new sensors.

Kleenex sensors

Subtypes in attributes

Each sensor contains also in it’s attribute value extra information about different subtypes and a forecast for the upcoming days.
These subtypes are possible:

  • Trees
    • Hazelaar (NL), Hazel (EN)
    • Pijnboom (NL), Pine (EN)
    • Populier (NL), Poplar (EN)
    • Plataan (NL), Plane (EN)
    • Cipres (NL), Cypress (EN)
    • Els (NL), Els (EN)
    • Iep (NL), Elm (EN)
    • Berk (NL), Birch (EN)
    • Eik (NL), Oak (EN)
  • Grass
    • Poaceae (NL), Poaceae (EN)
  • Weeds
    • Bijvoet (NL), Mugwort (EN)
    • Ganzevoet (NL), Goosefoot (EN)
    • Ambrosia (NL), Ambrosia (EN)
    • Brandnetel (NL), Nettle (EN)

To see this subtype and forecast data use this button to go to the Developer tools and filter the entities on with the keyword kleenex.

Open your Home Assistant instance and show your state developer tools.

Click on the image to see all the forecast and subtype details which are stored in the attribute data.

Kleenex forecast

Dashboard presentations

I have different examples of how to present this data on your dashboard:


Alternative icons

If you want an alternative icon for weeds you can also use mdi:sprout or mdi:flower-pollen.

alternative icon mdi:sprout alternative icon mdi:flower-pollen

Default presentation

When the installation is complete, you get at least three entities which you can add to your dashboard.

This is a default presentation with the entities card.

default Kleenex presentation

# Sourcecode by vdbrink.github.io
# Entities Card Configuration
type: entities
entities:
  - sensor.kleenex_pollen_radar_huis_grass
  - sensor.kleenex_pollen_radar_huis_trees
  - sensor.kleenex_pollen_radar_huis_weeds


Mushroom

This presentation uses English levels and has bigger icons.
No need to create extra helper sensors.

kleenex presentation with mushroom card

This presentation required the HACS integration lovelace-mushroom to create this custom presentation.
Install the integration via this button:

Open your Home Assistant instance and show the add-on store.

> Click here to see the corresponding dashboard YAML code >>

# Sourcecode by vdbrink.github.io
type: grid
cards:
  - type: custom:mushroom-template-card
    primary: >-
      Trees: {% set level =
      states('sensor.kleenex_pollen_radar_home_trees')|int(0) %}
      {% if level <= 95 %} Low
      {% elif level <= 207 %} Moderate 
      {% elif level <= 703 %} High
      {% else %} very High
      {% endif %}
    secondary: "{{ states('sensor.kleenex_pollen_radar_home_trees') }} ppm"
    icon: mdi:tree
    icon_color: |-
      {% set trees = states('sensor.kleenex_pollen_radar_home_trees') | int %}
      {% if trees < 80 %}
      #006400
      {% elif trees < 96 %}
      #008000
      {% elif trees < 120 %}
      #90EE90
      {% elif trees < 170 %}
      #FFFF00
      {% elif trees < 250 %}
      #FFD700
      {% elif trees < 330 %}
      #FFA500
      {% elif trees < 500 %}
      #FF8C00
      {% elif trees =< 704 %}
      #FF0000
      {% elif trees > 704 %}
      #8B0000
      {% else %}
      #800080
      {% endif %} 
    layout: vertical
    entity: sensor.kleenex_pollen_radar_home_trees
    multiline_secondary: false
    tap_action:
      action: more-info
    layout_options:
      grid_columns: 1
      grid_rows: 2
    card_mod:
      style: |
        ha-card {
          --icon-size: 60px;
          background-color: hsla(0, 0%, 0%, 0);
        }
  - type: custom:mushroom-template-card
    primary: >-
      Grass: {% set level =
      states('sensor.kleenex_pollen_radar_home_grass')|int(0) %}
      {% if level <= 29 %} Low
      {% elif level <= 60 %} Moderate 
      {% elif level <= 341 %} High
      {% else %} very High
      {% endif %}
    secondary: "{{ states('sensor.kleenex_pollen_radar_home_grass') }} ppm"
    icon: mdi:grass
    icon_color: |-
      {% set grass = states('sensor.kleenex_pollen_radar_home_grass') | int %}
      {% if grass < 25 %}
      #006400
      {% elif grass < 29 %}
      #008000
      {% elif grass < 61 %}
      #90EE90
      {% elif grass < 100 %}
      #FFFF00
      {% elif grass < 180 %}
      #FFD700
      {% elif grass < 250 %}
      #FFA500
      {% elif grass < 342 %}
      #FF8C00
      {% elif grass > 341 %}
      #FF0000
      {% else %}
      #800080
      {% endif %} 
    layout: vertical
    entity: sensor.kleenex_pollen_radar_home_grass
    multiline_secondary: false
    tap_action:
      action: more-info
    layout_options:
      grid_columns: 1
      grid_rows: 2
    card_mod:
      style: |
        ha-card {
          --icon-size: 60px;
          background-color: hsla(0, 0%, 0%, 0);
        }
  - type: custom:mushroom-template-card
    primary: |-
      Weeds:
      {% set level = states('sensor.kleenex_pollen_radar_home_weeds')|int(0) %}
      {% if level <= 20 %} Low
      {% elif level <= 77 %} Moderate 
      {% elif level <= 266 %} High
      {% else %} very High
      {% endif %}
    secondary: "{{ states('sensor.kleenex_pollen_radar_home_weeds') }} ppm"
    icon: mdi:flower-pollen
    icon_color: |-
      {% set weeds = states('sensor.kleenex_pollen_radar_home_weeds') | int %}
      {% if weeds < 15 %}
      #006400
      {% elif weeds < 21 %}
      #008000
      {% elif weeds < 45 %}
      #90EE90
      {% elif weeds < 60 %}
      #FFFF00
      {% elif weeds < 100 %}
      #FFD700
      {% elif weeds < 150 %}
      #FFA500
      {% elif weeds < 200 %}
      #FF8C00
      {% elif weeds < 267 %}
      #FF0000
      {% elif weeds > 266 %}
      #8B0000
      {% else %}
      #800080
      {% endif %} 
    layout: vertical
    entity: sensor.kleenex_pollen_radar_home_weeds
    multiline_secondary: false
    tap_action:
      action: more-info
    layout_options:
      grid_columns: 1
      grid_rows: 2
    card_mod:
      style: |
        ha-card {
          --icon-size: 60px;
          background-color: hsla(0, 0%, 0%, 0);
        }


Tile card with progress indicator

This presentation shows the entities with matching colors and a level border color.

kleenex presentation with colors

The entities are clickable which show you the values over time:

kleenex popup

For this advanced presentation, you also need to add three new sensors to divide the ppm number into a textual value. This value will be used as text, but also be used for different colors and an indication circle of the intensity. This presentation required the HACS module lovelace-card-mod to add custom CSS styling like the progress circle.
Install it via this button:

Open your Home Assistant instance and show the add-on store.

Helper sensors

You need to add these three helper sensors first.

This can be done to the sensor section in the file configuration.yaml with this code.
Or create them via the HA helper frontend, see below this code block.

> Click here to see the corresponding configuration.yaml code >>

# Sourcecode by vdbrink.github.io
# configuration.yaml
- platform: template
  sensors:
    pollen_grass_concentration:
      value_template: >-
        {% set level = states('sensor.kleenex_pollen_radar_huis_grass')|int(0) %}
        {% if level <= 29 %} Laag
        {% elif level <= 60 %} Gemiddeld
        {% elif level <= 341 %} Hoog
        {% else %} Zeer Hoog
        {% endif %}
    pollen_trees_concentration:
      value_template: >-
        {% set level = states('sensor.kleenex_pollen_radar_huis_trees')|int(0) %}
        {% if level <= 95 %} Laag
        {% elif level <= 207 %} Gemiddeld
        {% elif level <= 703 %} Hoog
        {% else %} Zeer Hoog
        {% endif %}
    pollen_weeds_concentration:
      value_template: >-
        {% set level = states('sensor.kleenex_pollen_radar_huis_weeds')|int(0) %}
        {% if level <= 20 %} Laag
        {% elif level <= 77 %} Gemiddeld
        {% elif level <= 266 %} Hoog
        {% else %} Zeer Hoog
        {% endif %}

Via the frontend

The other way is via the frontend, you can create a new template via the Settings menu item, then go to Devices and Services and select Helpers.
This button directly opens the Helpers page in your Home Assistant:

Open your Home Assistant instance and show your helper entities.

Select the bottom-right button + CREATE HELPER, select Template then one of the option Template a sensor

kleenex advanced presentation

Fill the fields like this. Do this three times also for the pollen_weeds_concentration and pollen_trees_concentration

attribute tree data apexcharts

Read more how to add a template (via the HA frontend itself) here on my advanced Templates page.

Dashboard code

> Click here to see the corresponding dashboard YAML code >>

# Sourcecode by vdbrink.github.io
# Horizontal Stack Card Configuration
type: horizontal-stack
cards:
  - entity: sensor.kleenex_pollen_radar_huis_weeds
    name: Onkruid
    type: tile
    vertical: true
    tap_action:
      action: more-info
    card_mod:
      style: |
        .icon-container {
          {% set level = states('sensor.pollen_weeds_concentration') %}
          {% set color = {'Laag':'green','Gemiddeld':'orange','Hoog':'darkorange','Zeer Hoog':'maroon'} %}
          {% set level_color = color.get(level,'gray') %}
          {% set circle = {'Laag':'25','Gemiddeld':'50','Hoog':'75','Zeer Hoog':'100'} %}        
          {% set percentage = circle.get(level,'25') %}
          border-radius: 24px;
          background: radial-gradient(var(--card-background-color) 60%,transparent calc(60% + 1px)),
          conic-gradient({{level_color}} {{percentage}}% 0%,
          var(--card-background-color) 0% 100%);
        }
        ha-tile-icon {
          {% set level = states('sensor.pollen_weeds_concentration') %}
          {% set color = {'Laag':'green','Gemiddeld':'orange', 'Hoog':'darkorange','Zeer Hoog':'maroon'} %}              
          {% set level_color = color.get(level,'gray') %}
          --tile-color: {{level_color}};
        }
  - entity: sensor.kleenex_pollen_radar_huis_grass
    name: Gras
    type: tile
    vertical: true
    tap_action:
      action: more-info
    card_mod:
      style: |
        .icon-container {
          {% set level = states('sensor.pollen_grass_concentration') %}
          {% set color = {'Laag':'green','Gemiddeld':'orange','Hoog':'darkorange','Zeer Hoog':'maroon'} %}
          {% set level_color = color.get(level,'gray') %}
          {% set circle = {'Laag':'25','Gemiddeld':'50','Hoog':'75','Zeer Hoog':'100'} %}        
          {% set percentage = circle.get(level,'25') %}
          border-radius: 24px;
          background: radial-gradient(var(--card-background-color) 60%,transparent calc(60% + 1px)),
          conic-gradient({{level_color}} {{percentage}}% 0%,
          var(--card-background-color) 0% 100%)
        }
        ha-tile-icon {
          {% set level = states('sensor.pollen_grass_concentration') %}
          {% set color = {'Laag':'green','Gemiddeld':'orange','Hoog':'darkorange','Zeer Hoog':'maroon'} %}
          {% set level_color = color.get(level,'gray') %};
          --tile-color: {{level_color}};
        }
  - entity: sensor.kleenex_pollen_radar_huis_trees
    name: Bomen
    type: tile
    vertical: true
    tap_action:
      action: more-info
    card_mod:
      style: |
        .icon-container {
           {% set level = states('sensor.pollen_trees_concentration') %}
           {% set color = {'Laag':'green','Gemiddeld':'orange','Hoog':'darkorange','Zeer Hoog':'maroon'} %}
          {% set level_color = color.get(level,'gray') %}
          {% set circle = {'Laag':'25','Gemiddeld':'50','Hoog':'75','Zeer Hoog':'100'} %}        
          {% set percentage = circle.get(level,'25') %}
          border-radius: 24px;
          background: radial-gradient(var(--card-background-color) 60%,transparent calc(60% + 1px)),
          conic-gradient({{level_color}} {{percentage}}% 0%,
          var(--card-background-color) 0% 100%);
        }
        ha-tile-icon {
          {% set level = states('sensor.pollen_trees_concentration') %}
          {% set color = {'Laag':'green','Gemiddeld':'orange', 'Hoog':'darkorange','Zeer Hoog':'maroon'} %}
          {% set level_color = color.get(level,'gray') %};
          --tile-color: {{level_color}};
        }

Help

If you don’t get the progress indicator visible, this could be due to different reasons. How this works:

  • The helper sensors you also need to create converts the numbered value sensor.kleenex_pollen_radar_huis_grass to pollen_grass_concentration that contains a textual value Laag (Dutch for low) for example.
  • This line converts this text to a color, Laag -> green etc.
    yaml{% set color = {'Laag':'green','Gemiddeld':'orange','Hoog':'darkorange','Zeer Hoog':'maroon'} %}
  • This line defines the progress of the darker circle around the icon. yaml{% set circle = {'Laag':'25','Gemiddeld':'50','Hoog':'75','Zeer Hoog':'100'} %}
  • This CSS code defines the background color and circle.
    
    border-radius: 24px;
    background: radial-gradient(var(--card-background-color) 60%,transparent calc(60% + 1px)),
    conic-gradient({{level_color}} {{percentage}}% 0%,
    var(--card-background-color) 0% 100%);
    
    
  • This custom CSS requires the extra HACS integration lovelace-card-mod, is this installed? See earlier on this page how to do this.

Show a clickable link to the Kleenex website, the entities with matching colors and colored labels, like this:

kleenex advanced presentation
> Click here to see the corresponding dashboard YAML code >>

# Sourcecode by vdbrink.github.io
# Entities Card Configuration
type: vertical-stack
cards:
  - type: heading
    heading: Pollen in de lucht
    heading_style: title
    card_mod:
      class: class-section-heading
    tap_action:
      action: url
      url_path: https://www.kleenex.nl/pollenradar
  - type: horizontal-stack
    cards:
      - entity: sensor.kleenex_pollen_radar_huis_weeds
        name: Onkruid
        type: tile
        vertical: true
        tap_action:
          action: more-info
        card_mod:
          style: |
            .icon-container {
              {% set level = states('sensor.pollen_weeds_concentration') %}
              {% set color = {'Laag':'green','Gemiddeld':'orange','Hoog':'darkorange','Zeer Hoog':'maroon'} %}
              {% set level_color = color.get(level,'gray') %}
              {% set circle = {'Laag':'25','Gemiddeld':'50','Hoog':'75','Zeer Hoog':'100'} %}        
              {% set percentage = circle.get(level,'25') %}
              border-radius: 24px;
              background: radial-gradient(var(--card-background-color) 60%,transparent calc(60% + 1px)),
              conic-gradient({{level_color}} {{percentage}}% 0%,
              var(--card-background-color) 0% 100%);
            }
            ha-tile-icon {
              {% set level = states('sensor.pollen_weeds_concentration') %}
              {% set color = {'Laag':'green','Gemiddeld':'orange', 'Hoog':'darkorange','Zeer Hoog':'maroon'} %}              
              {% set level_color = color.get(level,'gray') %}
              --tile-color: {{level_color}};
            }
      - entity: sensor.kleenex_pollen_radar_huis_grass
        name: Gras
        type: tile
        vertical: true
        tap_action:
          action: more-info
        card_mod:
          style: |
            .icon-container {
              {% set level = states('sensor.pollen_grass_concentration') %}
              {% set color = {'Laag':'green','Gemiddeld':'orange','Hoog':'darkorange','Zeer Hoog':'maroon'} %}
              {% set level_color = color.get(level,'gray') %}
              {% set circle = {'Laag':'25','Gemiddeld':'50','Hoog':'75','Zeer Hoog':'100'} %}        
              {% set percentage = circle.get(level,'25') %}
              border-radius: 24px;
              background: radial-gradient(var(--card-background-color) 60%,transparent calc(60% + 1px)),
              conic-gradient({{level_color}} {{percentage}}% 0%,
              var(--card-background-color) 0% 100%)
            }
            ha-tile-icon {
              {% set level = states('sensor.pollen_grass_concentration') %}
              {% set color = {'Laag':'green','Gemiddeld':'orange','Hoog':'darkorange','Zeer Hoog':'maroon'} %}
              {% set level_color = color.get(level,'gray') %};
              --tile-color: {{level_color}};
            }
      - entity: sensor.kleenex_pollen_radar_huis_trees
        name: Bomen
        type: tile
        vertical: true
        tap_action:
          action: more-info
        card_mod:
          style: |
            .icon-container {
               {% set level = states('sensor.pollen_trees_concentration') %}
               {% set color = {'Laag':'green','Gemiddeld':'orange','Hoog':'darkorange','Zeer Hoog':'maroon'} %}
              {% set level_color = color.get(level,'gray') %}
              {% set circle = {'Laag':'25','Gemiddeld':'50','Hoog':'75','Zeer Hoog':'100'} %}        
              {% set percentage = circle.get(level,'25') %}
              border-radius: 24px;
              background: radial-gradient(var(--card-background-color) 60%,transparent calc(60% + 1px)),
              conic-gradient({{level_color}} {{percentage}}% 0%,
              var(--card-background-color) 0% 100%);
            }
            ha-tile-icon {
              {% set level = states('sensor.pollen_trees_concentration') %}
              {% set color = {'Laag':'green','Gemiddeld':'orange', 'Hoog':'darkorange','Zeer Hoog':'maroon'} %}
              {% set level_color = color.get(level,'gray') %};
              --tile-color: {{level_color}};
            }
  - type: horizontal-stack
    cards:
      - type: markdown
        entity: sensor.pollen_weeds_concentration
        card_mod:
          style: |
            ha-card {
              background: rgb(128,193,177);
              color:
                {% set level = states('sensor.pollen_weeds_concentration') %}
                {% set color = {'Laag':'green','Gemiddeld':'orange', 'Hoog':'darkorange','Zeer Hoog':'maroon'} %}
                {% set level_color = color.get(level,'gray') %}
                {{level_color}};
              font-weight: 800;
              text-align: center;
            }
        content: |
          {{states(config.entity)}}
      - type: markdown
        entity: sensor.pollen_grass_concentration
        card_mod:
          style: |
            ha-card {
              background: rgb(128,193,177);
              color:
                {% set level = states('sensor.pollen_grass_concentration') %}
                {% set color = {'Laag':'green','Gemiddeld':'orange','Hoog':'darkorange','Zeer Hoog':'maroon'} %}
                {% set level_color = color.get(level,'gray') %}
                {{level_color}};
              font-weight: 800;
              text-align: center;
            }
        content: |
          {{states(config.entity)}}
      - type: markdown
        entity: sensor.pollen_trees_concentration
        card_mod:
          style: |
            ha-card {
              background: rgb(128,193,177);
              color:
                {% set level = states('sensor.pollen_trees_concentration') %}
                {% set color = {'Laag':'green','Gemiddeld':'orange','Hoog':'darkorange','Zeer Hoog':'maroon'} %}
                {% set level_color = color.get(level,'gray') %}
                {{level_color}};
              font-weight: 800;
              text-align: center;
            }
        content: |
          {{states('sensor.pollen_trees_concentration')}}


Subtypes values

I filtered from the tree attributes the values from the Hazelaar (Hazel) and Berk (Birch).

subtype data
> Click here to see the corresponding dashboard YAML code >>

# Sourcecode by vdbrink.github.io
# Entities Card Configuration
type: horizontal-stack
cards:
  - type: tile
    entity: sensor.kleenex_pollen_radar_huis_trees
    name: Hazelaar
    grid_options:
      columns: 3
      rows: 2
    vertical: true
    features_position: bottom
    card_mod:
      style:
        ha-tile-icon: >
          {% set input_name = 'Hazelaar' %} 
          {% set details = state_attr('sensor.kleenex_pollen_radar_huis_trees', 'current').details %} 
          {% set item = details | selectattr('name', 'eq', input_name) | first() %} 
          {% set level = item.level | default('N/A') %}  
          {% set color_map = {'low':'green', 'moderate': 'orange', 'high': 'darkorange', 'very high': 'maroon'} %} 
          {% set level_color = color_map.get(level, 'gray') %}

          ha-state-icon {
            conic-gradient({{ level_color }} var(--card-background-color) 0% 100%);
          }

          ha-tile-icon {
             --tile-color: {{level_color}};
          }
        ha-tile-info$: >
          {% set input_name = 'Hazelaar' %}  
          {% set details = state_attr('sensor.kleenex_pollen_radar_huis_trees', 'current').details %} 
          {% set item = details | selectattr('name', 'eq', input_name) | first() %}

          .secondary state-display {
            display: none;
          }

          .secondary::after {
            content: "{{ item.value }} ppm";
            display: block;
            text-align: center;
          }
  - type: tile
    entity: sensor.kleenex_pollen_radar_huis_trees
    name: Berk
    grid_options:
      columns: 3
      rows: 2
    vertical: true
    features_position: bottom
    card_mod:
      style:
        ha-tile-icon: >
          {% set input_name = 'Berk' %} 
          {% set details = state_attr('sensor.kleenex_pollen_radar_huis_trees', 'current').details %} 
          {% set item = details | selectattr('name', 'eq', input_name) | first() %} 
          {% set level = item.level | default('N/A') %}  
          {% set color_map = {'low':'green', 'moderate': 'orange', 'high': 'darkorange', 'very high': 'maroon'} %} 
          {% set level_color = color_map.get(level, 'gray') %}

          ha-state-icon {
            conic-gradient({{ level_color }} var(--card-background-color) 0% 100%);
          }

          ha-tile-icon {
             --tile-color: {{level_color}};
          }
        ha-tile-info$: >
          {% set input_name = 'Berk' %}  
          {% set details = state_attr('sensor.kleenex_pollen_radar_huis_trees', 'current').details %} 
          {% set item = details | selectattr('name', 'eq', input_name) | first() %}

          .secondary state-display {
            display: none;
          }

          .secondary::after {
            content: "{{ item.value }} ppm";
            display: block;
            text-align: center;
          }


Specific subtypes forecast

I created a bar graph with all tree data for the upcoming days. I used for this presentation the HACS ApexCharts Card integration.

Click this button to install the ApexCharts Card:

Open your Home Assistant instance and open a repository inside the Home Assistant Community Store.

kleenex advanced presentation
> Click here to see the corresponding dashboard YAML code >>

# Sourcecode by vdbrink.github.io
# Entities Card Configuration
type: custom:apexcharts-card
now:
  show: true
graph_span: 4d
span:
  start: day
series:
  - name: Hazelaar
    entity: sensor.kleenex_pollen_radar_huis_trees
    type: column
    color: "#1f77b4"
    data_generator: >
      let data = [];

      if (entity.attributes.current) {
        data.push([new Date(entity.attributes.current.date).getTime(), entity.attributes.current.details.find(t => t.name === "Hazelaar").value]);
      }

      return data.concat(entity.attributes.forecast.map(d => [new
      Date(d.date).getTime(), d.details.find(t => t.name ===
      "Hazelaar").value]));
  - name: Iep
    entity: sensor.kleenex_pollen_radar_huis_trees
    type: column
    color: "#ff7f0e"
    data_generator: >
      let data = [];

      if (entity.attributes.current) {
        data.push([new Date(entity.attributes.current.date).getTime(), entity.attributes.current.details.find(t => t.name === "Iep").value]);
      }

      return data.concat(entity.attributes.forecast.map(d => [new
      Date(d.date).getTime(), d.details.find(t => t.name === "Iep").value]));
  - name: Els
    entity: sensor.kleenex_pollen_radar_huis_trees
    type: column
    color: "#2ca02c"
    data_generator: >
      let data = [];

      if (entity.attributes.current) {
        data.push([new Date(entity.attributes.current.date).getTime(), entity.attributes.current.details.find(t => t.name === "Els").value]);
      }

      return data.concat(entity.attributes.forecast.map(d => [new
      Date(d.date).getTime(), d.details.find(t => t.name === "Els").value]));
  - name: Populier
    entity: sensor.kleenex_pollen_radar_huis_trees
    type: column
    color: "#d62728"
    data_generator: >
      let data = [];

      if (entity.attributes.current) {
        data.push([new Date(entity.attributes.current.date).getTime(), entity.attributes.current.details.find(t => t.name === "Populier").value]);
      }

      return data.concat(entity.attributes.forecast.map(d => [new
      Date(d.date).getTime(), d.details.find(t => t.name ===
      "Populier").value]));
  - name: Eik
    entity: sensor.kleenex_pollen_radar_huis_trees
    type: column
    color: "#9467bd"
    data_generator: >
      let data = [];

      if (entity.attributes.current) {
        data.push([new Date(entity.attributes.current.date).getTime(), entity.attributes.current.details.find(t => t.name === "Eik").value]);
      }

      return data.concat(entity.attributes.forecast.map(d => [new
      Date(d.date).getTime(), d.details.find(t => t.name === "Eik").value]));
  - name: Plataan
    entity: sensor.kleenex_pollen_radar_huis_trees
    type: column
    color: "#8c564b"
    data_generator: >
      let data = [];

      if (entity.attributes.current) {
        data.push([new Date(entity.attributes.current.date).getTime(), entity.attributes.current.details.find(t => t.name === "Plataan").value]);
      }

      return data.concat(entity.attributes.forecast.map(d => [new
      Date(d.date).getTime(), d.details.find(t => t.name ===
      "Plataan").value]));
  - name: Berk
    entity: sensor.kleenex_pollen_radar_huis_trees
    type: column
    color: "#e377c2"
    data_generator: >
      let data = [];

      if (entity.attributes.current) {
        data.push([new Date(entity.attributes.current.date).getTime(), entity.attributes.current.details.find(t => t.name === "Berk").value]);
      }

      return data.concat(entity.attributes.forecast.map(d => [new
      Date(d.date).getTime(), d.details.find(t => t.name === "Berk").value]));
  - name: Cipres
    entity: sensor.kleenex_pollen_radar_huis_trees
    type: column
    color: "#7f7f7f"
    data_generator: >
      let data = [];

      if (entity.attributes.current) {
        data.push([new Date(entity.attributes.current.date).getTime(), entity.attributes.current.details.find(t => t.name === "Cipres").value]);
      }

      return data.concat(entity.attributes.forecast.map(d => [new
      Date(d.date).getTime(), d.details.find(t => t.name === "Cipres").value]));
apex_config:
  chart:
    type: bar
  xaxis:
    type: datetime
  plotOptions:
    bar:
      columnWidth: 70%
  tooltip:
    enabled: true
  legend:
    labels: {
      useSeriesColors: true
    }

The values in the legend are the ones from the last date.

If you know how to hide the legend values, please let me know!


Good luck with the integration!

Any questions or suggestions? Please let me know then I can improve this page for the next reader.


Credits

I got some ideas for the presentations from this HA forum: [Help request] Pollen sensor Dutch hooikoortsradar.nl
If you got any questions you can also ask them here.


^^ Top

<< See also my other Home Assistant tips and tricks

Home Assistant integration: Afvalbeheer >>

Home Assistant: Templates >>


Top | Homepage | Best Buy Tips