Pollen/Allergy Sensor

Anyone find the socialpollen api no longer works?
Any alternative for UK pollen forecase?

Yea, socialpollen always been a bit flakey… haven’t found anything else unfortunately…

1 Like

I’ve installed Climacell in HACS and seems to work OK. No pollen in the custom component but the API can provide it so have raised an issue on Github for @r-renato to see if they can add it (and air quality)

Pollen and Air quality has been added.

1 Like

Excellent, I’ve got it working, thankyou!
any idea what scale the pollen index is on?

This is from Climacell’s docs, hope that helps:

1 Like

Thanks mate, much appreciated!

How does it work? For me it’s binary. 1 or 0 for each climacell pollen sensor. Is this correct?!

See above for the table for the levels.
I’ve noticed recently that, for me in the UK, that it seems to be wrong, maybe its a UK thing.
Today it is showing low(1) but every other website shows it is high.
I’ve just moved onto using scrape to get the levels from a website, seems to be OK so far.

Yeah that’s why I didn’t trust the table! :smiley:
Would you mind sharing your scrape settings?
Thanks!!

Sure, you’ll need to visit weather.com and get the url for your location and replace in all the sensors
I’m no expert (took a lot of trial and error!) so might be an easier way to do it

- platform: scrape
  resource: https://weather.com/en-GB/forecast/allergy/l/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
  select: "._-_-components-src-organism-PollenBreakdown-PollenBreakdown--body--OrmOR > div:nth-of-type(1) > div:nth-of-type(1) > div:nth-of-type(2) > ul:nth-of-type(1) > li:nth-of-type(1) > strong:nth-of-type(1)"
  name: Pollen Today Tree
  scan_interval: 86400

- platform: scrape
  resource: https://weather.com/en-GB/forecast/allergy/l/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
  select: "._-_-components-src-organism-PollenBreakdown-PollenBreakdown--body--OrmOR > div:nth-of-type(2) > div:nth-of-type(1) > div:nth-of-type(2) > ul:nth-of-type(1) > li:nth-of-type(1) > strong:nth-of-type(1)"
  name: Pollen Today Grass
  scan_interval: 86400

- platform: scrape
  resource: https://weather.com/en-GB/forecast/allergy/l/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
  select: "._-_-components-src-organism-PollenBreakdown-PollenBreakdown--body--OrmOR > div:nth-of-type(3) > div:nth-of-type(1) > div:nth-of-type(2) > ul:nth-of-type(1) > li:nth-of-type(1) > strong:nth-of-type(1)"
  name: Pollen Today Weed
  scan_interval: 86400

- platform: scrape
  resource: https://weather.com/en-GB/forecast/allergy/l/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
  select: "._-_-components-src-organism-PollenBreakdown-PollenBreakdown--body--OrmOR > div:nth-of-type(1) > div:nth-of-type(1) > div:nth-of-type(2) > ul:nth-of-type(1) > li:nth-of-type(2) > strong:nth-of-type(1)"
  name: Pollen Tomorrow Tree
  scan_interval: 86400

- platform: scrape
  resource: https://weather.com/en-GB/forecast/allergy/l/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
  select: "._-_-components-src-organism-PollenBreakdown-PollenBreakdown--body--OrmOR > div:nth-of-type(2) > div:nth-of-type(1) > div:nth-of-type(2) > ul:nth-of-type(1) > li:nth-of-type(2) > strong:nth-of-type(1)"
  name: Pollen Tomorrow Grass
  scan_interval: 86400

- platform: scrape
  resource: https://weather.com/en-GB/forecast/allergy/l/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
  select: "._-_-components-src-organism-PollenBreakdown-PollenBreakdown--body--OrmOR > div:nth-of-type(3) > div:nth-of-type(1) > div:nth-of-type(2) > ul:nth-of-type(1) > li:nth-of-type(2) > strong:nth-of-type(1)"
  name: Pollen Tomorrow Weed
  scan_interval: 86400
7 Likes

Climacell pollen sensors seem to have stopped working for me in the last few days (since I updated hassio and the custom component.) Do any of you have it working still?

this works thankyou!

I’ve just switched to this, no more scraping needed and I just setup a tado account with no devices.

1 Like

Got lots of great ideas from this thread, and I’ve been using the scraper that @Holdestmade put up there.

I’ve set up a RESTful sensor to pull the data from The Weather Network (Canadian weather site).

I’ve used the following link, with the code at the end being the location code for my area: https://www.theweathernetwork.com/api/data/XXXXXXXX

And this is the code I added to my configuration.yaml:

