Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Device rename does not change entity names properly #64

Open
GitHubGoody opened this issue Dec 16, 2024 · 3 comments
Open

Device rename does not change entity names properly #64

GitHubGoody opened this issue Dec 16, 2024 · 3 comments

Comments

@GitHubGoody
Copy link

If I change the default name of my Ember Mug's device from EMBER to something else (e.g. Device Name), and select RENAME for all entities, the result is something like this sensor.device_name_mug_d5e2b8b6bce1_current_temp but it should be this sensor.device_name_current_temp

@sopelj
Copy link
Owner

sopelj commented Dec 18, 2024

Hi, that is a good point.
The reason for that is the ID is built as {device_name}_{device_type}_{address} to ensure it is unique (as EMBER is always the default).
However, I do get that this does not generate the desirable ID in your case.
I will see if it is possible to distinguish between initialization and manual renaming and prioritize the manually specified value.

@sopelj
Copy link
Owner

sopelj commented Jan 2, 2025

OK, so, it looks like renaming mechanism is outside of the integration. It seems to automatically convert the device name to an ID and try to find it in the device's IDs.
image

That means that renaming will only work if the device name and ID prefix match.
So, I will change the default name to something like "Ember Device Type". The IDs will not be unique, but home assistant should automatically suffix them with numbers if there are conflicts. Anyway, people will probably want to give them better names if they have multiple devices of the same type.

However, this means that this will not affect devices that are already setup. So, for your current install, if you rename the device to something that match the ID prefix, like Device Name Mug d5e2b8b6bce1, and then rename it to something else, it will affect all the IDs correctly.

@GitHubGoody
Copy link
Author

Great, I'll check it out. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants