I need help, I'm trying to make a card on the panel with an automation, in it I use the entity field and I'm trying to change the person according to the connected profile

It takes the word “person.” and then append the username of the logged in user in lower case letters to that word.
This is then the sensor that will be looked up.
If there is no person with that name then it will fail.
It is possible to have a user without a person.

well, as I said, this code is not working 100%, that is, it is not working for me, as I showed in the previous image, when I use it on other users like renato and lilian it works, but on my user lucas it doesn’t work, and I I also need the referring user’s icons to appear, if you have another code or another way to do this I would be very grateful to know, I thought of a possibility of using the code used in the entire panel of:
- user: (alphanumeric code referring to the user)
however when I tested it it tells me that this function has not been enabled for individual cards, if this function is enabled I would use it to solve my problem, but apparently the problems are following me lol

What users and persons do you have?


5 Persons and 1 control panel
Totaling: 6

About the images I haven’t put them all yet because I’m configuring everything

And your users?

The user Dazzily have no person connected to it and the person Lucas have no user connected to it.

Users and persons are not really connected in HA, so only way to connect them in a piece of code is to find some manual way of doing it, like connect an user to a person if they have the same name.