Pollen tracker in Wunderground plugin [solved]

Various weather sites track pollen count, including weather underground. I think it would be great to be able to track pollen from my HASS dashboard too.
https://www.wunderground.com/us/wa/college-place/zmw:99324.1.99999/health#grass

I agree, but I had to laugh when I saw your forum name.

I think this might be better done as a separate sensor, since I know that @balloob really wants to get the weather components merged into one weather platform as opposed to a bunch of separate sources.

1 Like

You can use a rest sensor to track the pollen level in your area. See relevant sensor here

2 Likes

I like that idea. But knowing what the !secret pollen_url is might help! Uf it contains an API key or something, can you just point us to a signup page?

Here are the URLs:

pollen_url: https://www.pollen.com/api/forecast/current/pollen/ZIPCODE
cold_flu_url: https://www.pollen.com/api/forecast/extended/cold/ZIPCODE
4 Likes

Thanks - I’ll give this a try. I like what you did with the data further down the config example. Always learn new approaches from your examples, thanks again!

Are you a wizard?! Thank you so much for your code. And how the heck did you find those API links?

Here’s the setup that worked for me, just in case anyone else reading and wondering (replace ZIPCODE with your zipcode):

sensor:
  - platform: yr
    monitored_conditions:
      - temperature
      - symbol
  - platform: rest
    name: pollen
    resource: https://www.pollen.com/api/forecast/current/pollen/ZIPCODE
    #note: API link is not accessable by web browser, this is normal
    value_template: "{{value_json.Location.periods[1].Index}}"
    scan_interval: 21600
    headers:
       Referer: "https://www.pollen.com"
       
  - platform: template
    sensors:
      pollen_level:
        friendly_name: 'Pollen Level'
        value_template: >-
          {%- if states.sensor.pollen.state|float <= 2.4 %}
              Low
          {%- elif states.sensor.pollen.state|float <= 4.8 %}
              Med/Low
          {%- elif states.sensor.pollen.state|float <= 7.2 %}
              Med
          {%- elif states.sensor.pollen.state|float <= 9.6 %}
              Med/High
          {%- elif states.sensor.pollen.state|float <= 12.0 %}
              High
          {% else %}
              Unknown
          {%- endif %}

I also added a line to my homeassistant:customize: area

  customize:
    switch.porch_light:
        friendly_name: Porch Light
        icon: mdi:lightbulb-on-outline
    sensor.yr_symbol:
        friendly_name: Weather
    sensor.yr_temperature:
        friendly_name: Outside
    sun.sun:
        friendly_name: Solar angle
    sensor.pollen:
        hidden: true
    sensor.pollen_level:
        friendly_name: "Pollen"
5 Likes

Awesome! Been looking for something like this for ages. Thanks you! Is it possible to get any more detail from the API or is it just the pollen numbers?