Skip to content

v3.2.0: MeteoSwiss + device-discovery refactor

Choose a tag to compare

@krissen krissen released this 12 May 08:23
1a0b8dd

MeteoSwiss support and a structural device-discovery refactor across 8 adapters 🇨🇭

Pollen forecast for Zürich

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_id auto-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 identifiers metadata, 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_CITIES lookup.
  • (peu) Explicit allergen-key whitelist replaces a greedy regex; entity IDs containing allergen-like substrings no longer misclassify.
  • (helpers) isConfigEntryId tightened 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-hacs skipped 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.js and shared across the eight migrated adapters, replacing bespoke regex-based discovery.
  • (editor) set hass() snapshots the hass.states key 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

Contributors

Thanks to @r3turnNull for the MSW adapter contribution.

Full Changelog: v3.1.0...v3.2.0