Add events to local calendar in automation / node-red?

I want to be able to add events to the local calendar programmatically or via an automation for tracking things. For example, if I exercise on a given day, I want to be able to push a button and have it log an event on the local calendar, so I can go back and view that history on the calendar.

Has anyone else done something like this? Is there a way to add events via an automation?

You need to be on the newest release (2023.2), the calendar.create_event service was just added. The basic service would be something like:

service: calendar.create_event
data:
  summary: Workout
  description: ''
  start_date_time: "{{ now() }}"
  end_date_time: "{{ now() }}"
target:
  entity_id: calendar.your_cal
2 Likes

Oh I totally missed that from the release notes. That’s what I get from scrolling too fast. I will update soon to get access to that service. Thank you for pointing that out and the sample yaml!

Did you happen to get this to work in Node Red? I’m trying to figure out which node to use to add a calendar event in HA through a Node Red flow.

Did you find a way to do that from Nodered ? I’m actually looking to add an event into a HA calendar but can’t find how to write the syntax into the nodes…