Home/Away on Template when person card selected

Hi,
maybe this topic is already there, but I do not find any for the moment
i have setup espresense as a room assistant via MQTT.
Also I have Iphone tracking on my device.
But when I want to see the status in the Person card (from mushroom), the badge icon does not chang when I use the template sensor I created in the configuration.yml file.
I create a template to check if I am home and the sensor for the Room assistant had not the status not_home.

But how can I auto translate not_home to Away when I use the template sensor of my tracking?

It is just a sensor an not a device tracker.
I use the state of the device tracker when I am not_home in the Room state.

thanks for the help

The mushroom Person card gets its info from the person entity. The person entity gets its state from the combined status of all of its associated device trackers… Have you associated your person with their relevant device trackers?

Settings > People > (your person)