I’d like to create an automation based on the state attributes generated by MicrosoftCalendar integration.
The automation should be triggered when at least one of the ‘summary’ attributes within the ‘data’ group contains a specific string (in the example below I need to trigger if in ‘data’ I have at least one ‘summary: Sam at home’).
I guess I need to create a template with the group expand function, but I have no idea how to combine it with string search…
Below the state attribute YAML
message: No school!
all_day: true
start_time: "2023-12-08 00:00:00"
end_time: "2023-12-09 00:00:00"
location: ""
description: ""
data:
- summary: No school!
start: "2023-12-08"
end: "2023-12-09"
all_day: true
description: ""
location: ""
categories: []
sensitivity: Normal
show_as: Free
attendees:
- email: [email protected]
type: required
uid: >-
AQMkADAwATEx
- summary: Sam at home
start: "2023-12-08"
end: "2023-12-09"
all_day: true
description: ""
location: ""
categories:
- HOME
sensitivity: Normal
show_as: Free
attendees: []
uid: >-
AQMkADAwATEx
- summary: Sam at home
start: "2023-12-09"
end: "2023-12-11"
all_day: true
description: ""
location: ""
categories:
- HOME
sensitivity: Normal
show_as: Free
attendees: []
uid: >-
AQMkADAwATEx
color: light_green
hex_color: "#87d28e"
offset_reached: false
friendly_name: Calendar home