Pollen/Allergy Sensor

That doesn’t tell me the HA Core version. That said, that front end version is pretty old, so I’d recommend upgrading.

My HA Core is latest.

The other version is HACS (sorry, my mistake), which I will update (not sure if it supports to auto upgrade itself…)

Version	core-2021.5.5
Installation Type	Home Assistant OS
Development	false
Supervisor	true
Docker	true
Virtual Environment	false
Python Version	3.8.9
Operating System Family	Linux
Operating System Version	5.4.83-v7l
CPU Architecture	armv7l
Timezone	America/Los_Angeles

I uninstalled HACS and try IQVIA again, it still failed w/ timeout.

I finally got it to work with the latest HA release. Sometimes it takes a day for sensors to get a value.

I use the API from tomorrow.io here in Holland. Recommended.

7 Likes

Could you post the yaml to this?
I like your sliders for pollen.
This is what I have currently:


It would be nice to have a forecast like you have, but I don’t think there is anything for the states that has that level of detail in the forecast.

Hello Glenn,

I have upload my pollen configuration files to my Yandex Disk.

Please use the link below to access them.

1 Like

Read most of this, still not found a working solution for UK pollen.

Accuweather doesn’t seem to have pollen for UK
MetOffice doesn’t have pollen
DarkSky doesn’t have pollen
TheWeatherNetwork doesn’t have pollen for UK
Climacell looked most promising, but the data returned makes no sense. Only time it showed anything other than none was at 2330 to 0230 when it changed to very low. Currently showing none, but other websites mainly show very high.

Has anyone got anything working for UK?

Thank you
:slight_smile:

1 Like

same issue for me, the sensors just aren’t often updated for my UK location, or are set to ‘none’

Hello @kerz1954, would be interested to have a look at your configuration as I can get data from climacell (tomorrow.io) and everything seems filled out. but all the pollen information states “none”.
At this minute I have fully abandoned Ambee integration as I am a bit worried what this might cost in the end. (I know I asked in a different post about the Ambee integration and the “invalid key” error, but that has become irrelevant).

Thanks,

Hello Wim, I’ve stopped using both integrations. Ambee because I know longer have access to the data and tomorrow.io because trees do not pollinate in the summer, but weeds do. There data does not work very well in Europe. Before I waste your time and mine, please indicate which country you are based in. Thanks.

2 Likes

Hello, I live in the Netherlands. And since you mentioned you living there as well earlier in this post I figured it made sense to try and ask :slight_smile:
Thanks,

1 Like

So any idea what to use for pollen in europe that is working fine?

2 Likes

I’m based in the UK, and like others had been struggling to find a reliable source of pollen data for Home Assistant for the UK (climacell / tomorrow is very poor for pollen data in the UK). So using some code from others in the past such as @huizebruin (thanks to him) I’ve made the following file in the sensors folder, ambee_pollen.yaml and directory merge in my config file. Unfortunately the previously available Ambee integration is no longer available, so this does require using REST and signing up for their API, but they do have some free data, hard to say how long that will last though.

