Light Switch entity names

Using https://www.home-assistant.io/integrations/light.switch/ is a simple way to turn a dumb switch into something that will appear as a light to HA (and to Google Assistant etc).

To configure it, you write something like:

light:
  - platform: switch
    name: Kontorsvägg
    entity_id: switch.nexa_7

This will create an entity with a name that is derived from the name you provide. I just wish that it wouldn’t conflate the entity name with the name I want to show in the Lovelace UI. If I want to tweak the “friendly” name to improve the UX, that will also rename the entity name, breaking anything that depends on it.

And can you tell what the entity name for the above example is? In case you wonder, it’s light.kontorsvagg which is not so pretty.

This is probably a commen theme in entities defined like this. I can see a couple of ways forward:

  1. Add a “friendly name” configuration parameter, and let the “name” be the entity id.
  2. Integrate this much better into HA so I can configure it in the UI instead and let me tweak the UI description freely.
1 Like

You can add a friendly name with customization.

Nope, that only works for entities with a persistent id.

Not true.

I have customised my own light switch.

I looked at the instructions on https://www.home-assistant.io/docs/configuration/customizing-devices/ and clicked the cog on the light switch. This gave me:

Skärmavbild 2020-05-04 kl. 17.02.13

If I click the cog wheel on a light provided by e.g. Hue, get the option to override the name.

Do you know any other way to customize the name?

You can’t do it from the UI but you can do it in YAML.

Right, yes you probably can. But that is really just a workaround for the real problem.

We should be able to do better. Treating a switch like a light should be a pretty common use case.

It’s not a work around. This is how devices have been customised from the beginning. It’s the UI that’s new and can’t do everything yet. Until that time you have to do it the original manual way.

Sure. But the rest of HA has evolved around it, and I think it is time for this feature to catch up.

Also, since I’m defining this using YAML, don’t you agree that it would be better if I could specify both the entity name and the friendly name in the same place, instead of defining the entity in one place, and then adding a “customization” in a different place, customizing something I just defined?

Mate, it is a vey small team of developers with a lot to do. Have some patience.

1 Like

Yep. I guess pull requests are welcome :wink:

If you reread by original post, I hope you can see I was being constructive, and suggested a couple of ways to improve the situation. I’m willing to pitch in if I get some input on how it should be designed.

Apologies. I see a lot of ‘entitled’ posts and this has coloured my perception poorly.

If you want to help out with development the best place to start is by reading the developer docs then popping over to the developers forum on discord. https://discord.gg/96Hqw6