Person: how entity_id is generated?

I believed that an entity_id for a person entity is generated on a unique id attribute.
But now it seems that it is generated based on a name attribute (which may not be unique).



  - name: John Smith
    id: john_smith
      - ...

  - name: John Smith
    id: john_smith_junior
      - ...

Instead of person.john_smith & person.john_smith_junior I am getting person.john_smith & person.john_smith_2.
And what is a meaning of the name id attribute then?

I consider this as a BUG.

P.S. We can manually change entity_id for the person.john_smith_2. But anyway - it should be automatically generated on that unique id attribute.

Looks like the entity id is generated from the name, not the id. This is the same for a lot of other integrations, like rest and template.

What is a purpose of the unique id attribute then?

AFIK it is used to identify the device in the .storage registry. The backend of the backend.