From 3b38f166cb188105b0be0ddfb6b491fcbed04108 Mon Sep 17 00:00:00 2001 From: Joshua King Date: Mon, 30 Jun 2025 21:15:53 -0400 Subject: [PATCH] Enhance camp day automation by adding additional time trigger and refining condition checks for improved accuracy --- automations.yaml | 39 ++++++++++++++++++++++----------------- 1 file changed, 22 insertions(+), 17 deletions(-) diff --git a/automations.yaml b/automations.yaml index 9591038..14814f3 100644 --- a/automations.yaml +++ b/automations.yaml @@ -1242,6 +1242,8 @@ at: "13:30:00" - platform: time at: "14:00:00" + - platform: time + at: "14:30:00" - platform: time at: "19:29:00" condition: @@ -1250,11 +1252,13 @@ state: 'on' - condition: template value_template: > - {{ 'no camp' in [ - item.summary.lower() - for item in (state_attr('calendar.family_events', 'data') or []) - if 'summary' in item - ] }} + {{ 'no camp' in ( + state_attr('calendar.family_events', 'data') + | selectattr('summary', 'defined') + | map(attribute='summary') + | map('lower') + | list + ) }} action: - variables: messages: @@ -1273,12 +1277,11 @@ - service: notify.alexa_media data: target: - # - media_player.living_room - # - media_player.declan_s_room - # - media_player.jordyn_s_room - # - media_player.kitchen - # - media_player.tv_alexa - - media_player.parents_room + - media_player.living_room + - media_player.jordyn_s_room + - media_player.chloe_s_room + - media_player.declan_s_room + - media_player.kitchen message: "{{ messages[now().strftime('%H:%M:%S')] }}" data: type: announce @@ -1377,11 +1380,13 @@ state: 'on' - condition: template value_template: > - {{ 'no camp' in [ - item.summary.lower() - for item in (state_attr('calendar.family_events', 'data') or []) - if 'summary' in item - ] }} + {{ 'no camp' in ( + state_attr('calendar.family_events', 'data') + | selectattr('summary', 'defined') + | map(attribute='summary') + | map('lower') + | list + ) }} action: - service: media_player.play_media data: @@ -1389,4 +1394,4 @@ media_content_type: routine target: entity_id: media_player.basement_show - mode: single \ No newline at end of file + mode: single