core: ESPHome does not handle the case where the name is set to "" and a friendly_name is defined
The problem
Consider the following ESPHome device:
esphome:
name: portao
friendly_name: Portão
binary_sensor:
- platform: template
name: ""
device_class: garage_door
lambda: 'return true;'
When added to Home Assistant, the entity id becomes:
binary_sensor.portao_port_o
Instead of:
binary_sensor.portao
Meaning I have to be aware and fix these inconsistencies by hand.
What version of Home Assistant Core has the issue?
core-2024.12.1
What was the last working version of Home Assistant Core?
No response
What type of installation are you running?
Home Assistant OS
Integration causing the issue
ESPHome
Link to integration documentation on our website
https://www.home-assistant.io/integrations/esphome/
Diagnostics information
Notice the binary_sensor. The other entities I fixed already.
config_entry-esphome-01JDTNEKJ0CBYMEY53AAGTS95M.json
Example YAML snippet
No response
Anything in the logs that might be useful for us?
No response
Additional information
No response
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 18 (15 by maintainers)
Commits related to this issue
- Correct handling of empty name for ESPHome devices If the name was set to "", ESPHome should treat this as if the name is empty. Since protobuf treats empty fields as "" we need to handle this as `No... — committed to home-assistant/core by bdraco 2 years ago
- Correct handling of entities with empty name for ESPHome devices (#143366) Correct handling of empty name for ESPHome devices If the name was set to "", ESPHome should treat this as if the name is e... — committed to DeakoLights/homeassistant_core by bdraco 2 years ago
- Correct handling of entities with empty name for ESPHome devices (#143366) Correct handling of empty name for ESPHome devices If the name was set to "", ESPHome should treat this as if the name is e... — committed to tr4nt0r/ha-core by bdraco 2 years ago
- Correct handling of entities with empty name for ESPHome devices (#143366) Correct handling of empty name for ESPHome devices If the name was set to "", ESPHome should treat this as if the name is e... — committed to thomasddn/home-assistant-core by bdraco 2 years ago
- Correct handling of entities with empty name for ESPHome devices (#143366) Correct handling of empty name for ESPHome devices If the name was set to "", ESPHome should treat this as if the name is e... — committed to mgust/home-assistant by bdraco 2 years ago
Thank you, @bdraco, I believe that’s going to fix my issue.