hello,
my kids school sends out a lot emails with dates for different activities. I wrote a python script to extract the date and activity and I would like to add it to Home Assistant’s Local Calendar.
going off the very limited documentation found here:
I’ve tried sending the event with different variations of:
# JSON payload for creating an all-day event
event_data = {
"entity_id": "calendar.local",
"summary": "calendar test",
"start_date": "2024-11-02",
"end_date": "2024-11-03"
}
# Make the POST request to call the `calendar.create_event` service
response = requests.post(
f'{home_assistant_url}/api/services/calendar/create_event',
# f'{home_assistant_url}/api/calendars/event/create',
# f'{home_assistant_url}/api/calendar/event/create',
# f'{home_assistant_url}/api/calendars/{calendar_id}/events',
# f"{home_assistant_url}/api/services/calendar/create"
# f"{home_assistant_url}/api/calendar/event/{calendar_id}"
headers=headers,
json=event_data
)
I either get a 404: Not Found, 400: Bad Request, or 405: Method Not Allowed. I’ve asked ChatGPT and Claude and neither have been any help.
is it possible to add an event to Local Calendar from a python script api post?
Thank you