Add `DELETE_EVENT` Service to `Calendar` Integration

Anyone figure out how to do this? I also need the ability to delete/modify events. I’m attempting to sync specific events in my work calendar with home calendar, and often some of them change and I need that reflected.

For instance at the start of the day my lunch is always set to 11:30, but at times it gets moved to Noon or 1pm. Right now what I have would wind up with Lunch in my personal account at 11:30 and 1pm if it got moved.

+1 from me too. My use case is my Heat pump legionella cycle. It is set to run every 2 weeks from a calendar event. However it will run sooner if the electric is cheap enough. The automation adds a new trigger event for 2 weeks time but ATM I have to manually remove the original one or it runs too often.

+1’ing because I just spent all afternoon wondering why everything I tried to do to delete a calendar event wasn’t working. I’d even be happy with the ability to programmatically delete the whole calendar and recreate it.

Delete event works OK for me.

What I’d like though is to delete a whole calendar. I set up whole load of test calendars and now want to remove them. I can delete all the events out of one but can’t delete the entire thing.

How are you using delete event? Not through the API?

Voting here too.

Use case for me:

  • Button press → create a “coffee” event tomorrow morning. If such event happens → turn on my coffee machine.
  • Double press → want to be able to delete any event called “coffee” tomorrow, if any listed. If I change my mind to start it manually at another time.

Really shocked to discover this missing functionality! My use case is super simple, I just want to delete events that match certain criteria (created by the LLM Vision integration). The only way I can think of to workaround this without hacking the back-end is to create a separate calendar and automation that selectively copies events to it. Seems like a lot of overhead to accomplish something so simple

I was talking about accessing it through the IP address (is that the API?) or via the Android App. But I think posters here are maybe referring to something different so I am off topic.

Still have not found out how to delete a whole calendar. Also, if you uncheck a calendar off one’s calendar list does that deactivate all the events in it too, or do they still activate but just not show on the calendar screen?

I also want this functionality.

1+ for an option to delete calendar events

There could definitely be a command for deleting created calendar events. Even something like this would work: “Get calendar events” creates a list of events, and based on the event description, all matching results could be deleted.

For example, I currently have a smart plug that switches on according to electricity prices. However, sometimes I want to permanently disable it (by physical button), and Home Assistant creates a calendar event that prevents the plug from being switched on.

At the same time, there may be situations where I want to turn the plug on for a specific period (for example, 6 hours), and HA also creates an event for that. Unfortunately, the plug then switches off because the calendar already contains a command to keep it turned OFF. The automation can no longer work properly either.

FYI, such an API exists in websocket. Someone correct me if I’m wrong, but I think there’s no integration/platform for using websocket in automations (the equivalent of a REST platform)? So I think it could maybe be done via the command_line platform, calling something like websocat.

Regarding the API, I use it in my little calendar card (frontend cards have easy access to websocket). To delete/edit an event, you need its uid, and even the REST call returns it:

  async getCalendarEvents(entity_id,start,end) {
    if (!(entity_id && start && end)) throw new Error('getCalendarEvents: bad arguments');
    const result = {value: [], error: null};
    const params = `?start=${start.toISOString()}&end=${end.toISOString()}`;
    try {
      const r = await this.hass.callApi('GET',`calendars/${entity_id}${params}`);
      result.value = r;
    } catch (ex) {
      result.error = ex;
    }
    return result;
  }

In case of successful call, result.value elements contain uid field which can be used for deletion via websocket call.

  deleteCalendarEvent(entity_id,uid) {
    if (!(entity_id && uid)) throw new Error('deleteCalendarEvent: bad arguments');
    try {
      this.hass.callWS({
        type: "calendar/event/delete",
        entity_id,
        uid,
      });
    } catch (ex) {
      console.error(ex);
      return false;
    }
    return true;
  }