This is an automated archive made by the Lemmit Bot.
The original was posted on /r/homeassistant by /u/RobertoDeBagel on 2024-06-28 00:39:33+00:00.
I’m struggling to get my head around why referencing devices in HA seems to be so clunky, and if I’m doing something wrong. The UI leads the way to the using human_readable_identifiers
for entity_id
.
Simple hypothetical example:
-
Friendly name “Lounge Lamp”
-
Entity id “
light.lounge_lamp
”
Any automation/group/scene etc references the entity ID
Now I move the lamp to the bedroom and rename it ‘Bedroom Lamp’. Now my choices seem to be:
-
Keep the entity as
lounge_lamp
, which is now confusing because its a lie. -
Update the entity_id and break any automation that refer to it.
-
HA offers to rename entity_id when renaming an entity, but does not attempt to fix any references this breaks
Otherwise said: HA does not enforce consistency in entity referencing.
I could have used some unique string for entity id, but if editing some text config which light is tuya_downlight_24AF?
There’s the concept of a UUID in the .yml config but this doesn’t seem to be used more broadly. i.e. it doesn’t seem to be possible to reference entities by some immutable, unique attribute that is assigned to every entity upon creation.
It seems the way entities are managed/referenced is incredibly fragile. Is that by design or a lack of it creating structural spaghetti, or something else?