How to get the zone icon from a person

I’m trying to write a template that will give me the zone’s icon for a given person.

I can see that the person’s state is the friendly name of the zone, but I don’t know how to get the zone. I have a lot of zones, but maybe I loop through all the zones and fine the person in the persons attribute? is this the only way?

{% set location = states('person.x') %}
{% set away_icon = 'mdi:home-export-outline' %}
{% if location == 'home' %}
  {{ state_attr('zone.home', 'icon')}}
{% else %}
  {{ states.zone | selectattr('name', 'eq', location) 
  | map(attribute='attributes.icon') | first | default(away_icon, 1) }}
{% endif %}