The condition you need should check if you (person.greg
) were previously not_home
and that you weren’t home for more than 10 minutes.
To accomplish all of that, it needs to use the information available in the trigger
variable (which is generated after your automation’s State Trigger fires).
The trigger
variable contains information about person.greg
before and after it changed state (in its from_state
and to_state
properties, respectively).
A Template Condition is needed for this purpose.
conditions:
- condition: template
value_template: >
{{ trigger.from_state.state == 'not_home' and
now() - trigger.from_state.last_updated > timedelta(minutes=10) }}