No tripping of any sensor for x min to include in away automation

For some reason (still not sure why) my presence detection is a bit flaky the last week. It’s now based on Unifi component in combination with owntracks (for two phones) and iCloud (for one phone).

As I have plenty of motion sensors and doorsensors I want to add “No motion or door for 20min” to the “all away” automation.

What would be the best way to do this?

It is possible to use last_updated or last_changed:

    - condition: template
      value_template: '{{(as_timestamp(now())-as_timestamp(states.sensor.motion.last_updated)) > 1200 }}'

edit:
Maybe for: is a better option for you: https://home-assistant.io/getting-started/automation-trigger/#state-trigger

Being new to HA, can you tell me when its better the use the ‘for’ method vs the template version?
Currently my automations are simple but starting to get down into the nuts and bolts of it all

Thanks! Both methods are useful and good to know.

PS have you found out a way how to display the last tripped time under a sensor in the UI? I remember that I have seen a screenshot but can’t find it anymore.