From 3d988314aa1660121282210f9833405b7d19f755 Mon Sep 17 00:00:00 2001 From: Claus Dethlefsen Date: Fri, 20 Mar 2026 07:27:35 +0100 Subject: [PATCH] Use vehicle speed attribute to control garage opening - Only open garage if SnowyWhite tracker has valid speed attribute - Prevents false triggers when car is asleep (speed = unknown) - Ensures garage opens only when arriving by car, not bike or foot --- .../open_garage_when_car_arrives.yaml | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/include/automations/open_garage_when_car_arrives.yaml b/include/automations/open_garage_when_car_arrives.yaml index dffc134..0ad832b 100644 --- a/include/automations/open_garage_when_car_arrives.yaml +++ b/include/automations/open_garage_when_car_arrives.yaml @@ -17,22 +17,22 @@ after: "05:00:00" before: "23:00:00" - - condition: not - conditions: - - condition: state - entity_id: device_tracker.snowywhite_location_tracker - state: "not_home" - action: - choose: - # ÅBN (Arriving) + # Å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: @@ -40,15 +40,17 @@ - service: notify.mobile_app_clausiphone15 data: - message: "Garage opened (arrival detected)" + message: "Garage opened (arrival by car)" - # LUK (Leaving) + # LUK (uændret logik) - conditions: - condition: trigger id: leaving + - condition: state entity_id: cover.anne state: "open" + sequence: - service: cover.close_cover target: @@ -59,4 +61,3 @@ message: "Garage closed (departure detected)" mode: single -