Featured image of post Backing Up Home Assistant to Google Drive

Backing Up Home Assistant to Google Drive

If Home Assistant crashes and no backup exists, everything is gone: automations, integrations, years of configuration. I'll show you how to automatically back up to Google Drive – encrypted and without much effort.

My first backup video used Microsoft OneDrive as the example. After that, many comments came in with the same question: And how does that work with Google Drive? Fair enough – not everyone wants to use Microsoft. So here’s the answer.

The good news upfront: Home Assistant encrypts its backups by default before they reach the cloud. That means neither Google nor Microsoft can read the contents. This makes storing backups on a third-party service perfectly acceptable from a privacy standpoint – and takes the wind out of one of the most common objections.

The setup with Google Drive is more complex than with OneDrive, however, because you need to complete a few steps in the Google Cloud Console. I’ll walk you through all of them.

YouTube Video
To load the video, please click the image. Please note that by doing so, data will be transmitted to YouTube.

Home Assistant Backups with Google Drive

In my previous video on backups, I introduced the new backup mechanism in Home Assistant starting with version 2025.1 and demonstrated – using Microsoft OneDrive as an example – how easy it is to store encrypted backups at a secure second location using the built-in options. The Microsoft OneDrive integration in Home Assistant is very straightforward, but not everyone wants to use OneDrive.

So in this video, I want to show another popular alternative: integrating Google Drive into Home Assistant, step by step. The initial setup is more complex than with OneDrive, so I’ll walk through the entire process.

By the way: since Home Assistant encrypts its backups by default, storing such sensitive backups on cloud storage from Microsoft or Google is not a privacy concern at all, and can in my assessment be done without hesitation.

If you’d like to familiarize yourself with the basics of the new backup mechanism first, I recommend watching this video before continuing. In the following, I’ll focus exclusively on integrating Google Drive into the backup mechanism and won’t repeat the general overview of Home Assistant’s backup system here.

Prerequisites

You’ll need a Google account to get started. Your Home Assistant installation also needs to be running a version that supports the new backup mechanism, i.e., version 2025 or later.

What you need to set up in Google and why:

For Home Assistant to communicate with Google Drive, you need to create the following elements in the Google Cloud Console:

  1. Google Cloud Project
    The project is the container where all configuration for your Home Assistant connection is collected. You can manage specific settings and all access centrally here.

  2. OAuth Consent Screen
    This step is required to identify Home Assistant as an application authorized to communicate with your Google Drive. Here you define basic information about the application, such as name, email address, and access permissions.

  3. OAuth Client (Web Application)
    The OAuth client is the access key that Home Assistant uses to authenticate with your Google account. It consists of two parts: the Client ID and the Client Secret. These are entered into Home Assistant later.

  4. Google Drive API
    This API allows Home Assistant to access your Google Drive and store or retrieve files there. It must be explicitly enabled for the connection to work.

  5. Test Users
    Since your application is not verified by Google, you need to add your own email address as a test user to gain access.

Integrating Google Drive into Home Assistant

In your Home Assistant installation, go to Settings and then Integrations. Click Add Integration and search for the entry Google → Google Drive.

The setup wizard that follows will ask you for a name (which you can choose freely), as well as an OAuth Client ID and an OAuth Client Secret.

In the upper section of the setup wizard, the necessary links are provided for creating this ID and secret. Let’s take a closer look at those now.

Google Cloud Platform Login

Click the OAuth Consent Screen link and sign in with your Google account if you haven’t already. You’re now in the configuration area of the Google Cloud, in the Google Authentication Platform dialog.

Creating a Google Project

If you’ve never been here before, you need to create a project first.

  1. Click Create Project and give your project a name, for example Home Assistant Backup.
  2. Click Create and wait a few seconds for the project to be created.

Registering an OAuth Application with Google

Creating the OAuth Configuration

You’ll now see the OAuth Overview screen with a notice that the Authentication Platform has not yet been configured.

  1. Click Get started.
  2. Enter a name for the app, for example Home Assistant or Home Assistant Backup.
  3. Under User support email, select your email address from the dropdown menu and click Next.
  4. Under Audience, select the option External and click Next.
  5. Under Contact Information, enter your Google email address and click Next again.
  6. Confirm the User Data Policy with a click and select Continue.
  7. Click Create.

Google will now confirm with the message OAuth Configuration Created that everything was set up successfully.

Creating an OAuth Client

  1. On the screen shown, click Create OAuth Client.
  2. Under Application Type, select Web Application.
  3. Leave the name as Web Client 1 or enter a custom name like Home Assistant Backup.
  4. Scroll down and under Authorized Redirect URIs, click the Add URI button.
  5. Paste the address that Home Assistant shows you in the setup dialog under Step 5.
  6. Click Create.

Google will now display the generated Client ID and Client Secret. Copy this information and paste it into the Home Assistant setup dialog.

Configuring Audience and Test Users

To actively use the authentication, you still need to add your email address as a test user on the Google side.

  1. In the Google Cloud Console, navigate from Clients to Audience in the left sidebar.
  2. Scroll down to Test Users.
  3. Click Add Users and enter your Google email address.
  4. Confirm your entry.

Enabling the Google Drive API

Before everything works, you need to enable the Google Drive API in the Google Cloud Console so that Home Assistant can use it after authentication.

  1. In the Google Cloud Console, switch from Google Authentication Platform to APIs & Services in the left navigation bar.
  2. Click Enable APIs and Services.
  3. Type Drive into the search field.
  4. Select Google Drive API from the search results.
  5. Click Enable.

This may take a few seconds. Afterwards, you’ll be redirected to a screen showing details about the Google Drive API usage.

Completing the Connection with Home Assistant

  1. Return to Home Assistant and click Open Website.
  2. Select your Google account again if prompted.
  3. Confirm Google’s warning that this application has not been verified by clicking Continue.
  4. On the next screen, confirm that you want to link your Google account with Home Assistant and click Continue.

At this point, a wizard to open My Home Assistant Links may appear.

  1. Enter your Home Assistant URL once and confirm with Save.
  2. Finally, the prompt Link Account Home Assistant will appear, which you can confirm by clicking Link Account.

Completing the Setup in Home Assistant

  1. Return to Home Assistant, where you’ve already entered the API Key, OAuth Key, and Client Secret.
  2. Click Open Website.
  3. Select your Google account and confirm that the app has not been verified by clicking Continue.
  4. Confirm once more that you want to proceed with the configuration.
  5. Finally, click Link Account.

If everything has been set up correctly, you’ll receive a Success message in Home Assistant confirming that the Google Drive configuration has been created.

Configuring Backup Settings in Home Assistant

You can now – as you may already know from the previous video – go to Settings > System > Backups, then Backup Settings > Backup Locations and enable Google Drive there.

From now on, your backups will be saved not only locally, but also to Google Drive.

→ If you want to understand why it’s important not to rely solely on manufacturer clouds, this article is worth a read: Wenn dein Smart Home plötzlich dumm wird – und was du dagegen tun kannst

To load the comments, please click 'Show comments'. Please note that by doing so, data will be transmitted to Disqus.
Show comments
Built with Hugo
Theme Stack designed by Jimmy