Either I am being dense or I’m not communicating properly.
In my example the friendly name is “Flood7” which is also the device name. If I set the Name field to “None” I end up with Flood7_Flood7.
The ID is used internally to control lighting effects, and it’s purposely different (“TheLight”) so I could see if it had some effect on naming; it did not appear to.
What is it you expect to happen with Name of the Light set to “None”. Are you not expecting the doubled name? Because nothing I do can get rid of that, except to use Name and make it a space (not missing, not None, but a space, which I suspect is an oversight in the syntax not the intended purpose).
Let me fix this so it’s a little more clear what is happening (especially for the recent poster):
substitutions:
device_name: devname
device_description: Novostellar 25W RGBWW flood light
friendly_name: frndlyname
name: thename
ipaddr: 192.168.130.72
packages:
stuff: !include standard-setup-template.yaml
also: !include novostellar_floodlight_25w_template.yaml
more: !include ha-time-template.yaml
In the “also”:
esphome:
name: ${name}
friendly_name: ${friendly_name}
comment: ${device_description}
light:
- platform: rgb
name: None
red: red
green: green
blue: blue
id: thelight
With this setup, the light comes through as entity light.thename_frndlyname.
Other entities with explicit names like this:
switch:
- platform: restart
id: restartid
name: reboot
restore_mode: restore_default_off
come through as “switch.thename_reboot” with the device name field prefixing the entities (not the friendly name as you might think – and the switch name field becomes the suffix).
To make it a bit more confusing, the “device” shown if you go to settings, integrations, select esphome (the icon, not the word “devices”), is different from the name of the device. If you rename it (as I just did), it shows the renamed item there, but if you select devices it is the unrenamed item. I have no idea what circumstance these two separate names for the device are used, sort of an “integration device name” and a “device name” (but this doesn’t much impact the entity naming issue).
Just to be clear – with it all my own code I can fix this by just leaving off friendly name and using the name field in the switch the way I want it:
substitutions:
device_name: devname
device_description: Novostellar 25W RGBWW flood light
friendly_name: frndlyname
name: thename
ipaddr: 192.168.130.72
packages:
stuff: !include standard-setup-template.yaml
also: !include novostellar_floodlight_25w_template.yaml
more: !include ha-time-template.yaml
In the “also”:
esphome:
name: ${name}
# friendly_name: ${friendly_name} <<<< removed
comment: ${device_description}
light:
- platform: rgb
name: ${thename}
red: red
green: green
blue: blue
id: thelight
Now the light comes through as light.thename as you would expect, though now I have to go through all the other entities and prefix those with ${name} as well to restore the original behavior.
But with all my own code I can do this. It’s when there is code that expects friendly name that you run into the trouble. I’ve seen authors lamenting this doubled name on a central item as well. And forking their code rather than just including it would allow me to fix them, but it’s both tedious and also then prevents me from benefiting (at least easily) from their improved versions.
My point is that it’s nice to say there is a workaround, but once you decide to declare a friendly_name, there are some things you just can’t do properly (my trick of a single space notwithstanding, as that doesn’t always work either especially inside includes or extends).
Now… to your original point – maybe I just plain missed the documentation that would make this make sense and give me the workaround. If so, please point it out. Better still in the context of my example with friendly name declared, how can I fix the entity name of the light to be ONLY the friendly name?