Google Calender and Apple Calender into one

Is there an easy(ish) way to get a Google Cal and Apple Cal into one on HA? I use Google, girlfriend uses Apple and I want to pull both into something viewable on HA. I can’t seem to find anything on here that will do it, unless I’m blind (fully expect that to be the case)

The Calendar card allows you to select multiple calendars. The card then shows all of your events from all selected calendars. You can choose from 3 different display options. You are not technically combining separate calendars into one big calendar, just the events are displayed as a grouped display.

Any suggestions how to connect a Apple based calendar? Google was easy enough!

You’ll need to install the Google Calendar integration. https://www.home-assistant.io/integrations/google/.

This requires a Developer account, but it’s free and not too difficult to set up. You may already have one if you are using Google TTS or Google Translate, or any of the various API’s they offer.

Once all that is done, go to your Google Calendar settings page (on Google, not HA) and copy the URL that you’ll paste into HA.

Full path:

https://calendar.google.com/calendar/embed?src=en.usa%23holiday%40group.v.calendar.google.com&ctz=America%2FNew_York

This address gets pasted into google_calendar.yaml located in your root directory and looks like this.

#################################################################
# GOOGLE CALENDAR Integration
#################################################################
#
- cal_id: en.usa#[email protected]
  entities:
    - device_id: holidays_in_united_states
      ignore_availability: true
      name: Holidays in United States
#

Once you’ve got the integration set up and the calendar configured, you can run automations against it like this:

#############################################################
#   Notify User of upcoming Google Calendar Event
#############################################################
- id: user_upcoming_google_event
  alias: User Upcoming Google Event
  initial_state: TRUE
  mode: restart
  triggers:
  - trigger: template
    value_template: >-
      {{(as_timestamp(state_attr("calendar.holidays_in_united_states", "start_time"),0) - as_timestamp(now(),0) < 3600 )}}
  conditions:
  - condition: template
    # Only run if more than 1 hours (360 sec) since it last ran
    value_template: '{{(as_timestamp(now(),0) - as_timestamp(state_attr("automation.user_upcoming_google_event", "last_triggered"),0) | int > 3600 )}}'
  actions:
  - action: script.turn_on
    entity_id: script.notify_push_user_upcoming_event
    data:
      variables:
        var_message: >-
          Your next scheduled appointment starts at {{states('sensor.arts_next_appointment')}}, {{ state_attr('sensor.arts_next_appointment','appointment_title') }}

This is a brief overview of the process but should be enough to get you started. Best of luck!
Art

Thanks @kartcon, I was after how to add an Apple calender, I’ve managed to add my calender (Google), that was super easy

Wow, I totally went dyslexic on my last reply. :upside_down_face:, so lets try this again.
For the Apple Calendars you’ll need the CalDav integration. https://www.home-assistant.io/integrations/caldav/. You’ll need to supply your iCloud credentials to get access.
Quering the calendar is much the same. Here is one of my automations for example:

#############################################################
#   Notify Art of upcoming (IOS) Calendar Event
#############################################################
- id: art_upcoming_ios_event
  alias: Art Upcoming IOS Event
  initial_state: TRUE
  mode: restart
  triggers:
  - trigger: template
    value_template: >-
      {{(as_timestamp(state_attr("calendar.YOUR_CAL_NAME", "start_time"),0) - as_timestamp(now(),0) < 3600 )}}
  conditions:
  - condition: template
    # Only run if more than 1 hours (360 sec) since it last ran
    value_template: '{{(as_timestamp(now(),0) - as_timestamp(state_attr("automation.art_upcoming_ios_event", "last_triggered"),0) | int > 3600 )}}'
  actions:
  - action: script.turn_on
    entity_id: script.notify_push_art_upcoming_event
    data:
      variables:
        var_message: >-
          Your next scheduled appointment starts at {{states('sensor.arts_next_appointment_ios')}}, {{ state_attr('sensor.arts_next_appointment_ios','appointment_title') }}

My apologies for the wrong response earlier. I hope this is enough information to help you now. The CalDAV integration is UI based, so I don’t have a lot more info I can provide. Hopefully the documentation will be enough.
Art

1 Like

@kartcon thanks for the help! I’ll give it a good read through