New devices come out as light.kitchen_kitchen_light_1 — where is the second room name coming from?
I added three bulbs this week and every entity arrived with the room in it twice.
The device is called "Kitchen Light 1", it sits in an area called Kitchen, and the entity ID I get is light.kitchen_kitchen_light_1. I did not type that anywhere.
Nothing has actually broken. Every dashboard and automation I already had still works. But my naming is now split down the middle: everything from before this week is light.kitchen_light_1 and everything after it is doubled.
I have been putting the room in the device name for about eight years, because the entity ID never carried it and I needed some way to tell two identical bulbs apart. So do I keep doing that and live with the doubles, do I strip the room out of every device name from now on, or is there a setting I have walked straight past?
And the part I actually care about: is the "recreate entity IDs" button safe for tidying this up, or is that the thing that breaks the dashboards which currently work?
@ten_year_naming · 2h ago
On the three options, having gone round this with a config about the same age as yours:
Dropping the room from device names going forward is the one I would pick, and the reason is not that the new pattern is better. It is that you now have two systems competing to tell you the same fact, and only one of them is maintained. The area is a field you can change in one click; the room baked into a device name is a string you have to remember to update. Keeping both means keeping them in sync by hand, forever.
The fear people have is that friendly names get useless — that you end up staring at a list of eleven things called "Light 1". In practice that is less bad than it sounds now, because areas are shown next to entities in the pickers and on cards in a way they simply were not when we all started doing this. The information did not disappear, it moved to somewhere that updates itself.
The honest counter-argument is the one about devices that move. If a bulb goes from the kitchen to the hall, its area updates and its entity ID does not, so you end up with
light.kitchen_*in the hall. That is worse than the old scheme, where at least the wrong room was in a field you could edit. If you move things around a lot, neither option is clean and you are choosing which flavour of wrong you prefer.What I would not do is retro-fix. Pick the rule, apply it to everything from here on, and leave the existing entities exactly as they are. A config with a visible date-line in it is annoying. A config where half the references are broken is a weekend.
Reply
Report