From 73dae481bdd3b2f1fa6c89251f72240bf1225ea6 Mon Sep 17 00:00:00 2001 From: Claus Dethlefsen Date: Sun, 15 Mar 2026 15:32:16 +0100 Subject: [PATCH] =?UTF-8?q?garagen=20er=20=C3=A5ben?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- include/automations/garage_anne.yaml | 77 ++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 include/automations/garage_anne.yaml diff --git a/include/automations/garage_anne.yaml b/include/automations/garage_anne.yaml new file mode 100644 index 0000000..34a6b21 --- /dev/null +++ b/include/automations/garage_anne.yaml @@ -0,0 +1,77 @@ +- alias: Garageport Anne åben reminder + id: garageport_anne_reminder + mode: restart + + trigger: + - platform: state + entity_id: cover.anne + to: "open" + + - platform: time + at: "21:00:00" + + condition: + - condition: state + entity_id: cover.anne + state: "open" + + action: + - delay: "00:05:00" + + - repeat: + while: + - condition: state + entity_id: cover.anne + state: "open" + + sequence: + + - service: notify.mobile_app_clausiphone15 + data: + title: "Garageport" + message: "Garageporten er åben. Skal garageporten lukkes?" + data: + tag: garage_anne_open + persistent: true + actions: + - action: CLOSE_GARAGE_ANNE + title: "Ja" + - action: IGNORE_GARAGE_ANNE + title: "Nej" + + - wait_for_trigger: + - platform: event + event_type: mobile_app_notification_action + event_data: + action: CLOSE_GARAGE_ANNE + + - platform: event + event_type: mobile_app_notification_action + event_data: + action: IGNORE_GARAGE_ANNE + + - platform: state + entity_id: cover.anne + to: "closed" + + timeout: "00:30:00" + + - choose: + + - conditions: + - condition: template + value_template: "{{ wait.trigger.event.data.action == 'CLOSE_GARAGE_ANNE' }}" + sequence: + - service: cover.close_cover + target: + entity_id: cover.anne + - stop: "Garage lukket via notifikation" + + - conditions: + - condition: template + value_template: "{{ wait.trigger.event.data.action == 'IGNORE_GARAGE_ANNE' }}" + sequence: + - stop: "Bruger valgte Nej" + + - delay: "00:30:00" +