Entity ID name has repeated device name - Is there something wrong?

A few years ago, I flashed some Sonoff S31 outlets with ESPHome, configured via yaml, and the entity IDs showed up as follows (device named s31-plug-01 in the example):

binary_sensor.s31_plug_01_button
sensor.s31_plug_01_current
update.s31_plug_01_firmware
sensor.s31_plug_01_power
switch.s31_plug_01_relay
binary_sensor.s31_plug_01_status
sensor.s31_plug_01_voltage
sensor.s31_plug_01_wifi_signal

Those names make sense.

Recently I wanted to add a restart feature to these devices, which resulted in the addition of another entity ID as follows:

switch.s31_plug_01_s31_plug_01_restart

Notice that the device name is repeated in the entity ID.

I recently decided to flash some additional S31 outlets. Now, every entity ID has the repeated device name:

binary_sensor.s31_plug_04_s31_plug_04_button
sensor.s31_plug_04_s31_plug_04_current
sensor.s31_plug_04_s31_plug_04_power
switch.s31_plug_04_s31_plug_04_relay
switch.s31_plug_04_s31_plug_04_restart
binary_sensor.s31_plug_04_s31_plug_04_status
sensor.s31_plug_04_s31_plug_04_voltage
sensor.s31_plug_04_s31_plug_04_wifi_signal

Is there a reason why this is happening? Is there something wrong? Is it something I can fix? Should I try to fix it?

1 Like

Yes the developers have chosen to prepend the device id to the beginning of the entity id. This made a lot of people mad but it is not changing.

I’m guessing your device is called s31_plug_01 and you have that in the entity name as well.

No.

If you don’t want it like that you can edit the entity id.

Open the more-info pop-up card for the entity (click on it in a dashboard or Devices & services).

Click the cog icon at the top of the card.

Edit the entity id to what you want and save the changes.

Alternatively just don’t put the device id in the name of the entity.

2 Likes

2026.4 might change more things, so I would hold off and check things again after updating April’s release. The device_id might be repeated 3 times, who knows.
Check it again after April fools day and you update your HA. (No, I’m not kidding)

1 Like

isn’t the change to be applied to friendly name only? I saw Petro confirmed that entity ids not gonna be influenced.

Btw regardless of that, it shouldn’t just dumb concatenate names. It should check if device name is already part of the name. isn’t it?

You are confusing the change in the beta (prepending device to names) with a change made many releases ago (prepending device to entity_ids).

Unlike the entity id change the name change is a lot more difficult to deal with but if you wish to discuss that please move it to the beta topic.

yeah sorry for that. I was wrongly thinking the beta changes slept to entity_id, especially seeing those doubled device names.