sensor:
  - platform: rest
    resource: https://www.theweathernetwork.com/api/data/XXXXXXXX
    name: Pollen Level
    value_template: '{{ value_json.obs.pollen_index }}'

I’m going to expand this to pull a few other data points from the data, works very well.

1 Like

Hi,
I like what you have done. Is it possible to get multiple data values, not just pollen, with one rest call?
thx

There’s tons of data I can see that you could scrape out of the data file, I just opened the linked data in NotePad++ to find the values I was looking for.

I don’t know if you can do it in one single rest call, that’s beyond what I’ve tried. So far I have a bunch of rest calls for data points.

Yes, thanks. I too used Notepad++ to see the data and there is a lot of good info. I was hoping to scrape more than one field with just the one call. Indeed, you can with some examples here.
https://www.home-assistant.io/integrations/rest/

I’d love some help simplifying my RESTful call, I’m using a bunch like this:

  # weather network environment data
sensor:
  - platform: rest
    resource: https://www.theweathernetwork.com/api/data/XXXXXXXX
    name: Pollen Level
    value_template: '{{ value_json.obs.pollen_index }}'

  - platform: rest
    resource: https://www.theweathernetwork.com/api/data/XXXXXXXX
    name: UV Index
    value_template: '{{ value_json.obs.uv_label }}'

This is what I’m trying, but I can’t seem to get it to work.

  - platform: rest
    name: Weather Network Data
    resource: https://www.theweathernetwork.com/api/data/XXXXXXXX
    json_attributes:
      - pollen_index
      - uv_label
    value_template: '{{ value_json.obs }}'
  - platform: template
    sensors:
      pollen:
        value_template: '{{ states.sensor.weather_network_data.attributes["pollen_index"] }}'
        friendly_name: 'Pollen'
      uv_level:
        value_template: '{{ states.sensor.weather_network_data.attributes["uv_label"] }}'
        friendly_name: 'UV Level'

Obviously this should be done with one REST call, but I cannot get it to work. Help please! There’s about a half dozen datapoints I want to pull this way :slight_smile:

This is what I have done and it works well. Just add the datapoints that you need.

  - platform: rest
    resource: https://www.theweathernetwork.com/api/data/caon9999
    name: weather_network
    json_attributes:
      - obs
    value_template: 'OK'      
    scan_interval:
      minutes: 160

  - platform: template
    sensors:
      weather_network_pollen_index:
        value_template: '{{ states.sensor.weather_network.attributes["obs"]["pollen_index"] }}'
      weather_network_pollen_name:
        value_template: '{{ states.sensor.weather_network.attributes["obs"]["pollen_name"] }}'
      weather_network_temperature:
        value_template: '{{ states.sensor.weather_network.attributes["obs"]["t"] }}'
        device_class: temperature
        unit_of_measurement: '°C'

3 Likes

Thanks @fantangelo this is great!

This is what I ended up with, working perfectly.

# weather network environment data
sensor:
  - platform: rest
    resource: https://www.theweathernetwork.com/api/data/XXXXXXXX
    name: weather_network
    json_attributes:
      - obs
      - swo
    value_template: 'OK'
    scan_interval:
      minutes: 160

  - platform: template
    sensors:
      weather_network_pollen_index:
        value_template: '{{ states.sensor.weather_network.attributes["obs"]["pollen_index"] }}'
        friendly_name: 'Pollen Index'
      weather_network_pollen_name:
        value_template: '{{ states.sensor.weather_network.attributes["obs"]["pollen_name"] }}'
        friendly_name: 'Pollen Risk Type'
      weather_network_uv_index:
        value_template: '{{ states.sensor.weather_network.attributes["obs"]["uv_label"] }}'
        friendly_name: 'UV Index'
      weather_network_air_quality:
        value_template: '{{ states.sensor.weather_network.attributes["obs"]["aq_level"] }}'
        friendly_name: 'Air Quality'
      weather_network_temperature:
        value_template: '{{ states.sensor.weather_network.attributes["obs"]["t"] }}'
        friendly_name: 'Temperature (Weather Network)'
        device_class: temperature
        unit_of_measurement: '°C'
      weather_network_swo_level:
        value_template: '{{ states.sensor.weather_network.attributes["swo"]["swo_level"] }}'
        friendly_name: 'Severe Weather Risk Level'
      weather_network_swo_type:
        value_template: '{{ states.sensor.weather_network.attributes["swo"]["swo_type"] }}'
        friendly_name: 'Severe Weather Risk Type'
4 Likes