initial_state: 'on' alias: 'Clint changing zones' id: automation_clint_changing_zones #description: trigger: # Been away for a few minutes - platform: state entity_id: device_tracker.pixel_7 to: 'not_home' for: '00:05:00' # Arrived in a zone - platform: state entity_id: device_tracker.pixel_7 from: 'not_home' condition: # Been at least 5 minutes - condition: template value_template: "{{ ( as_timestamp(now()) - as_timestamp(state_attr('script.clint_traveltime','last_triggered'))|float)|float > 300 }}" action: - service: script.clint_traveltime