Pollen platform not updating

I haven’t changed my pollen.com sensor since April 3, and I’ve been keeping pace with HASS upgrades, but I simply get “unavailable” in my pollen sensor. I can’t see any logging with ‘pollen’ in it, either. Any ideas?

sensor:
  - platform: pollen
    zip_code: "17015"
    monitored_conditions:
      - allergy_index_today

same here. The command line example.py from pypollencom seems to return results successfully, so i wonder if pollen.com changed the json response and the hass component can’t parse it correctly.

i think these issues are known (or at least it looks similar to recent issues). @bachya, is there a fix? pollen.com looks like it’s currently up and running. i’m on 0.74.1

2018-07-26 08:14:18 ERROR (MainThread) [homeassistant.components.sensor] pollen:
Error on device update!
Traceback (most recent call last):
File “/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/ent
ity_platform.py”, line 248, in _async_add_entity
await entity.async_device_update(warning=False)
File “/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/ent
ity.py”, line 317, in async_device_update
yield from self.async_update()
File “/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/
sensor/pollen.py”, line 186, in async_update
data = self.pollencom.data[self._category].get(‘Location’)
KeyError: ‘allergy_index’

Hi all – sorry that you’re having difficulties.

My setup, which has this config:

sensor:
    - platform: pollen
      zip_code: !secret pollen_zip_code
      monitored_conditions:
        - allergy_average_forecasted
        - allergy_average_historical
        - allergy_index_today
        - allergy_index_tomorrow
        - allergy_index_yesterday
        - disease_average_forecasted

…is displaying fine:

However, @Human’s configuration does, indeed, yield “Unavailable” for that single sensor. I’ll look into that today. @bnhhass and @creakyshrimp, if you can provide more detail (your config, whatever exactly is going wrong, etc.), I can diagnose those, as well.

this was my configuration.
- platform: pollen
zip_code: “61822”
monitored_conditions:
- allergy_index_today
- allergy_index_tomorrow

never saw any errors, warnings or anything in the hass log. I just restarted with the config you posted, and it updates the sensor successfully. i guess i’ll just ignore the monitored_conditions that i don’t want in the UI. thx.

Thanks, @bnhhass. That actually confirms a suspicion I had and reveals a bug. I’ll get it fixed for 0.75; once you update to that, you can return to doing things the “correct” way. Thanks for your help!

FYI –

Bug: https://github.com/home-assistant/home-assistant/issues/15693
PR: https://github.com/home-assistant/home-assistant/pull/15694

2 Likes

cool. monitoring all 3 fixed the problem for now. i also see the quirk where sensor.cold__flu_forecasted_average has changed to sensor.cold__flu_forecasted_average_2, but that’s easy enough to work around.

@bachya thank you!

Much appreciated!