Getting my pollen forecast into Home Assistant

2025-04-28

As someone who is affected by various plants' pollen, knowing in advance how bad it's going to be helps planning the day and anticipate allergy-related malady.

My country's meteorological service publishes pollen forecasts on their website, including per-state maps. It has become a ritual to visit their site every morning to check out the updated forecast, which is slightly inconvenient.

The forecast map is an image with a dynamic URL that is updated daily, so to get this into the Home Assistant dashboard, I need something that:

The dynamic URL has a static prefix, followed by /<state name>/<year><month><day><plant name>. For my purposes, <state name> and <plant name> are static enough, so I only need to template the date.

Solution

Surprisingly, the camera integration fits the bill perfectly, as simply as that:

camera:
  - platform: generic
    name: Birch pollen load today
    still_image_url: https://www.zamg.ac.at/zamgrastergfx/gfx/pollen/salzburg/{{ now().year }}{{ now().month }}{{ now().day }}birke

The image is fetched once and cached for as long as the URL remains the same, resulting in clean 24 hour caching and maximum grace.

As this creates a camera entity, any dashboard widget supporting cameras can be used, which makes showing the image easy.

pollen maps in Home Assistant dashboard

To spruce things up a little, I'm also displaying the latest measurements from my particulate matter sensors.

Future potential

Most of the year, I don't care, so calendar based visibility in the dashboard would be neat.

Even better would be visibility that's based on whether there is any pollen activity. That could work by generating a color histogram of the image and counting the pollen-indicating pixels.

Such analysis could also be used for alerting.