Create an whole day event in calendar via automation

Hey guys,

I´ve created an automation which creates an calendar event when I´m entering a special zone.
I call this service:

service: calendar.create_event
target:
  entity_id: calendar.myCalendar
data:
  summary: Work at Nordhorn
  location: Nordhorn
  start_date_time: "{{ now().strftime('%Y-%m-%d 9:00') }}"
  end_date_time: "{{ now().strftime('%Y-%m-%d 14:00') }}"

This works great, but I want to create an whole day event. I´ve tested start_date_time and end_date_time without time, I`ve tested

start_date: "{{ now().strftime('%Y-%m-%d') }}"

and always run into an error.

Does anyone know, how the correct syntax is for an whole day event?

Thanks.

To create an All Day event today, set start_date to today’s date and end_date to tomorrow’s date. In other words, there’s no time specified, just the date, and the end date must be the next day.

service: calendar.create_event
target:
  entity_id: calendar.myCalendar
data:
  summary: Work at Nordhorn
  location: Nordhorn
  start_date: "{{ now().strftime('%Y-%m-%d') }}"
  end_date: "{{ (now() + timedelta(days=1)).strftime('%Y-%m-%d') }}"
1 Like

Great! Thank you! That´s what I`m looking for.

1 Like