mirror of
https://github.com/CeeWeasel/fresh-home.git
synced 2026-08-10 02:50:12 -04:00
20 lines
573 B
YAML
20 lines
573 B
YAML
initial_state: 'on'
|
|
alias: 'Clint changing zones'
|
|
id: automation_clint_changing_zones
|
|
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
|