From 290b0aa373cc0d50ae56ac61eb913de933faa3b9 Mon Sep 17 00:00:00 2001 From: Claus Dethlefsen Date: Thu, 19 Mar 2026 06:59:52 +0100 Subject: [PATCH] Update garage automation to use device_tracker and add notifications MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Replace sensor.claus_distance_home with device_tracker.clausiphone (home/not_home) - Change triggers from numeric_state to state-based presence detection - Adjust active time window to 05:00–23:00 - Add push notifications to mobile_app_clausiphone15 on garage open/close --- .../open_garage_when_car_arrives.yaml | 34 ++++++++++++------- 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/include/automations/open_garage_when_car_arrives.yaml b/include/automations/open_garage_when_car_arrives.yaml index a1a5c01..921efe1 100644 --- a/include/automations/open_garage_when_car_arrives.yaml +++ b/include/automations/open_garage_when_car_arrives.yaml @@ -1,29 +1,31 @@ -- id: garage_auto_claus_distance +- id: garage_auto_claus_presence alias: Garage auto Claus trigger: - - platform: numeric_state - entity_id: sensor.claus_distance_home - below: 40 + - platform: state + entity_id: device_tracker.clausiphone + to: "home" id: arriving - - platform: numeric_state - entity_id: sensor.claus_distance_home - above: 60 + - platform: state + entity_id: device_tracker.clausiphone + from: "home" + to: "not_home" id: leaving condition: - condition: time - after: "05:30:00" - before: "22:30:00" + after: "05:00:00" + before: "23:00:00" + - condition: state entity_id: device_tracker.snowywhite_location_tracker - state: "home" + state: "home" action: - choose: - # ÅBN + # ÅBN (Arriving) - conditions: - condition: trigger id: arriving @@ -35,7 +37,11 @@ target: entity_id: cover.anne - # LUK + - service: notify.mobile_app_clausiphone15 + data: + message: "Garage opened (arrival detected)" + + # LUK (Leaving) - conditions: - condition: trigger id: leaving @@ -47,5 +53,9 @@ target: entity_id: cover.anne + - service: notify.mobile_app_clausiphone15 + data: + message: "Garage closed (departure detected)" + mode: single