A custom Home Assistant integration that reads the current pollen threat level for any location in the Czech Republic directly from the ČHMÚ Pylový semafor map image.
During setup, the live ČHMÚ pollen map is displayed in your browser. You click your location on the map and the integration samples the colour at that exact pixel every 12 hours, converting it to a numeric threat level. The national forecast table is used as a fallback if the image is unavailable.
pyl_M1.png (ČHMÚ map image)
│
▼
pixel colour at your chosen point
│
▼
HSV hue → pollen level 0–4
│
▼
sensor.pollen_level
| Value | Label | Czech |
|---|---|---|
0 |
negligible | zanedbatelná |
1 |
low | mírná |
2 |
moderate | střední |
3 |
high | vysoká |
4 |
extreme | mimořádná |
0 is the default when pollen season hasn't started or data is unavailable.
- Home Assistant 2023.6 or newer
- Python packages (installed automatically by HA):
beautifulsoup4 >= 4.12.0Pillow >= 10.0.0
- Open HACS → Integrations → ⋮ → Custom repositories
- Add this repository URL, category Integration
- Install CHMI Pylový semafor
- Restart Home Assistant
- Copy the
custom_components/chmi_pollen/folder into yourconfig/custom_components/directory - Restart Home Assistant
- Go to Settings → Devices & Services → Add Integration
- Search for CHMI Pollen
- Enter a name for this sensor (e.g.
Plzeň home) - A browser tab opens showing the live ČHMÚ pollen map — click your location
- Press Confirm location — the tab closes and the sensor is created
You can add multiple sensors for different locations by repeating the setup.
Entity: sensor.pollen_level (or sensor.<location_name>_pollen_level)
State: integer 0–4
| Attribute | Description |
|---|---|
level_label |
Human-readable level (negligible, low, …) |
forecast |
4-day forecast array from the national table [{day, date, level, label}] |
dates |
List of forecast dates |
source |
map or table — which data source was used |
map_level |
Raw level from image colour sampling |
table_level |
Raw level from the forecast table |
map_x_frac |
Horizontal position on the map image (0–1) |
map_y_frac |
Vertical position on the map image (0–1) |
location |
The name you gave this sensor |
source_url |
Link to the ČHMÚ page |
alias: High pollen alert
trigger:
- platform: numeric_state
entity_id: sensor.pollen_level
above: 2
action:
- service: notify.mobile_app_your_phone
data:
title: "🌿 High pollen warning"
message: >
Pollen level is {{ states('sensor.pollen_level') }}
({{ state_attr('sensor.pollen_level', 'level_label') }}) today.alias: Close windows on high pollen
trigger:
- platform: numeric_state
entity_id: sensor.pollen_level
above: 2
action:
- service: cover.close_cover
target:
entity_id: cover.living_room_windowtype: entity
entity: sensor.pollen_level
name: Pollen today
icon: mdi:flower-pollen-
Map image:
https://intranet.chmi.cz/files/portal/docs/meteo/ok/pyly/pyl_M1.png
Updated daily by ČHMÚ. The integration proxies this image through HA's HTTP layer so the browser canvas can read pixel colours without cross-origin restrictions. -
Forecast table:
https://intranet.chmi.cz/files/portal/docs/meteo/ok/pyly/pylovy_semafor.html
Used to populate the 4-dayforecastattribute and as fallback for the current level.
Note: Both URLs are on the
intranet.chmi.czsubdomain but are publicly accessible. If they ever return 403, the public mirror atportal.chmi.czuses the same path.
Sensor always shows 0
The clicked point may have landed on the map background (white area outside Czech Republic borders). Delete the integration and re-add it, clicking a point clearly inside the country.
source attribute shows table
The map image could not be fetched. Check HA logs for CHMI pollen map fetch failed. The national table value is used instead.
Setup tab shows 404
The HTTP views were not registered. Make sure you have no stale chmi_pollen entries from a previous install. Restart HA after copying the files and try again.
Setup tab shows 401
All picker endpoints are unauthenticated by design — the flow_id UUID in the URL is the only credential needed. If you see 401, an older cached version of the integration may still be loaded. Restart HA.