Pollen (again) but for the UK

Tags: #<Tag:0x00007f739bc88f28> #<Tag:0x00007f739bc88cd0>

There are very many pollen threads on the community but I couldn’t find a decent one providing pollen count for the UK. Tado introduced an air quality report some time ago and a quick poke around their web app revealed the API calls to get the data.

Simple authenticated rest call to get the JSON plus some template sensors to get the air quality for today plus pollen levels for today, tomorrow and the after. They also provide pollution levels in the json response but would be easy enough to add these as additional sensors.

You’ll need your tado home ID, lat & long plus your tado username and password

sensor:
  - platform: rest
    # API call to get air quality
    # Result goes into outdoorQuality attribute in JSON format
    name: TadoAir
    verify_ssl: true
    scan_interval: 1800
    resource: https://acme.tado.com/v1/homes/XXX/airComfort?latitude=XXX1&longitude=XXXX&username=XXXXX&password=XXXXXXXXXXXXXXXXXX
    headers:
      User-Agent: Home Assistant
      Content-Type: application/json
    method: GET
    json_attributes:
      - roomMessages
      - outdoorQuality
    value_template: 'Tado airComfort'

  # Enumerate JSON to populate various template sensors
  - platform: template
    sensors:
      air_quality:
        value_template: '{{ states.sensor.tadoair.attributes["outdoorQuality"]["aqi"]["level"]  | capitalize }}'
        friendly_name: "Air Quality"
        icon_template: mdi:air-filter

      # Pollen sensors
      air_pollen_level:
        value_template: '{{ states.sensor.tadoair.attributes["outdoorQuality"]["pollens"]["dominant"]["level"]  | capitalize }}'
        friendly_name: "Pollen Level"
        icon_template: mdi:flower

      air_pollen_level_grass:
        value_template: '{{ states.sensor.tadoair.attributes["outdoorQuality"]["pollens"]["types"][0]["forecast"][0]["level"] | capitalize }}'
        friendly_name: "Pollen Level Grass"
        icon_template: mdi:flower

      air_pollen_level_grass_tomorrow:
        value_template: '{{ states.sensor.tadoair.attributes["outdoorQuality"]["pollens"]["types"][0]["forecast"][1]["level"] | capitalize  }}'
        friendly_name: "Pollen Level Grass Tomorrow"
        icon_template: mdi:flower

      air_pollen_level_weed:
        value_template: '{{ states.sensor.tadoair.attributes["outdoorQuality"]["pollens"]["types"][1]["forecast"][0]["level"] | capitalize  }}'
        friendly_name: "Pollen Level Weed"
        icon_template: mdi:sprout

      air_pollen_level_weed_tomorrow:
        value_template: '{{ states.sensor.tadoair.attributes["outdoorQuality"]["pollens"]["types"][1]["forecast"][1]["level"] | capitalize  }}'
        friendly_name: "Pollen Level Weed Tomorrow"
        icon_template: mdi:sprout

      air_pollen_level_tree:
        value_template: '{{ states.sensor.tadoair.attributes["outdoorQuality"]["pollens"]["types"][2]["forecast"][0]["level"] | capitalize  }}'
        friendly_name: "Pollen Level Tree"
        icon_template: mdi:tree

      air_pollen_level_tree_tomorrow:
        value_template: '{{ states.sensor.tadoair.attributes["outdoorQuality"]["pollens"]["types"][2]["forecast"][1]["level"]  | capitalize }}'
        friendly_name: "Pollen Level Tree Tomorrow"
        icon_template: mdi:tree


4 Likes

Great piece of work - many thanks!

I’ve set up a tado account to try this but I get "User is not authorized to access this resource with an explicit deny" when I try the GET.

Where do I find the Home ID, I’ve tried the name of “Home” in settings ?

EDIT: looking at the API I think you need devices set up for this to work ?

you can find out your home ID by issuing the rest call

https://my.tado.com/api/v2/me?username=XXXXXX&password=XXXX

the value will be under [“homes”][0][“id”]

Not sure what other Tado kit you need for this to work. I’m fully bought into the system with boiler control and TRVs

That worked, I’ve got no devices, thanks

@drillbit This has stopped working for me, is it stiil working for you ?

Yes - still working for me. Possibly stopped working for you if you don’t have any Tado kit