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
I’m trying to use this as Tado seems to have a better Pollen prediction than anything else I can find.
The code above works fine, but the API call seems to return data that’s a day old. Today (Sat) it returns info for Today, Sat and Sun whereas it should be Today, Sun and Mon.
So, using this API I get:
Today (Medium), Sat (Medium), Sun (High)
With the phone app I get:
Today (Medium), Sun (High), Mon (High)
It looks like it’s the API, not your code as the raw API results match this. Any ideas?
Just in case anyone is interested, I raised a change for the Node-Red tado client to include the detailed pollen info and it’s been added into the latest release. This seems to match what is shown in the Tado app and should now be easy to use this to create/update entities in Hass.
Thanks for this. I can confirm that this Tado API rest sensor code is still mostly working. Really helpful in the absence of an official API or documentation for Tado API v1.
I made a few fixes/changes.
the capitalisation in the template was causing values with NONE to come through as Unknown. I think as these level values are now coming through from Tado in capitals, this part of the template is unneccesary.
I didn’t see the point in adding roomMessages to the TadoAir sensor attributes. This part of the JSON and associated values are not needed for any of the outdoor air quality data from Tado.
I corrected some of the templates because I felt based on looking at the data coming back in the JSON, 0 actually appears to be yesterdays date, 1 has a date matching todays date and 2 had a date matching tomorrows date. I’m unsure as to why Tado send the data in this way.
I changed the MD icons so that grass had a grass icon instead of flower, and pollen level has a pollen icon.
## credit to drillbit from HA forums for the template work
- platform: rest
# API call to get air quality
# Result goes into outdoorQuality attribute in JSON format
name: TadoAir
scan_interval: 1800
resource: !secret tado_rest_resource
headers:
User-Agent: Home Assistant
Content-Type: application/json
json_attributes:
- 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"]}}'
friendly_name: "Air Quality"
icon_template: mdi:air-filter
# Pollen sensors
air_pollen_level:
value_template: '{{ states.sensor.tadoair.attributes["outdoorQuality"]["pollens"]["dominant"]["level"]}}'
friendly_name: "Pollen Level"
icon_template: mdi:flower-pollen
air_pollen_level_grass:
value_template: '{{ states.sensor.tadoair.attributes["outdoorQuality"]["pollens"]["types"][0]["forecast"][1]["level"]}}'
friendly_name: "Pollen Level Grass"
icon_template: mdi:grass
air_pollen_level_grass_tomorrow:
value_template: '{{ states.sensor.tadoair.attributes["outdoorQuality"]["pollens"]["types"][0]["forecast"][2]["level"]}}'
friendly_name: "Pollen Level Grass Tomorrow"
icon_template: mdi:grass
air_pollen_level_weed:
value_template: '{{ states.sensor.tadoair.attributes["outdoorQuality"]["pollens"]["types"][1]["forecast"][1]["level"]}}'
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"][2]["level"]}}'
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"][1]["level"]}}'
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"][2]["level"]}}'
friendly_name: "Pollen Level Tree Tomorrow"
icon_template: mdi:tree
Yeah the template is also throwing up an error for me. Perhaps Tado has changed the structure of the JSON, I haven’t had a chance to check yet. Let me know here if you find anything.
EDIT: Made a quick GET request to Tado’s restful API, the API is returning UNKNOWN in those fields too. Updating the get request to use Tado’s API v2 with the following URL returns an error with title “current user is not allowed access to this resource”
tried the headers airQuality, airComfort, outdoorQuality and all of them return the same error. perhaps someone else will find the right GET request for a newer version of the API (such as V2) assuming pollen is still something available to users of the web app or mobile app. I can get airComfort, but it no longer contains pollen in API v2. My guess is they’ve stopped paying for the external API that they were using to get aqi, pollens and pollutants for the outdoorQuality values in V1 of their API.
API (at least v1) has the outdoorquality and pollen returned in the json data but UNKNOWN. Given that the pollen stats and AQI no longer appear in the mobile or web apps, I suspect they’ve removed this feature