You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
HA bridge: driver names with spaces/commas produce illegal MQTT discovery topics — sensors silently dropped #960
The Home Assistant bridge builds MQTT discovery topics from the raw configured driver name. A driver named with characters MQTT/HA forbid in topics — my Easee is name: Laddare, Garage (comma, space) — produces discovery topics HA rejects outright, and every sensor published under that name is silently absent from HA:
WARNING [homeassistant.components.mqtt.discovery] Received message on illegal discovery topic
'homeassistant/sensor/forty_two_watts/Laddare, Garage_ev_current_a/config'.
The topic contains non allowed characters.
Lost on this site: ev_current_a, ev_voltage_v, ev_lifetime_kwh, ev_dynamic_current_a — the per-driver EV detail. The core power sensors are unaffected because their object ids don't embed the driver name.
Where
The bridge composes the discovery object id as <driver name>_<sensor>. HA's discovery topics allow only [a-zA-Z0-9_-] in the object id segment; the driver name: is free-form YAML and reasonably contains spaces, commas, or Unicode ("Laddare" could as easily be "Värmepump, källaren").
Suggested fix
Slugify the driver-name segment when composing discovery object ids (lowercase, [^a-z0-9_-] → _, collapse repeats), keeping the human-readable name in the discovery payload's name/device fields where it belongs. The unique_id should follow the same slug so entities stay stable across renames of the display name — or better, key it on the driver's stable identity rather than the YAML name, consistent with the persistent-state-identity invariant.
Live repro available on my site (v1.15.x-era gateway, current stable drivers).
Fixed by #970 (commit 31742d7): discovery object ids are now slugged (illegal characters folded, with a collision tag), while already-legal mixed-case ids stay unchanged. Shipped in v2.3.0-beta.1, currently validating on a live site ahead of the v2.3.0 stable promotion. Closing.
Activity
frahlg commentedon Aug 29, 2026
Fixed by #970 (commit 31742d7): discovery object ids are now slugged (illegal characters folded, with a collision tag), while already-legal mixed-case ids stay unchanged. Shipped in v2.3.0-beta.1, currently validating on a live site ahead of the v2.3.0 stable promotion. Closing.