I currently have a template that grabs calendar events from a Google Calendar. If there is only 1 event in the calendar it works great. If there are more than 1, not as great. There are (4) entries ; Neave Special, Religion, Lunch and random topics.
Somedays there are 1, no problem; when there are (2) or more, problems arise. It may not always be the same (2) so I cannot use the [0], [1], etc to parse out the event.
scheduled_events:
- start: '2023-10-24'
end: '2023-10-25'
summary: Neave Special
description: Wear a jersey day
- start: '2023-10-25'
end: '2023-10-26'
summary: Religion
description: Religion Class Today
icon: mdi:calendar
friendly_name: Neave Scheduled Events
Is there a way to parse/filter these, so each of the topics has it’s own entity that I can use in an announcement sensor for the next day. currently it will only take today’s instance.
Thank you for sharing your code which works fine. In my case the sensor spits out the following:
scheduled_events:
- start: '2024-01-05'
end: '2024-01-06'
summary: Abfuhr blaue Papiertonne
description: Die Abholung erfolgt ab 6:00 Uhr
location: "***"
icon: mdi:calendar
friendly_name: Papiertonne Termine
Now I try to extract the start time from that event as I want to count the days from now until that event starts. Do you have any idea how I can do that?