Refactor calendar event conditions to use 'summary' instead of 'message' for improved accuracy in automation triggers
This commit is contained in:
@@ -1211,10 +1211,8 @@
|
|||||||
entity_id: calendar.m365_family_events
|
entity_id: calendar.m365_family_events
|
||||||
state: 'on'
|
state: 'on'
|
||||||
- condition: template
|
- condition: template
|
||||||
value_template: '{{ ''camp'' in (state_attr(''calendar.family_events'', ''message'')
|
value_template: '{{ ''camp'' in (state_attr(''calendar.family_events'', ''summary'')
|
||||||
| lower) }}
|
| lower) }}'
|
||||||
|
|
||||||
'
|
|
||||||
action:
|
action:
|
||||||
- service: media_player.play_media
|
- service: media_player.play_media
|
||||||
data:
|
data:
|
||||||
@@ -1251,8 +1249,8 @@
|
|||||||
entity_id: calendar.m365_family_events
|
entity_id: calendar.m365_family_events
|
||||||
state: 'on'
|
state: 'on'
|
||||||
- condition: template
|
- condition: template
|
||||||
value_template: '{{ (state_attr(''calendar.family_events'', ''message'') | lower)
|
value_template: '{{ ''no camp'' in (state_attr(''calendar.family_events'', ''summary'')
|
||||||
== ''no camp'' }}'
|
| lower) }}'
|
||||||
actions:
|
actions:
|
||||||
- variables:
|
- variables:
|
||||||
messages:
|
messages:
|
||||||
@@ -1292,9 +1290,9 @@
|
|||||||
entity_id: calendar.m365_family_events
|
entity_id: calendar.m365_family_events
|
||||||
state: 'on'
|
state: 'on'
|
||||||
- condition: template
|
- condition: template
|
||||||
value_template: "{{ 'camp' in (state_attr('calendar.family_events', 'message')
|
value_template: "{{ 'camp' in (state_attr('calendar.family_events', 'summary')
|
||||||
| lower) and \n 'no' not in (state_attr('calendar.family_events', 'message')
|
| lower) and 'no' not in (state_attr('calendar.family_events', 'summary')
|
||||||
| lower) }}\n"
|
| lower) }}"
|
||||||
action:
|
action:
|
||||||
- service: media_player.play_media
|
- service: media_player.play_media
|
||||||
data:
|
data:
|
||||||
@@ -1322,9 +1320,9 @@
|
|||||||
entity_id: calendar.m365_family_events
|
entity_id: calendar.m365_family_events
|
||||||
state: 'on'
|
state: 'on'
|
||||||
- condition: template
|
- condition: template
|
||||||
value_template: "{{ 'camp' in (state_attr('calendar.family_events', 'message')
|
value_template: "{{ 'camp' in (state_attr('calendar.family_events', 'summary')
|
||||||
| lower) and \n 'no' not in (state_attr('calendar.family_events', 'message')
|
| lower) and 'no' not in (state_attr('calendar.family_events', 'summary')
|
||||||
| lower) }}\n"
|
| lower) }}"
|
||||||
action:
|
action:
|
||||||
- service: media_player.play_media
|
- service: media_player.play_media
|
||||||
data:
|
data:
|
||||||
@@ -1335,11 +1333,12 @@
|
|||||||
- 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.declan_s_room
|
||||||
- media_player.jordyn_s_room
|
# - media_player.jordyn_s_room
|
||||||
- media_player.kitchen
|
# - media_player.kitchen
|
||||||
- media_player.tv_alexa
|
# - media_player.tv_alexa
|
||||||
|
- media_player.parents_room
|
||||||
message: 'It is time to leave for day camp. Please do the following: Put on
|
message: 'It is time to leave for day camp. Please do the following: Put on
|
||||||
shoes, Get lunch, Get water bottle, Get bag if needed.'
|
shoes, Get lunch, Get water bottle, Get bag if needed.'
|
||||||
- id: '1744503044145'
|
- id: '1744503044145'
|
||||||
@@ -1354,9 +1353,9 @@
|
|||||||
entity_id: calendar.m365_family_events
|
entity_id: calendar.m365_family_events
|
||||||
state: 'on'
|
state: 'on'
|
||||||
- condition: template
|
- condition: template
|
||||||
value_template: "{{ 'camp' in (state_attr('calendar.family_events', 'message')
|
value_template: "{{ 'camp' in (state_attr('calendar.family_events', 'summary')
|
||||||
| lower) and \n 'no' not in (state_attr('calendar.family_events', 'message')
|
| lower) and 'no' not in (state_attr('calendar.family_events', 'summary')
|
||||||
| lower) }}\n"
|
| lower) }}"
|
||||||
action:
|
action:
|
||||||
- service: media_player.play_media
|
- service: media_player.play_media
|
||||||
data:
|
data:
|
||||||
@@ -1375,10 +1374,8 @@
|
|||||||
entity_id: calendar.m365_family_events
|
entity_id: calendar.m365_family_events
|
||||||
state: 'on'
|
state: 'on'
|
||||||
- condition: template
|
- condition: template
|
||||||
value_template: '{{ ''no camp'' in (state_attr(''calendar.family_events'', ''message'')
|
value_template: '{{ ''no camp'' in (state_attr(''calendar.family_events'', ''summary'')
|
||||||
| lower) }}
|
| lower) }}'
|
||||||
|
|
||||||
'
|
|
||||||
actions:
|
actions:
|
||||||
- data:
|
- data:
|
||||||
media_content_id: Reset Alexa Volume
|
media_content_id: Reset Alexa Volume
|
||||||
|
|||||||
Reference in New Issue
Block a user