ambee_pollen.yaml placed in /sensors folder.

  - platform: rest
    name: pollen_data
    scan_interval: 7200
    resource_template: https://api.ambeedata.com/latest/pollen/by-lat-lng?lat={{ state_attr("zone.home", "latitude") }}&lng={{ state_attr("zone.home", "longitude") }}
    value_template: >-
      {{ value_json.message}}
    headers:
      content-type: application/json
      x-api-key: !secret ambee_pollen_api_key
    json_attributes_path: data[0]
    json_attributes:
      - Count
      - Risk
      - Species
      - updatedAt
      - time

  - platform: template
    sensors:
      pollen_trees:
        friendly_name: Trees
        icon_template: mdi:tree
        value_template: >-
          {% set state = state_attr("sensor.pollen_data", "Risk").tree_pollen %}
          {% if state == "Low"%} Low
          {% elif state == "Moderate"%} Moderate 
          {% elif state == "High"%} High
          {% elif state == "Very High"%} Very High
          {% else %}Unknown{% endif %}
        attribute_templates:
          Total: >-
            {{ state_attr("sensor.pollen_data", "Count").tree_pollen }} /m³
          Alder: >-
            {{ state_attr("sensor.pollen_data", "Species").Tree.Alder }} /m³
          Birch: >-
            {{ state_attr("sensor.pollen_data", "Species").Tree.Birch }} /m³
          Cypress: >-
            {{ state_attr("sensor.pollen_data", "Species").Tree.Cypress }} /m³
          Elm: >-
            {{ state_attr("sensor.pollen_data", "Species").Tree.Elm }} /m³
          Hazel: >-
            {{ state_attr("sensor.pollen_data", "Species").Tree.Hazel }} /m³
          Oak: >-
            {{ state_attr("sensor.pollen_data", "Species").Tree.Oak }} /m³
          Pine: >-
            {{ state_attr("sensor.pollen_data", "Species").Tree.Pine }} /m³
          Plane: >-
            {{ state_attr("sensor.pollen_data", "Species").Tree.Plane }} /m³
          Poplar: >-
            {{ state_attr("sensor.pollen_data", "Species").Tree["Poplar / Cottonwood"] }} /m³
      pollen_grass:
        friendly_name: Grass
        icon_template: mdi:grass
        value_template: >-
          {% set state = state_attr("sensor.pollen_data", "Risk").grass_pollen %}
          {% if state == "Low"%} Low
          {% elif state == "Moderate"%} Moderate
          {% elif state == "High"%} High
          {% elif state == "Very High"%} Very High 
          {% else %}Unknown{% endif %}
        attribute_templates:
          Total: >-
            {{ state_attr("sensor.pollen_data", "Count").grass_pollen }} /m³
          Grass: >-
            {{ state_attr("sensor.pollen_data", "Species").Grass["Grass / Poaceae"] }} /m³
      pollen_weeds:
        friendly_name: Weeds
        icon_template: mdi:grass
        value_template: >-
          {% set state = state_attr("sensor.pollen_data", "Risk").weed_pollen %}
          {% if state == "Low"%} Low
          {% elif state == "Moderate"%} Moderate 
          {% elif state == "High"%} High
          {% elif state == "Very High"%} Very High
          {% else %}Unknown{% endif %}
        attribute_templates:
          Total: >-
            {{ state_attr("sensor.pollen_data", "Count").weed_pollen }} /m³
          Chenopod: >-
            {{ state_attr("sensor.pollen_data", "Species").Weed.Chenopod }} /m³
          Mugwort: >-
            {{ state_attr("sensor.pollen_data", "Species").Weed.Mugwort }} /m³
          Nettle: >-
            {{ state_attr("sensor.pollen_data", "Species").Weed.Nettle }} /m³
          Ragweed: >-
            {{ state_attr("sensor.pollen_data", "Species").Weed.Ragweed }} /m³
      pollen_tree_count:
        icon_template: mdi:tree-outline
        friendly_name: "Trees"
        unit_of_measurement: "/m³"
        value_template: '{{ state_attr("sensor.pollen_data", "Count").tree_pollen }}'

      pollen_weed_count:
        icon_template: mdi:grass
        friendly_name: "Weeds"
        unit_of_measurement: "/m³"
        value_template: '{{ state_attr("sensor.pollen_data", "Count").weed_pollen }}'
        
      pollen_grass_count:
        icon_template: mdi:grass
        friendly_name: "Grass"
        unit_of_measurement: "/m³"
        value_template: '{{ state_attr("sensor.pollen_data", "Count").grass_pollen }}'

      pollen_last_updated:
        icon_template: "mdi:clock"
        friendly_name: "Last update"
        device_class: timestamp
        value_template: "{{ state_attr('sensor.pollen_data', 'updatedAt') }}"

config directory merge

sensor: !include_dir_merge_list sensors/

IMPORTANT: since we used the zone.home template in the ambee_pollen.yaml to avoid hard coding lat long values. This zone.home template does not load fast enough for the sensors on Home Assistant start. So I had to make an automation to reload templates and sensors after Home Assistant starts. Otherwise you’ll have to hard code the lat and long values in ambee_pollen.yaml. Here is the Automation I used.

  mode: single
- id: '1681655260973'
  alias: Pollen Sensors Update on Home Assistant start
  description: ''
  trigger:
  - platform: homeassistant
    event: start
  condition: []
  action:
  - alias: Add delay if necessary
    delay:
      hours: 0
      minutes: 1
      seconds: 0
      milliseconds: 0
  - service: homeassistant.update_entity
    data: {}
    target:
      entity_id:
      - sensor.pollen_data
      - sensor.pollen_grass
      - sensor.pollen_grass_count
      - sensor.pollen_trees
      - sensor.pollen_tree_count
      - sensor.pollen_weeds
      - sensor.pollen_weed_count
  mode: single

