Errors setting "Friendly Names" for devices (Yeelights)

Hi all,

I’ve been getting my feet wet with Home Assistant, and I feel like I somewhat understand how everything is going to work together in terms of automation and scripts.

The thing is, I’m hoping to give my lights a “friendly” name, because referring to “yeelight_color2_23762376232” both in the UI as well as configuration files is a bit of a pain.

So I did my homework, read the forums and documentation and found out that I can manually map my Yeelights with the following lines:

light:
  - platform: yeelight
    automatic_add: False
    devices:
      10.0.0.XXX:
        name: desk-overhead

So far so good, after a restart Home Assistant shows my automatically detected light’s UID, as well as “desk-overhead” in the UI, including presence/status:

HOWEVER, as soon as I try to refer to the light’s friendly name in my configuration, I’m getting syntax errors:

switch:
  - platform: flux
    lights:
     #- light.yeelight_color2_3545454545
      - light.desk-overhead

Error:

Invalid config for [switch.flux]: Entity ID light.desk-overhead is an invalid entity id for dictionary value @ data['lights']. Got ['light.desk-overhead']. (See ?, line ?). Please check the docs at https://home-assistant.io/components/switch.flux/

So, am I doing something fundamentally wrong, or is this a bug/missing feature in the Flux library?

Thanks!

i get the same message on my switch naming too Can't create fancy name for switch?

If you look under deverloper-tools in the UI
Look for the <> symol, and look for the light there.
It will probably not have an - in the entity_id
most likely it will be light.desk_overhead or light.desk__overhead or even light.desk___overhead

1 Like

Awesome, thanks a lot! Turns out dashes (-) are not parsed as light names and are removed:

EDIT: confirmed!

Removing the - in the config and simply referring to light.deskoverhead solved it.

Thanks again!

The only variant of the name I did not write :stuck_out_tongue:
Glad it works :+1: