How to set person to 'away' after a certain time has passed since last update?

You could use a Template trigger based on the last_reported property.

Instead of the python script overwriting the existing device tracker, you can use an automation that calls the device_tracker.see service. Calling the service with an unknown dev_id will create a new device_tracker entity that can be added to your person.

Device tracker services

trigger:
  - alias: Mobile device tracker hasn't reported in 20 minutes
    platform: template
    value_template: |
      {{ states.device_tracker.MOBILE_APP_ID.last_reported < now() - timedelta(minutes=20) }}
condition: []
action:
  - action: device_tracker.see
    data:
      dev_id: adam_custom
      location_name: not_home
3 Likes