I made an add-on that gives you an other way of integrating caldav or google calendar data and working with that data in Home Assistant automations and cards: Hass calendar add-on on Github.
Unlike the standard calendar integration, this add-on will give you a sensor with your calendar data in stead of a binary sensor. Once set up you’ll see an entity like this for each calendar you add to the add-on configuration:
entity: sensor.my-calendar state: 2 data: - startDate: '2022-01-08T20:00:00.000Z' endDate: '2022-01-08T23:30:00.000Z' summary: Event example one location: Some street, Some place label: 🎉 party-time year: '22' start_month: jan start_day: 8 start_time: '21:00' end_month: jan end_day: 9 end_time: '00:30' - startDate: '2022-01-14T17:30:00.000Z' endDate: '2022-01-14T20:30:00.000Z' summary: Event example two location: My house year: '22' start_month: jan start_day: 14 start_time: '18:30' end_month: jan end_day: 14 end_time: '21:30' recurring: true
With the raw data available like this you can then build automations on top of that.
I made some choices that fit my current needs that you need to be aware of if you´d start using this add-on as well:
- the add-on will query your calendar(s) for all events from today until a chosen number of future days. Past events are not available in the sensor.
- caldav ‘categories’ and google calendar ‘description’ fields will end up in the
labelfield in the sensor
Support for recurring events can be improved, for now you’ll know an event is recurring by the boolean field
recurring. Similarly there’s a boolean for
whole_day events as well. I plan to work on improvements here and also provide a config option to include past events as well. But development will probably be slow as I have other projects to work on for now.
My main personal usage is in the front-end. The standard calendar panel in Home Assistant is already very nice, but with the data from the add-on you can build your own calendar lay-outs or include calendar-data in other cards with HA’s templating syntax.
For instance, I have this summary of upcoming events on my main dashboard:
Another design I made (still WIP) is for your typical 3 column family planner:
This too is a custom button card (card code on github). The label-fields from the data are used to mimic the stickers you often get with physical planners.
I’m not fully happy with the design yet, I’d be interested to see how others that are better at design would improve on this template. And functionally the possibility to switch months is still missing.