What?
Add support for being able to add calendar events to local calendar using MQTT topics and auto-discovery. This would make it possible for other programs outside Home Assistant to publish calendar events to Home Assistant, allowing automations and or dashboards for the data, or even for use in ESPHome devices for wall-calendar dashboards via the native api
How?
This could work by having the developer/person using MQTT to specify the Calendar event data in a specific way.
The discovery topic could be three separate like this:
/homeassistant/calendar/custom-cal-2-mqtt-name/event1/summary
/homeassistant/calendar/custom-cal-2-mqtt-name/event1/start_time
/homeassistant/calendar/custom-cal-2-mqtt-name/event1/end_time
Or perhaps a single json array?
/homeassistant/calendar/custom-cal-2-mqtt-name/calendar1/topic
which contains the json object topic to subscribe to:
/custom-cal-2-mqtt-name/calendar1/json
:
{
"events": [
{
"summary": "John's Birthday",
"start_time": "2023-07-15T14:00:00+02:00",
"end_time": "2023-07-15T16:00:00+02:00"
},
{
"summary": "Meeting with Team",
"start_time": "2023-07-20T10:00:00+02:00",
"end_time": "2023-07-20T12:00:00+02:00"
}
]
}
Potential issues
The current calendar supports modifying calendar events like delete, create etc. Adding support for external events like this might create the need for un-modifyable calendars/events, if that does not already exist?
Or,
The topic/discovery also providing a /command topic where home assistant can publish to update a calendar event. But not all sources might support this.
Another thought is which calendar do these events add to?
Maybe you specify the calendar name in the discovery topic?