Closed bpawulski closed 7 months ago
Ok, I'm a little torn here @bpawulski .
HA docs for entity naming state that "The entity's name property only identifies the data point represented by the entity, and should not include the name of the device or the type of the entity. (...) If the entity represents a single main feature of a device the entity should typically have its name property return None. The "main feature" of a device would for example be the LightEntity of a smart light bulb."
Granted, we don't only have devices, but also the hub, but still, to be aligned with what HA is suggesting and expecting, we should not add those additional names to devices. So for climate/thermostat entities we should really align and have the name determined only by device, as the thermostat is a main feature of the zone.:
For tiles, which don't really have a higher level entity in the Tech API to map to, we should not really have devices anymore, but just individual entities. With that we perhaps have more flexibility and can have the hub added to entity id/name:
Please check the latest approach here if you want: https://github.com/mariusz-ostoja-swierczynski/tech-controllers/tree/feat_61
The only thing i can see have changed is the name of outside temp sensor which accommodates the hub name. All zone names stayed the same. As well as i still have not available outside temp sensor connected to "Gora" hub.
In general I think we should stick this:
"The entity's name property only identifies the data point represented by the entity, and should not
include the name of the device or the type of the entity. (...) If the entity represents a single main
feature of a device the entity should typically have its name property return None. The "main feature"
of a device would for example be the LightEntity of a smart light bulb."
But @bpawulski regarding your issue screens which you showing above are devices, not entities.
HA itself allow you to change device names:
or even entity name:
so I am little confused what real issue we trying to solve here?
Additionally in newest HA release you have additional features (for example labels) to organize things https://www.home-assistant.io/blog/2024/04/03/release-20244/
Ok, there is a compromise possible here. The latest version (please check here) is not in conflict with HA guidance, as every entity implements _attr_has_entity_name = True
and we still use HA mechanism for naming including device name when appropriate.
I added an option to check when adding controllers and include hub names in entity names:
and then if selected, we get:
By default, when not enabling this option we get:
Please note that:
sensor.external_temperature_temperature
.(and all temperature entities now create devices, while only the ones that have battery or signal strength should - that needs to be addressed)
I like this approach, It works fine for me. Thanks!
just a small improvement. How about creating HA entity names based on combination of hub name and zone name -> if hub is called "Gora" and zone is called "Łazienka" do sensor.gora_lazienka_temperature etc. In this case when i have bathroom at both floors i wouldn't have to change zone name to distinguish it in HA. Ideally this might be a config option, for people with single hub such naming might not be convenient, but i believe for the ones with multiple hubs this will be useful.