From 72ef3af179898a12b30f8149bb6718a96e81b751 Mon Sep 17 00:00:00 2001 From: Joshua King Date: Fri, 27 Jun 2025 14:23:58 -0400 Subject: [PATCH] Refactor day camp automation conditions to use calendar events for improved accuracy --- automations.yaml | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/automations.yaml b/automations.yaml index bf786d9..9013ea5 100644 --- a/automations.yaml +++ b/automations.yaml @@ -1261,22 +1261,19 @@ data: type: announce method: all -- id: '1744503044812' - alias: Check day camp daily - trigger: - - platform: time - at: '04:00:00' - action: - - service: script.check_day_camp - id: '1744503044813' alias: Announce day camp preparation and pause TV trigger: - platform: time at: '08:30:00' - condition: - - condition: state - entity_id: input_boolean.day_camp_today - state: 'on' + conditions: + - condition: state + entity_id: calendar.m365_family_events + state: 'on' + - condition: template + value_template: > + {{ 'camp' in (state_attr('calendar.family_events', 'message') | lower) and + 'no' not in (state_attr('calendar.family_events', 'message') | lower) }} action: - service: notify.alexa_media data: @@ -1295,10 +1292,14 @@ trigger: - platform: time at: '08:45:00' - condition: - - condition: state - entity_id: input_boolean.day_camp_today - state: 'on' + conditions: + - condition: state + entity_id: calendar.m365_family_events + state: 'on' + - condition: template + value_template: > + {{ 'camp' in (state_attr('calendar.family_events', 'message') | lower) and + 'no' not in (state_attr('calendar.family_events', 'message') | lower) }} action: - service: notify.alexa_media data: