70b78b6275
- Only close garage when vehicle tracker is active (speed available) - Prevents closing when leaving on foot or bike - Add delay to ensure safe closing after departure - Align closing logic with car-based opening conditions
69 lines
1.7 KiB
YAML
69 lines
1.7 KiB
YAML
- id: garage_auto_claus_presence
|
|
alias: Garage auto Claus
|
|
|
|
trigger:
|
|
- platform: state
|
|
entity_id: device_tracker.clausiphone
|
|
to: "home"
|
|
id: arriving
|
|
|
|
- platform: state
|
|
entity_id: device_tracker.clausiphone
|
|
from: "home"
|
|
id: leaving
|
|
|
|
condition:
|
|
- condition: time
|
|
after: "05:00:00"
|
|
before: "23:00:00"
|
|
|
|
action:
|
|
- choose:
|
|
|
|
# ÅBN (kun hvis bil er aktiv)
|
|
- conditions:
|
|
- condition: trigger
|
|
id: arriving
|
|
|
|
- condition: state
|
|
entity_id: cover.anne
|
|
state: "closed"
|
|
|
|
- condition: template
|
|
value_template: >
|
|
{{ state_attr('device_tracker.snowywhite_location_tracker', 'speed') not in [None, 'unknown'] }}
|
|
|
|
sequence:
|
|
- service: cover.open_cover
|
|
target:
|
|
entity_id: cover.anne
|
|
|
|
- service: notify.mobile_app_clausiphone15
|
|
data:
|
|
message: "Garage opened (arrival by car)"
|
|
|
|
# LUK (kun hvis bil er aktiv)
|
|
- conditions:
|
|
- condition: trigger
|
|
id: leaving
|
|
|
|
- condition: state
|
|
entity_id: cover.anne
|
|
state: "open"
|
|
|
|
- condition: template
|
|
value_template: >
|
|
{{ state_attr('device_tracker.snowywhite_location_tracker', 'speed') not in [None, 'unknown'] }}
|
|
|
|
sequence:
|
|
- delay: "00:00:20" # giver tid til at du faktisk er kørt ud
|
|
|
|
- service: cover.close_cover
|
|
target:
|
|
entity_id: cover.anne
|
|
|
|
- service: notify.mobile_app_clausiphone15
|
|
data:
|
|
message: "Garage closed (departure by car)"
|
|
mode: single
|