v3.2.0: MeteoSwiss + device-discovery refactor
MeteoSwiss support and a structural device-discovery refactor across 8 adapters 🇨🇭
This release brings a new integration, MeteoSwiss via hass-swissweather, and a structural refactor. The latter is something you probably (read: hopefully) wont even notice.
With MSW in, pollenprognos-card now supports 10 integrations across 15 languages.
What's New and Noteworthy
🇨🇭 MeteoSwiss / hass-swissweather: a new integration
The MSW adapter, contributed by @r3turnNull (#212, polished further in #214), connects the card to @izacus's hass-swissweather integration.
Note: MeteoSwiss does not publish a forward forecast; days_to_show is fixed at 1 by the card regardless of config, and no synthetic future days are rendered.
What's New but more of a sneeze snooze
🔌 Device-based discovery across 8 adapters
The discovery refactor that was deferred from v3.1.0 (#202) is in. PP, DWD, PEU, SILAM, Atmo, GPL, GP and now MSW all resolve sensors via the Home Assistant device registry as their primary path, with platform scan and regex/selector fallbacks (#205, refined in #220).
What this fixes in practice:
- Multi-instance setups work without manual config. Two cities of the same integration, two SILAM weather stations, two SwissWeather devices: all routed correctly via
config_entry_id. - Entity-ID renames stop breaking things. For the eight migrated adapters, renaming a sensor in HA no longer breaks card detection. Discovery walks the device tree, not the entity-ID shape.
- Stale
config_entry_idauto-recovers. Remove and re-add an integration, and your card no longer renders empty. DWD, GPL, GP, SILAM, Atmo and MSW have an explicit retry-as-autodetect path; PP and PEU recover via their pre-existing template fallback. - Mixed-registry tolerance (#220). When some integration devices lack
identifiersmetadata, tier 2 picks up entities tier 1 would otherwise miss; the two cooperate in a single pass without double-classifying. - Kleenex is not part of this migration and continues to use entity-ID slug matching.
The location field (and city for PP, region_id for DWD) now accepts a config_entry_id ULID across the eight migrated adapters. Legacy slug values continue to work unchanged.
🩹 PEU level names without the 0-6 spread
Since the card was introduced, PEU has surfaced its native 5-level scale via a runtime spread onto positions [0, 1, 3, 5, 6] of the 7-level palette (#215). PEU now reads state_text directly from per-scale keys card.levels5.0..4, sourced one-to-one from the same translations the spread used to surface (#216).
User-visible labels stay identical for default configs and for 5-length custom phrases.levels configs. Legacy 7-length custom configs are migrated by extracting entries at the [0, 1, 3, 5, 6] positions the spread used to populate.
Improvements
- (editor) Integration dropdown sorted intelligently (#213). Detected/installed first, then the rest, both alphabetical.
- (card) Header titles route through the shared discovery helper for PP, DWD, PEU, GPL, GP, MSW.
- (dwd) Region-ID prefix only re-appended to auto-derived labels when needed to disambiguate duplicates.
- (pp) Diacritics restored in tier-3 fallback city labels (Malmö, Visby etc.) via
PP_POSSIBLE_CITIESlookup. - (peu) Explicit allergen-key whitelist replaces a greedy regex; entity IDs containing allergen-like substrings no longer misclassify.
- (helpers)
isConfigEntryIdtightened to the Crockford base32 alphabet, avoiding false positives on entity-id-shaped strings.
Bug Fixes
- (gpl, gp) Strip integration-appended
- <category> (<lat>,<lng>)suffix from location labels (#208, fixed in #209). Editor dropdown and card title no longer leak text like "Hem - Pollentyper (50.45, 30.52)". - (dwd) Device-name-prefixed entity IDs not recognized (#217, fixed in #218). HA prefixes entity IDs after a device rename (
sensor.<device-slug>_pollenflug_...); both shapes are now recognized. - (kleenex) Per-allergen DetailSensor fallback (#206, fixed in #207). For US/CA zones the Kleenex API only returns category totals (trees/grass/weeds); EU/UK zones now use per-allergen DetailSensor entities (disabled by default), with a clearer de-duplicated warning for NA zones.
- (ci)
validate-hacsskipped on fork PRs where the action resolved to the fork repo and always failed; still runs on push to master/dev and the daily schedule.
Housekeeping
- Discovery helper extracted to
src/utils/adapter-helpers.jsand shared across the eight migrated adapters, replacing bespoke regex-based discovery. - (editor)
set hass()snapshots thehass.stateskey list once across per-integration filters, reducing per-update allocations on large HA installs. - Tests grew from 790 (v3.1.0) to 968 across 22 files.
- Documentation refreshed across
docs/. MSW is documented at parity with the other nine integrations.
What's Changed
- MSW adapter for MeteoSwiss / hass-swissweather by @r3turnNull in #212
- Device-based entity discovery rollout by @krissen in #205 (closes #202)
- (kleenex) NA-zone handling and DetailSensor fallback by @krissen in #207 (closes #206)
- (gpl, gp) Locale-agnostic location-label normalization by @krissen in #209 (closes #208)
- 3.2.0 docs prep by @krissen in #210
- (editor) Integration dropdown sort by @krissen in #213
- (msw) Stub defaults, level mapping and per-scale i18n by @krissen in #214
- (peu) Drop runtime 0-6 spread for level names by @krissen in #216 (closes #215)
- (dwd) Handle device-name-prefixed entity IDs by @krissen in #218 (closes #217)
- (discovery) Cooperate tier 1 + tier 2 in mixed-registry scenarios by @krissen in #220
- Release v3.2.0 by @krissen in #219
Contributors
Thanks to @r3turnNull for the MSW adapter contribution.
Full Changelog: v3.1.0...v3.2.0
