Pollen/Allergy Sensor

Took a look at Air Matters. It’s possible to reverse engineer the API from the mobile app, but one main issue prevent me from proceeding: it looks like each request is signed with some sort of authorization header (to validate request authenticity, I assume).

I’m reaching out to their business development folks to see if they’d be willing to help. Stay tuned.

1 Like

FYI, haven’t heard back from the Air Matters people and nothing in the unpublished API, so that one appears to be off the table for now. Sorry!

While there are still no components for those suffering in the UK, I’ve hacked myself following REST sensor:

- platform: rest
  name: "Pollen count"
  resource: "https://socialpollencount.co.uk/api/forecast?location=[YOUR_LAT, YOUR_LON]"
  value_template: >
    {% for day in value_json.forecast -%}
      {%- if now().date() | string() in day.date %}
        {{ day.pollen_count }}
      {% endif -%}
    {%- endfor %}
4 Likes

And here is one for next day (forecast):

- platform: rest
  name: "Pollen count tomorrow"
  resource: "https://socialpollencount.co.uk/api/forecast?location=[YOUR_LAT, YOUR_LON]"
  value_template: >
    {% set tomorrow = (as_timestamp(now()) + 86400) | timestamp_custom("%Y-%m-%d") | string %}
    {% for day in value_json.forecast -%}
      {%- if tomorrow in day.date %}
        {{ day.pollen_count }}
      {% endif -%}
    {%- endfor %}
4 Likes

I don’t seem to be getting any response from this. When testing using APItester.com i get this as a response.
{“status_code”:“403 Forbidden”,“date”:“2018-06-25T15:39:39+00:00”,“message”:“Could not parse location”}

I’m using my LAT and LON from Wunderground i.e. 51.30, -0.141
this is just a field so u can;t spy on me :smile:

Hmm if i use that other persons LAT and LON it works
https://community.home-assistant.io/t/pollen-count/21283

I suspect they don’t have anything near my location, even removing a few digits or putting the word london does work.

Any one know how to pull from the website what it’s using to give the details when i got to the page directly ?

@cooljimy84

Try this one, it needs the [ ] brackets (the %5B and %5D encoding):

https://socialpollencount.co.uk/api/forecast?location=[51.30,-0.141]

for swiss people, I use the following webpage : http://teletext.api.swisstxt.ch/mobile/pics/large/RTSUn_518-00.gif

and do a little script with tesseract.

1 Like

Would this be useful for Europe?

http://www.regional.atmosphere.copernicus.eu/

const API_KEY = 'CSIBZ-4LKWV-HNIPZ-UYVZG-BYG6O-PSBMP'

Where did he get that from? :laughing:

1 Like

I GOT IT. Instead of reverse engineering the Air Matters iOS app, I went after the web app – I think I’ve got what I need. Will start working on a library for the integration ASAP.

4 Likes

Not sure what i was doing wrong, but that worked fine ?!?!?

Awesome.

Anyone else having issues with the pollen.com sensors?

me too… getting

2018-07-05 08:58:56 ERROR (SyncWorker_3) [homeassistant.components.sensor.pollen] An error occurred while retrieving data
2018-07-05 08:58:57 ERROR (SyncWorker_1) [homeassistant.components.sensor.pollen] Pollen.com API didn't return any data```
1 Like

The website is down. You can check the same by visiting the website. Current Pollen Allergy Forecast for Austin, TX (73344) | Pollen.com<ZIP_CODE>

Website works but still getting the API errors in the log.

@cooljimy84 @davefi

Is this platform (socialpollencount) working?

I get:-

{"status_code":"200 OK","date":"2019-02-15T18:57:25+00:00","forecast":[]}

Surely the pollen information should be in the forecast payload?

Thanks

Sorry @daneboom, I never actually used it so can’t really comment more than to say I get the same as you - nothing in the forecast payload.

If you go to the site directly (not the api URL), then it seems to be half missing (lots of blank areas) so it looks like its not working (properly?) right now.

1 Like

Developer here. Their private API isn’t the most stable, unfortunately; however, they’re usually quick to correct issues.