[Feature request]: Option to omit `default_entity_id` from HA discovery so entity IDs follow Home Assistant's "Entity ID format" setting
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 15.7k
- Forks
- 2k
- Avg merge
- 18h 55m
- Merged PRs (30d)
- 35
Description
Is your feature request related to a problem? Please describe
Since Home Assistant 2026.8 there is a global setting under Settings → System → Entity ID format that defines how new entity IDs are built (e.g. <area>_<device>_<entity>, optionally with floor). All integrations that let HA generate the entity ID (Shelly, ESPHome, ZHA, …) follow this setting.
Zigbee2MQTT does not: since PR #28560 every discovery payload contains default_entity_id, and HA gives an integration-supplied entity ID precedence over the configured format. As a result Z2M entities are the only ones in a mixed installation that do not follow the user's naming scheme — e.g. binary_sensor.bin_eg_ein_01_contact instead of binary_sensor.eingangsbereich_bin_eg_ein_01_contact.
The current workaround is to encode the area in friendly_name. But friendly_name also becomes the HA device name, so the area then appears twice in friendly names and templates (area_name() + friendly_name), unless homeassistant.device.name is additionally overridden per device. For installations with hundreds of devices this is fragile, and moving a device to another area requires a Z2M rename.
Describe the solution you'd like
A way to let HA generate the entity ID instead of Z2M:
homeassistant:
enabled: true
default_entity_id: false # omit default_entity_id from discovery payloads
Ideally also overridable per device (devices.<ieee>.homeassistant.default_entity_id: false). Default stays true, so existing installations are unaffected.
Describe alternatives you've considered
- Per-device
homeassistant.device.nameoverride + area infriendly_name(works, but duplicates area information and is not maintainable at scale) - Manually overriding entity IDs in the HA registry (hundreds of entities)
Additional context
HA-side background: home-assistant/core#173125 (area prefix in generated entity IDs) and the 2026.8 "Entity ID format" setting. Z2M is currently the only integration in my setup that bypasses it.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Trace the Home Assistant discovery payload generation and configuration handling for homeassistant.default_entity_id, including the per-device homeassistant settings. Confirm how existing defaults are represented and how device overrides are merged. Done means the option defaults to true, can be set globally or per device, and false prevents default_entity_id from appearing in discovery payloads.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- embedded-iot
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 68/100