Add Google Pollen, Solar and Air Quality API

Use the Pollen API to get pollen information including types, plants, and indexes for a specific location.

Documentação da Plataforma Google Maps  |  Pollen API  |  Google for Developers.

They also provide API’s for Solar and Air Quality.
Maybe also interesting.

Thanks in advance

2 Likes

If I’m reading this correctly, it requires payment:

Unfortunately you’re right

How about iqvia integration: IQVIA - Home Assistant

It has pollen information, though not very detailed.

Unfortunately not usable for people outside the U.S. as it is based on a U.S. ZIP code.

Just come looking for a pollen sensor for HA - this would hugely help with the WAF (wife acceptance factor).

The Google API is likey comprehensive and it seems like the pricing works out to be about 3.5 bucks a year… Assuming 1 call per day.

I’d love to see this data in HA and especially the health recommendation…

2 Likes

You get 200$ in credits each month, so it should end up with no cost for the Google Pollen API.

1 Like

Man, I wish I was even slightly better at programming. The API documentation is great and almost within my reach. They even show you how to generate heat maps of pollen through the API!

Google Maps Pollen API - Heat Maps

1 Like

I started getting Google’s AQII API Integrated.
if you’re interested you may add id as custom component through HACS:

2 Likes

I’ve just made a custom component for the Google Pollen API (with a lot of help from Copilot!):

Also note that in a few days, they change from giving free monthly credits to free monthly usage. I believe 5000 calls per month towards the Pollen API will be free:

5 Likes

First of all, thanks for this great integration @svenove ,it works really well!

I was looking into the API call frequency and noticed that in sensor.py, the SCAN_INTERVAL is set to:

SCAN_INTERVAL = timedelta(hours=1)

This would mean the integration calls the API once per hour, resulting in 24 requests per day ~720 requests per month then.

Given that Google’s new pricing model for Pro-tier allows 5,000 free API calls per month, this should be well within the free limit. Could you confirm that this understanding is correct? Also, do you foresee any scenarios where the integration might exceed this limit, or is this the expected behavior?

Thanks again for your hard work on this integration!

1 Like

This would mean the integration calls the API once per hour, resulting in 24 requests per day ~720 requests per month then.

I belive in the latest version, I’ve set 4 hours.
But yes, that’s how it works (+ one API call when you restart Home Assistant).

Given that Google’s new pricing model for Pro-tier allows 5,000 free API calls per month, this should be well within the free limit. Could you confirm that this understanding is correct? Also, do you foresee any scenarios where the integration might exceed this limit, or is this the expected behavior?

Correct. It’s also possible to configure a hard limit on the Google Cloud Console with a max daily API-calls. When the limit is reached, the API-calls will fail (until next day). Setting this to 160 per day would keep you within the limits in the event somethings goes wrong and the API gets called “out of control” (doubt it will happen, but never know with computers… :stuck_out_tongue: )

Instructions is added to the Readme of the current dev-version, here:

1 Like

Thanks a lot for this, buymeacofee link on github doesnt work :wink:

1 Like

Hey chiming in, just setup the Google Pollen API and it’s working great (thanks svenove). Unfortunately the data itself may be incomplete in some areas. For example in southern California, the google API is returning “None” for Tree pollen where Accuweather shows Moderate.

As another alternative for the Netherlands, UK, France, Italy, and US I just found the kleenex pollenradar. I’m slightly amused but it works.

Edit: hmm this may be a general issue with pollen reporting from different sources.

1 Like

Thanks! Turns out I had to supply them with my bank details for it to work… :man_facepalming:t3: it’s working now! :slightly_smiling_face:

Yeah, Google makes it own forecasts with its own data/models. So it seems it’s not basing it on actual measurements (like some of the national weather services do). So I guess the accuracy will vary quite a bit around the world.

1 Like

Hello,
I integrate the google pollen api today and it works 4 hours since I have no data.
I delete the Service but now I have an api kay Error ? I m isolate with this issue or it a google problem ?
thanks for your job

Hello,
I integrate the google pollen api today and it works 4 hours since I have no data.
I delete the Service but now I have an api kay Error ? I m isolate with this issue or it a google problem ?
thanks for your job

I Answer myself I used a credit card on my google acount who expired yesterday :wink:

1 Like

Getting something a bit weird. Install through HACS succeed, it does show the component in the folder and the device shows up but I’m not being prompted for the configuration. Removed/reinstalled with appropriate reboots and results remain the same. Ideas?

For those who prefer working with Node-RED, here’s a simple flow fragment that uses the Google Pollen API to a render a human-readable pollen forecast.

[{"id":"81c628171945c3f0","type":"function","z":"b187d28b.8b454","name":"Check All Pollens and Format","func":"// Uses Google Pollen API\n\nvar pollen_details = \"\";\n\n// Get pollen levels for each type\nvar tree_level = msg.payload.dailyInfo[0].pollenTypeInfo[1].indexInfo.category;\nvar grass_level = msg.payload.dailyInfo[0].pollenTypeInfo[0].indexInfo.category;\n\n\n\n// Create wordsmithed message\nif (grass_level == tree_level) {\n    pollen_details = tree_level + \" for all pollens\";\n} else {\n    if (grass_level == tree_level) {\n        pollen_details = tree_level + \" for tree and grass pollens.\";\n    } else {\n        pollen_details = tree_level + \" for tree and \" + grass_level + \" for grass pollens.\";\n    }\n}\n\nmsg.payload = \"The pollen risk is \" + pollen_details;\n\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":770,"y":3120,"wires":[["f5a09b60e89a2a5a"]]},{"id":"895974f9e8d2409f","type":"inject","z":"b187d28b.8b454","name":"2 hours","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"7200","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":160,"y":3120,"wires":[["da8aa7d838563611"]]},{"id":"da8aa7d838563611","type":"http request","z":"b187d28b.8b454","name":"Google Pollen API","method":"GET","ret":"obj","paytoqs":"ignore","url":"https://pollen.googleapis.com/v1/forecast:lookup?key=[API_KEY]&location.longitude=-121.91&location.latitude=46.20&plantsDescription=false&days=1","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"","senderr":false,"headers":[],"x":410,"y":3120,"wires":[["81c628171945c3f0"]]},{"id":"f5a09b60e89a2a5a","type":"ha-sensor","z":"b187d28b.8b454","name":"Pollen Forecast","entityConfig":"db2a945f34d4f509","version":0,"state":"payload","stateType":"msg","attributes":[],"inputOverride":"allow","outputProperties":[],"x":1080,"y":3120,"wires":[[]],"server":""},{"id":"db2a945f34d4f509","type":"ha-entity-config","server":"","deviceConfig":"","name":"sensor config for Pollen Forecast","version":"6","entityType":"sensor","haConfig":[{"property":"name","value":"weather.pollen_forecast"},{"property":"icon","value":""},{"property":"entity_picture","value":""},{"property":"entity_category","value":""},{"property":"device_class","value":""},{"property":"unit_of_measurement","value":""},{"property":"state_class","value":""}],"resend":true,"debugEnabled":false}]

The Google Pollen API returns a lot of data, but I chose to report only tree and grass data on my dashboard.

If you want to see what other data you can access, just add a Debug node set to “Complete message object” to the output of the “Google Pollen API” node.

1 Like