From 70b78b6275cef2afcecfa04a1a5651c13b269e51 Mon Sep 17 00:00:00 2001 From: Claus Dethlefsen Date: Fri, 20 Mar 2026 16:31:58 +0100 Subject: [PATCH] Improve garage closing logic using vehicle activity - 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 --- include/automations/open_garage_when_car_arrives.yaml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/include/automations/open_garage_when_car_arrives.yaml b/include/automations/open_garage_when_car_arrives.yaml index 0ad832b..a75c345 100644 --- a/include/automations/open_garage_when_car_arrives.yaml +++ b/include/automations/open_garage_when_car_arrives.yaml @@ -42,7 +42,7 @@ data: message: "Garage opened (arrival by car)" - # LUK (uændret logik) + # LUK (kun hvis bil er aktiv) - conditions: - condition: trigger id: leaving @@ -51,13 +51,18 @@ 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 detected)" - + message: "Garage closed (departure by car)" mode: single