Google calender Adding event with automation

Using Google calendar integration I’m trying to set event on my calender by automation and google.add_event service.

As I’m triggering this automation I’m receiving the following error message:

Forbidden response from API: 403, message=‘Forbidden’, url=URL(‘https://www.googleapis.com/calendar/v3/calendars/calendar.********/events’)

I triedtoo look for any premissions issues on Google Cloud Console. Nut as far sa my knowladge can figure out I couldn’t trace any fault. Any ides? Things to look for?

Use the google.create_event service instead.

1 Like

Thanks
Now I get different error:

extra keys not allowed @ data[‘calendar_id’]. Got None

The two services use slightly different configuration variables… google.create_event does not use the calendar_id, but instead takes the entity ID as a target:

service: google.create_event
data:
  summary: Bowling
  description: Birthday bowling
  start_date_time: 2024-03-22T20:00:00.000Z
  end_date_time: 2024-03-22T22:00:00.000Z
target:
  entity_id: calendar.example
1 Like

Thanks.

Yet again I got the same error:

This is the YAML:

service: google.create_event
data:
summary: Gg
start_date_time: >-
{{ ((as_timestamp(now()) + (3 * 7 * 86400)) | timestamp_custom(‘%Y-%m-%d’))
+ ‘T00:00:00Z’ }}
end_date_time: >-
{{ ((as_timestamp(now()) + (3 * 7 * 86400)) | timestamp_custom(‘%Y-%m-%d’))
+ ‘T00:00:01Z’ }}
target:
entity_id: calender.XXXXXX

Please follow the Community Guidelines by posting configuration with proper formatting.

The template could be simpler and the entity ID is misspelled.

service: google.create_event
data:
  summary: Gg
  start_date_time: "{{ today_at() + timedelta(days=21) }}"
  end_date_time: "{{ today_at() + timedelta(days=21, minutes=1) }}"
target:
  entity_id: calendar.EXAMPLE