esphome / esphome/feature-requests

Option to prepend device name to all entity names at runtime

Open
#1,840 4 comments 2 reactions 0 assignees View on GitHub
enhancement Project: ESPHome
Dominant language
No language data
Stars
450
Forks
29
PR merge metrics
No merged PRs in 30d

Description

**Describe the problem you have/What new integration you would like**

A configuration option to prepend all entity IDs exposed to HA with the effective device name (i.e. if `name_add_mac_suffix: true`, entity IDs would be prepended with the suffixed device name.)

**Please describe your use case for this integration and alternatives you've tried:**

I want to flash a number of custom devices with the same firmware binary, using `name_add_mac_suffix` to give them unique names that can be discovered by HA. I then want to be able to change the device name in HA to a more descriptive one, and also have the entity IDs (in HA, not ESPHome) match the new device, to make it easier to know which entity is associated with which device.

Currently, because the device name isn't known until runtime, I cannot make the entity names contain the device name as a substring, and therefore I must manually change each entity ID in HA for every device I discover.

**Additional context**

The HA device renaming process assumes that the device name is a substring of its entity IDs. This allows the entity IDs to be automatically updated when the device name is changed in HA. If the device name is fixed in the ESPHome configuration, then the entity names can be manually (or through substitutions) made to contain that substring, but if the device name is dynamic (appended MAC suffix), there is no way to have the entity names contain the entire device name (as the substitutions are done at compile time, not runtime).

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reviewing how ESPHome exposes entity IDs at runtime and how Home Assistant uses device names when renaming entities. Confirm the expected behavior for devices using name_add_mac_suffix, including whether all exposed entity IDs should receive the effective device name and update correctly after renaming.

Written by the indexing model from the issue text.

Assessment

Domain
embedded-iot
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.