Entity grabs `name:` as Entity ID instead of `unique_id:`

Hey all,

I’ve grabbed a piece of modbus settings for a heat pump. I wasn’t able to find any switches.
Then I saw the switch gets the name: assigned as Entity ID instead of the unique_id:

From the code below I would expect the Entity ID to be: switch.yutaki_1000_system_on_off
instead it renders switch.yutaki_system_run_stop (from the name)

modbus:
- name: "yutaki"
  ...

  switches:

    - name: "Yutaki system run/stop"
      unique_id: yutaki_1000_system_on_off
      address: 1000
      write_type: holding
      command_on: 1
      command_off: 0
      verify:
        input_type: holding
        address: 1050
        state_on: 1
        state_off: 0

Am I using it wrong? I would prefer the ID to be the unique_id

Unique_ID is an internal only construct used to bind the device to it’s customization etc. (I use GUIDS for mine…)

In the integration you used it slugifys the friendly name (lowercase/underscore_blanks/trim) and uses that as the right hand side of the entity. That’s all.

Hang on, I’m trying to grasp this. I thought the name parameter is the human friendly name. And the unique_id parameter is the, well, identifier. After tracing back entities that did work I found out I manually slugified the ID’s. :slight_smile: So that’s why it never occurred before :slight_smile:

Ok, now. You mention GUIDs. What are those? Is this a naming convention? I cannot find anything about it in the docs.

Also, if name: is the id’er. How to add a human friendly name. The modbus addres in the readable name would be unnecessary info.

I think I misunderstood human friendly names and unique identifiers for some while then :slight_smile:

For UUID’s/GUID’s, see this website:
https://www.uuidgenerator.net/
It are just unique id’s