If statement in automation to determine triggers "for:" time

try using this format for conditional timing:

  - condition: template
    value_template: >
      {{ (now() - trigger.from_state.last_changed | default(0) ).total_seconds() > 120 }} 

and adjust naming and timing of course

I am using this slightly more complex template:

  - condition: template
    value_template: >
      {{ (now() - trigger.from_state.last_changed | default(0)).total_seconds() > 
                                        states('input_number.presence_timer')|int }}

to have a frontend input_number allow for easy experimenting its the timings…