Add Google Calendar to Home Assistant

by Danny
0 comment

In this guide, I will show you how to integrate your Google Calendar into Home Assistant in 2021. Once this integration is all setup, you will be able to create some really cool automations and Lovelace cards. A few example automations might be “Turn on light 5 minutes before a meeting starts”, or, you could import your favorites sports team calendar and display it in a Lovelace card.

For this guide, we are referencing the official Home Assistant documentation. I’m just expanding on it to my this more of a step by step guide.

Let’s get started!


Generate Client ID and Client Secret

Go to the Google Developers Console.

Choose “Create a Project” in the dropdown and check the 3 boxes for accepting the terms of service. Then click Agree and Continue.

Next, click Go to Credentials.

Step 1: Credential Type

choose Google Calendar API and select the User data radial.

Click Next.

Step 2: OAuth Consent Screen

Give your app a name like HA_CALENDAR. Add your email address to the user support email and developer contact information fields.

Then click Save and Continue.

Step 3: Scopes

Leave everything here with default values. Then click Save and Continue.

Step 4: OAuth Client ID

Choose TV and Limited Input devices. Name it the same as Step 2 (HA_CALENDAR).

Then click Create.

You will now see your Client ID. Your Client Secret can be found by clicking the Download button.

Store both of these in a secure location.


OAuth Consent Screen

Next, click the tab for “OAuth consent screen”

Under Test Users, click Add Users

Enter your email address again and click Save.


Add Google section to Configuration.yaml

To integrate Google Calendar with Home Assistant, the next step is to add this block of text to your Home Assistant configuration.yaml file.

Open your Home Assistant URL. Go to File Editor and click the folder at the top. Browse to configuration.yaml.

Paste in this code:

# Example configuration.yaml entry
google:
  client_id: YOUR_CLIENT_ID
  client_secret: YOUR_CLIENT_SECRET

Replace YOUR_CLIENT_ID and YOUR_CLIENT_SECRET with the client ID and Client Secret you just created. Both can be found in the the downloaded file.

The save the file in the top right corner.


Check Configuration and Restart Home Assistant

Go to Configuration > Server Controls.

Click Check Configuration. If it shows that your configuration is valid, you can now restart Home Assistant.

After HA restarts, click your notification icon.

Copy the code and then click the URL.

Paste the code in the “Enter Code” screen and click Next.

After clicking next, choose the Google account you set this up under:

You may see a screen that says “Google hasn’t verified this app”. Just click Continue here.

It will ask if you want HA_CALENDAR to access your Google Account. Click Allow.

If everything was successful, you will see a Success! Device connected screen that looks like this:

Navigate back to Home Assistant

You can now dismiss the Google Calendar setup under notifications.

At this step, you will now see a “Calendar” option on your sidebar. This means your Google Calendar has successfully been added to Home Assistant!

Click Calendar and see if all of your calendar events show up correctly.

To verify your calendar events are syncing up correctly, go to https://google.com/calendar and create a new “test event”. Then, come back to Home Assistant to confirm it shows up.

Wrapping Up

Congratulations! You have now successfully configured your personal calendar into Home Assistant. Like I said earlier, having your calendar with HA will allow you to create some really cool automations. I won’t be going over those in this guide, but I will add links to the bottom of this post over the next couple weeks with some automations I plan on adding.

I would like to point out that you aren’t able to create events from HA and add them to your Google Calendar quite yet, but I will show you how to do that in a future post.

Hope you found this tutorial useful! It should be very up to date, as I created this guide in May 2021.

0 comment

You may also like

Leave a Comment