In case anyone is interested, here are my lovelace dashboards yaml for pollen sensors.

type: vertical-stack
cards:
  - type: horizontal-stack
    cards:
      - type: entity
        entity: sensor.pollen_trees
        state_color: true
        attribute: Total
      - type: entity
        entity: sensor.pollen_grass
        state_color: true
        attribute: Total
      - type: entity
        entity: sensor.pollen_weeds
        state_color: true
        attribute: Total
  - type: horizontal-stack
    cards:
      - type: entities
        entities:
          - type: attribute
            entity: sensor.pollen_trees
            attribute: Birch
            name: Birch
            icon: mdi:tree-outline
          - type: attribute
            entity: sensor.pollen_trees
            attribute: Cypress
            name: Cypress
            icon: mdi:pine-tree
          - type: attribute
            entity: sensor.pollen_trees
            attribute: Elm
            name: Elm
            icon: mdi:tree-outline
          - type: attribute
            entity: sensor.pollen_trees
            attribute: Hazel
            name: Hazel
            icon: mdi:tree
      - type: entities
        entities:
          - type: attribute
            entity: sensor.pollen_trees
            attribute: Oak
            name: Oak
            icon: mdi:tree
          - type: attribute
            entity: sensor.pollen_trees
            attribute: Pine
            name: Pine
            icon: mdi:pine-tree
          - type: attribute
            entity: sensor.pollen_trees
            attribute: Plane
            name: Plane
            icon: mdi:tree
          - type: attribute
            entity: sensor.pollen_trees
            attribute: Poplar
            name: Poplar
            icon: mdi:pine-tree-variant-outline

Dashboard screenshot - using entities cards with attributes

Out of idle curiousity, is anyone using their pollen/allergy data to trigger automations?

I have a set of strip lights beside my front door that I’d like to show the allergy/pollen level, by color, if I trigger a nearby motion sensor first. What I’ve got right now doesn’t seem to be working.

I do something similar for Air Quality. I have to lamps in different rooms that change color based on outdoor air quality. I also change the TV back-lights based on internal air quality. I have changed all my automations to Node-Red. I also send notifications to phones on a category change for air quality.

Post what you have as automation(s)

Phone notifications, to explain why we’re suddenly sneezing. It’s otherwise just informational for us — on a dashboard.

Mainly for a notification which sends me a list of which tree pollen is very high that morning, my goal is to try and identify which trees I am most sensitive to.

Here is the notification:

- id: '1681302892148'
  alias: Notify iPhone Tomorrow Pollen Very High
  description: ''
  trigger:
  - platform: state
    entity_id:
    - sensor.pollen_trees
    to: Very High
  - platform: state
    entity_id:
    - sensor.pollen_trees
    to: High
  condition:
  - condition: time
    after: 05:00:00
    before: '15:00:00'
    weekday:
    - sun
    - sat
    - fri
    - thu
    - wed
    - tue
    - mon
    enabled: true
  action:
  - service: notify.mobile_app_iphone
    data:
      title: "\U0001F927 Tree Pollen High \U0001F927"
      message: 'Birch: {{states.sensor.pollen_trees.attributes.Birch }}

        Cypress: {{states.sensor.pollen_trees.attributes.Cypress }}

        Elm: {{states.sensor.pollen_trees.attributes.Elm }}

        Hazel: {{states.sensor.pollen_trees.attributes.Hazel }}

        Oak: {{states.sensor.pollen_trees.attributes.Oak }}

        Pine: {{states.sensor.pollen_trees.attributes.Pine }}

        Plane: {{states.sensor.pollen_trees.attributes.Plane }}

        Poplar: {{states.sensor.pollen_trees.attributes.Poplar }}
1 Like

Do you think Ambee is more reliable/accurate than Accuweather?

I do absolutely. With tree pollen data accuweather under play the severity of tree pollen count like tomorrow.io. Also ambee breakdown tree pollen data by species of tree which is extremely useful for identifying which species you are allergic to.

UNFORTUNATELY Ambee contacted me yesterday and told me my API account trial has expired and that I need to move to premium. Not something I’m interested in doing. I’m going to keep searching for a FREE API which can offer this data.