Open Bascht74 opened 2 years ago
+1 x 1000
Most Home Assistant integrations are able to specify a separate entity_id and friendly_name for each entity and it would be very helpful if we could take advantage of that with our ESPHome devices as well.
Of course Home Assistant allows you to override the integration's default friendly name, but it would be much easier to specify that with the rest of the device's ESPHome config so that overriding all of the entities doesn't have to be manually done when connecting it to Home Assistant.
The other way around that is to name the ESPHome entity what you want the friendly name to be instead of a unique identifier. However, when updates need to be made to that name to describe the devices' latest purpose, the entity_id changes as well which breaks dashboard and automation configurations.
I hope this is doable. :)
It looks like this is coming in the next release: https://github.com/esphome/esphome/pull/4296
hooraaayy
As I see, this pull request only allow to add friendly name to device but not for individual entities (switches, lights, inputs, etc).
It is possible to have an entity identifier used in HA regardless of the name?
Like this:
light:
- platform: binary
[...]
name: "${upper_devicename} Balkon" // <-- display name in HA
entity_id: "${devicename}_balkon" // <-- used in HA
+1
I'd love to rename a entity without breaking all dashboards/automations or manually rename within HA.
+1 I see that sth was merged. Any idea when it will become available?
Friendly name is also used if you set
light:
- platform: binary
[...]
name: None
This marks the entity as the primary for the device. HA will show the friendly name as the name. ESPHome also uses the friendly name as unique_id. HA will use the friendly name as entity id.
This pattern isn't continued when an actual string is set as name. ESPHome will use the string as unique_id. This means we still can't re-use a name
on different devices, as the unique_id will clash.
The result is inconistent behaviour:
name: None
can be set on many devices and works great.
Any other name can't be re-used, even though Lovelace leads you to believe you can (as entity ID and name both include the friendly_name, but the underlying unique_id doesn't).
Describe the problem you have/What new integration you would like I can assign the esphome device a name with:
but I cannot assign a friendly name for Home Assistant:
friendly_name: ${upper_devicename} #--> doesn't work
If I give e.g. a light entity a name:
It doesn't show the right way in Home Assistant:
If I rename the device name into the "friendly one" it works:
So it would be nice to have a "friendly" device name with uppercase and spaces via the yaml code. That way the look in HA would be much cleaner
Anything in the logs that might be useful for us?
Additional context It would be an alternative, if the
esphome name
accepts upper case and spaces and translates to lowe case and "-" were needed.If you would be able to set an uppercase device name via the yaml you can make use of the truncating in Home Assistant (would be much clearer) Please describe your use case for this integration and alternatives you've tried:
Example YAML snippet