v1.15.6: clean entity_ids for sensor and binary_sensor
v1.15.6 — clean entity_ids for sensor and binary_sensor
What changed
sensor.py and binary_sensor.py now set self.entity_id explicitly, matching the pattern already used by switch.py, number.py and select.py.
Before:
| Platform | entity_id |
|---|---|
| switch | switch.xcc_blokyspotrebypovoleni3 |
| number | number.xcc_tuvpozadovana |
| select | select.xcc_... |
| sensor | sensor.stav_jednotky_192_168_0_50_... |
| binary_sensor | binary_sensor.stav_jednotky_192_168_0_50_obeh_0_bezi |
After (new registrations):
| Platform | entity_id |
|---|---|
| sensor | sensor.xcc_<prop> |
| binary_sensor | binary_sensor.xcc_<prop> |
Why the IP was in the id
When a platform doesn't assign self.entity_id, Home Assistant falls back to slugify(device_name + " " + friendly_name). The XCC device names include the controller IP (e.g. "Stav jednotky (192.168.0.50)"), which has been the case since v1.9.51. Binary sensors only became visible in v1.14.7 after XCCBinarySensor was fixed to inherit from XCCEntity, so the issue became noticeable only recently.
Upgrade impact
- Existing entities keep their current IDs. Home Assistant's entity registry persists
entity_idbyunique_id;self.entity_idis only used as a suggestion on first registration. Your existing automations, dashboards and scripts referencingbinary_sensor.stav_jednotky_192_168_0_50_*or similar continue to work. - New installs and re-added integrations will get clean, consistent ids like
binary_sensor.xcc_<prop>. - To adopt the clean ids on an existing install, either:
- Remove and re-add the integration, or
- Rename each affected entity manually via Settings → Devices & Services → Entities.
Tests
84 passed, 29 skipped (unchanged).