Skip to content

MQTT Discover - default_entity_id ignored #157241

Description

@deggle

The problem

I may be doing something dumb, but I'm struggling with entity naming as HA doesn't seem to be honouring the request for a entity name as per the documentation.

I have a lot of devices being populated via MQTT discovery (self-coded in Node-RED for a plethora of integration flows) and it's important I can set the unique entity ID that will be created. Occasionally I need to add/remove entities so I often delete an entire 'device' and push the discovery packets to re-populate it.

I've seen the notice in the event log saying we need to move from object_id to default_entity_id however this results in ALL entities being populated as a numbered 'unnamed_device_123' entity which is useless to me (I have 1000s so can't go though and name them manually).

I wondered if the issue was a latent existing entity with that ID which wasn't removed when I deleted the parent device, but the same happens if I set a default_entity_id that is completely unique.

I've moved back to setting unique_id and object_id which works again, but I'm worried this will be remove as per the notice and it will break everything and essentially render HA useless to me - and while I don't want to dramatise, this would be a disaster of catastrophic proportions.

What version of Home Assistant Core has the issue?

core-2025.11.3

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant Container

Integration causing the issue

No response

Link to integration documentation on our website

No response

Diagnostics information

No response

Example YAML snippet

Anything in the logs that might be useful for us?

Discovery packet example:

unique_id: z1_scenes_living_area
default_entity_id: z1_scenes_living_area
state_topic: knx/1/0/15
device:
  identifiers:
    - z1_scenes
  model: KNX Virtual Sensor
  manufacturer: Node-RED
  sw_version: '1.0'
  name: Z1 Scenes
icon: mdi:palette
value_template: >-
  {% set v = value | int(0) %} {% if v == 0 %}Off{% elif v <= 127 %}Scene {{ v
  }}{% elif v <= 255 %}Scene {{ v - 128 }}{% endif %}
name: Living Area Scene

Derives entity: sensor.unnamed_device_12

But when setting:

unique_id: z1_scenes_living_area
object_id: z1_scenes_living_area

Correctly derives entity: sensor.z1_scenes_living_area

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions