Enhance camp day automation by adding additional time trigger and refining condition checks for improved accuracy

This commit is contained in:
Joshua King
2025-06-30 21:15:53 -04:00
parent c9db0c6d0c
commit 3b38f166cb

View File

@@ -1242,6 +1242,8 @@
at: "13:30:00" at: "13:30:00"
- platform: time - platform: time
at: "14:00:00" at: "14:00:00"
- platform: time
at: "14:30:00"
- platform: time - platform: time
at: "19:29:00" at: "19:29:00"
condition: condition:
@@ -1250,11 +1252,13 @@
state: 'on' state: 'on'
- condition: template - condition: template
value_template: > value_template: >
{{ 'no camp' in [ {{ 'no camp' in (
item.summary.lower() state_attr('calendar.family_events', 'data')
for item in (state_attr('calendar.family_events', 'data') or []) | selectattr('summary', 'defined')
if 'summary' in item | map(attribute='summary')
] }} | map('lower')
| list
) }}
action: action:
- variables: - variables:
messages: messages:
@@ -1273,12 +1277,11 @@
- service: notify.alexa_media - service: notify.alexa_media
data: data:
target: target:
# - media_player.living_room - media_player.living_room
# - media_player.declan_s_room - media_player.jordyn_s_room
# - media_player.jordyn_s_room - media_player.chloe_s_room
# - media_player.kitchen - media_player.declan_s_room
# - media_player.tv_alexa - media_player.kitchen
- media_player.parents_room
message: "{{ messages[now().strftime('%H:%M:%S')] }}" message: "{{ messages[now().strftime('%H:%M:%S')] }}"
data: data:
type: announce type: announce
@@ -1377,11 +1380,13 @@
state: 'on' state: 'on'
- condition: template - condition: template
value_template: > value_template: >
{{ 'no camp' in [ {{ 'no camp' in (
item.summary.lower() state_attr('calendar.family_events', 'data')
for item in (state_attr('calendar.family_events', 'data') or []) | selectattr('summary', 'defined')
if 'summary' in item | map(attribute='summary')
] }} | map('lower')
| list
) }}
action: action:
- service: media_player.play_media - service: media_player.play_media
data: data:
@@ -1389,4 +1394,4 @@
media_content_type: routine media_content_type: routine
target: target:
entity_id: media_player.basement_show entity_id: media_player.basement_show
mode: single mode: single