WTH does the calendar not expose individual events

TL;DR
I’d expect there to be an array of (upcoming?) events in the calendar integration to use.


I’m using the CalDav integration to show our iCloud calendar in Home Assistant, but the same goes for Google Calendar; The state of this calendar entity only shows on/off when there is currently an event happening, there are no attributes that show (previous or upcoming) events individually like the weather integration does with forecasts.

The actual calendar dashboard view in Home Assistant does show them individually, why does it not expose them as an array of events in the attribute of the calendar?

In automations you can use calendar events as a trigger (with offset) and announce 30 min before. But currently there is no option to announce individual calendar events in a morning announcement for example.

Eg; I have something scheduled from Monday 8:00 to Friday 18:00 (6PM :eyes:). The calendar state is on for all those days and its attribute reads:

message: Multi-day test event
all_day: false
start_time: 2022-10-03 08:00:00
end_time: 2022-10-07 18:00:00
location: 
description: 
offset_reached: false
friendly_name: iCloud

When there is another event scheduled during one of those days, the attribute does not change but there is also no way to work with an upcoming event during that multi-day event.

The calendar integration should have an array of events, WTH?


Some links touching this topic can be found in this post:

Yes, the calendar integration is really lackluster at the moment.

I thought I could use multi-day events in a Google calendar to set my home automation to certain states like “home office day”, “normal work day”, “vacation at home”, “vacation away”, etc. but it seems impossible to use even use a “starts-with” text match as a sensor.

For your issue, you can see the calendar integration docs (parent calendar integration, not the individual in integrations) for examples of how to match events with templates.

This guy does a little workaround that can be handy:
Make Home Assistant Smarter with the Google Calendar Integration - YouTube

Also there is a nice workaround by using pyscript and the Calendar API.