How to get friendly name of location of person when it changes

Currently I have this automation:

- alias: 'Device State Change Alert'
  trigger:
    platform: state
    entity_id: person.P1, person.P2
  condition:
    condition: template
    value_template: '{{ trigger.to_state.state != trigger.from_state.state }}'
  action:
    - service: notify.notify
      data_template:
        message: >
          {{ trigger.to_state.attributes.friendly_name }} is at {{ trigger.to_state.state }}.
        title: ""

How can I change trigger.to_state.state to a value where it returns the friendly name? Currently it returns the correct name for custom zones, however for the home zone it returns “home” and when not at home it return “not_home”. I would like to have the friendly names returned instead of “home” and “not_home”.
How can I change this?
It’s not trigger.to_state.attributes.friendly_name as this returns the name of the person, which is quite strange I would say.

The “trigger” relates to the platform: state and entity_id. Because it’s a person, trigger will be a person. It will be THE person that triggered the automation.

As such, trigger.to_state.state will be the state of that person. The only info you can get from trigger is the same as if you did states(‘person.P1’), state_attr(‘person.P1’), etc. It’s just a way easier way to get the info without having to check which of possibly multiple entities caused the trigger.

In fact, I can’t find anywhere where a person.entity even has an associated zone. They have gps coordinates…but no zone.

If you want that kind of info, take a look at the proximity integration. This will give you tons of info, like how far away each person is from any given zone.

Or, just create another automation for zones. I would follow this advice here as it will probably do everything you want: