Automation: condition in Action: templating error on trigger.to_state

- id: '13283'
  alias: Check-in_abc_spot
  description: Check-in when I goto spot
  trigger:
  - entity_id: person.abc
    event: enter
    platform: zone
    zone: zone.spot_abc
  condition: []
  action:
  - delay: 00:03:00
  - condition: template
    value_template: '{{ is_state( trigger.entity_id, trigger.to_state }}'
  - data_template:
      message: arrived at {{ state_attr(trigger.zone, 'friendly_name') }}
      title: Check-in done.
    service: notify.notify

Error on developer-tools/logs

Logger: homeassistant.helpers.condition
Error during template condition: UndefinedError: 'trigger' is undefined

Can not use trigger templating in condition??
I want to check-in notify 3min after arrived because GPS is unstable when person go indoors.
How can it be solved??

your trigger is a zone event, not a person.
What about if you try to change your trigger like this:

  trigger:
    platform: state
    entity_id: person.abc
    to: "spot_abc"

What is the intended purpose of this curious condition?

  - condition: template
    value_template: '{{ is_state( trigger.entity_id, trigger.to_state }}'

I try it.
But there is not “trigger.zone” when use state trigger.
I want to use friendly_name of trigger.zone.

I live in Japan.
There are many apartment houses in Japan. Therefore, if I set a wide zone for home or spot, false positives will increase.
As you know, the position information of GPS is shifted when it is indoors.
Therefore, I want to avoid unnecessary notifications by checking if the state has not changed even three minutes after the trigger.

Am I making a fundamental mistake?

The usual way to do that with a State Trigger is with a for option:

  for: '00:03:00'

Simply add it to lolouk44’s example:

  trigger:
    platform: state
    entity_id: person.abc
    to: "spot_abc"
    for: '00:03:00'

The automation will trigger only after person.abc is in spot_abc for at least 3 minutes.

With the method suggested by you, state_attr (trigger.zone, ‘friendly_name’) will result in an error, so I would like to use a zone trigger.

Is it a problem of the specification, not a mistake of the setting?
I want to use HA in Japanese language.
When trying to use HA in a Japanese language, it is often necessary to use a friendly name instead of a zone name.
Is it sure to make an issue in github?

I don’t understand why you want to use trigger.zone when you only have 1 zone in the automation. Why not hard code it?

I’ll try hard coding.

I want to be able to specify multiple zones in zone: with zone trigger.
And I want to use the trigger object even in the condition in the action.
Thank you very much.

Because I want to notifying twelve spots.
And I am trying to create multiple Automations for different zones with the same content.
I just want to be able to specify multiple to zone: of zone trigger.