From f509fc1739aacabc8fa306e667fd6323e56586ff Mon Sep 17 00:00:00 2001 From: Carlo Costanzo Date: Fri, 3 Oct 2025 18:13:01 -0400 Subject: [PATCH] Add state trigger for garage doors and enhance notification message formatting Implemented a new state trigger for the garage doors to notify when they are opened. Improved the notification message to dynamically reflect the status of both garage doors, providing clearer information on their state. This enhances user awareness and control over garage access. --- config/packages/garadget.yaml | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/config/packages/garadget.yaml b/config/packages/garadget.yaml index 5b3e9c93..d8588b38 100755 --- a/config/packages/garadget.yaml +++ b/config/packages/garadget.yaml @@ -330,6 +330,11 @@ automation: trigger: - platform: time_pattern minutes: '/45' + - platform: state + entity_id: + - cover.large_garage_door + - cover.small_garage_door + to: 'open' - platform: state entity_id: group.family to: not_home @@ -370,8 +375,17 @@ automation: - service: script.notify_engine data: title: 'Check Garage Doors:' - value1: "Small: {{ states('cover.small_garage_door')}}" - value2: "Large: {{ states('cover.large_garage_door')}}" + value1: > + {% set open = [] %} + {% if is_state('cover.small_garage_door','open') %}{% set _ = open.append('Small garage door') %}{% endif %} + {% if is_state('cover.large_garage_door','open') %}{% set _ = open.append('Large garage door') %}{% endif %} + {% if open|length == 0 %} + All garage doors are closed. + {% elif open|length == 1 %} + {{ open[0] }} is open. + {% else %} + {{ open|join(' and ') }} are open. + {% endif %} who: "family" camera_entity: "camera.garagecam" group: 'information'