We currently have the ability to create and list local calendar events, but there’s no ability to delete an event. This topic has come up several times in the past with the most developed discussion here. From the Local Calendar Development Docs, it looks like the code is already there but just needs to be exposed as a service.
I’m currently do a file deletion through python and then reloading the calendar. For my current use case, that’s acceptable since I don’t need historical data, but I do want to be able to delete events between certain dates and recurring events.
Precisely. If I could get my head around how to do it in the core release, I would. The documentation, while extensive, remains well beyond my skill level and understanding.
ETA: Sorry, this reply was based on a misreading of the comment to which I replied. I somehow read that as: “No need to add it as an action.” In any case, the explanation is potentially useful here, so I am leaving it with this note for clarification as to why I posted it as a reply.
Unless something has changed, it is needed as an action for automation. For instance, I have an automation that creates a calendar event to trigger an HA restart based on a date stored in a sensor (because the date in the sensor can change while a restart is still necessary on the prior date). If HA is restarted after the sensor date changes and before the event date passes, then it no longer needs to restart on the event date. However, iIf that event isn’t deleted before it is reached, HA will restart whether it needs to or not. If that old future event isn’t deleted, then HA will restart at that time for no reason. Because there is no delete event action, I have to notify myself to manually delete the event when HA restarts under the appropriate conditions instead of simply having the automation delete the event. Further, to make the automation fully autonomous, it also has to know when to create the new event, and the best time to do that is exactly when it should delete the old event (as soon as it knows the event is unnecessary / immediately after a relevant but unrelated restart), the best way I can come up with to detect this is to compare the sensor time and the event time at startup, but because the automation cannot delete the old event that means this will ultimately lead to creation of duplicate events on each restart until/unless I delete the event that the automation should have been able to delete to begin with.