
A complete and easy way to back up Home Assistant to Google Drive.
This is for you if you want to quickly set up a backup strategy without much fuss. It doesn't require much familiarity with Home Assistant, its architecture, or Google Drive. Detailed install instructions are provided below but you can just add this repo, click install and open the Web UI. It will tell you what to do and only takes a few simple clicks. Detailed install instructions are below if that doesn't seem clear.
This addon has been featured by %YOUR_FAVORITE_HA_YOUTUBER% and is often listed as an essential addon when starting with Home Assistant. Here are some videos about it from others if you'd like to get an idea of what using it looks like or what the community thinks:
This project requires financial support to make the Google Drive integration work, but it is free for you to use. You can join those helping to keep the lights on at:
Navigate in your Home Assistant frontend to Settings -> Add-ons -> Add-on Store (Bottom Right).
Click the 3-dots menu at upper right ... > Repositories and add this repository's URL: https://github.com/sabeechen/hassio-google-drive-backup


Note: Home Assistant loads the repository in the background and the new item won't always show up automatically. You might need to wait a few seconds and then "hard refesh" the page for it to show up. On most browser the keyboard shortcut for this is CTRL+F5. If it still doesn't show up, clear your browser's cache and it should then. 4. Click Install and give it a few minutes to finish downloading.
Click Start, give it a few seconds to spin up, and then click the Open Web UI button that appears.
The "Getting Started" page will tell you how many backups you have and what it will do with them once you connect it to Google Drive. You can click Settings to change those options through the add-on (which is the recommended way, they take effect immediately), or update them from the page where you installed the add-on as described below (also works, restart for them to take effect).
Click the Authenticate with Drive button to link the add-on with your Google Drive account. Alternatively, you can generate your own Google API credentials, though the process is not simple.
You should be redirected automatically to the backup status page. Here you can make a new backups, see the progress of uploading to Google Drive, etc. You're done!
After you start the addon you have an opportunity to review your settings within the addon's Web-UI before you connect it to Google Drive. It is recommended to modify the setting this way because the UI makes it easy and explains what each option does.
If you'd still prefer use edit your setting in yaml or through the supervisor, the list of configurable options with explanations is available here.
Most likely, yes. This addon is focused on making backup simple, reliable, easy to understand, and well supported. It provides clear error messages when things go wrong and explains how you fix it. It has a fancy-pants web interface you can look at to see how things are going. To do that it sacrafices customizability. It can't: - Create backups more than once a day. - Create backups only when your configuration changes. - Upload somewhere other than Google Drive. - Be customized outside of what the settings allow.
If you want a backup strategy highly customized to your needs, you might be better off hacking something together with automations and the samba addon, for example. This project started out as me doing exactly that for myself, and now its grown into a mature project with ~100k people using it all over the world. Weird. I never thought I'd be getting community pressure to translate the UI into portugese, but here I am dealing with those kinds of problems now.
Home Assistant is notorious for failing silently, and your backups aren't something you want to find is broken after an erroneous comma makes you unable to turn on any of the lights in your house. That's why I've added some functionality to keep you informed if things start to break. If the add-on runs into trouble and gets more than 12 hours behind its schedule, you'll know in two ways:


Redundancy is the foundation of reliability. With local backups, Google Drive's backups, and two flavors of notification I think you're covered.
The backups this addon creates are the same backups that Home Assistant makes by itself and can be restored using any of the methods documented elsewhere. Here are few pointers to get you started. - If you can still get to the addon's web-UI then select the backup and click "Load into Home Assistant" have it copied back into Home Assistant. - If not (eg, maybe your hard drive died and you're starting over): - Download one of the backups you've previously created from Google Drive. - On whatever hardware you're using to run Home Assistant now, follow the normal instructions to install Home Assistant. - Once it's running (but before you create a user), click the link on the Home Assistant setup page that says "Alternatively you can restore from a previous backup" and upload the backup you downloaded from Google Drive. - If you've got a backup that you'd like to restore to an already set up Home Assistant instance that doesn't already have this addon installed, you'll need to use something like the Samba Addon to copy a backup downloaded from Google Drive into the /backup folder.
The add-on creates a few sensors that show the status of backups that you could trigger automations off of. binary_sensor.backups_stale becomes true when the add-on has trouble backing up or creating backups. For example, the Lovelace card below only shows up in the UI when backups go stale:
type: conditional
conditions:
- entity: binary_sensor.backups_stale
state_not: "off"
card:
type: markdown
content: >-
Backups are stale! Please visit the "Home Assistant Google Drive Backup" add-on
status page for details.
title: Stale Backups!`
If you have android or iOS, other notifications set up, this automation would let you know if things go stale:
- alias: Backups went stale
id: 'backups_went_stale'
trigger:
- platform: state
entity_id: binary_sensor.backups_stale
from: 'off'
to: 'on'
condition: []
action:
- service: notify.android
data:
title: Backups are Stale
message: Please visit the 'Home Assistant Google Drive Backup ' add-on status page
for details.
You could automate anything off of this binary sensor. The add-on also exposes a sensor sensor.backup_state that exposes the details of each backup. I'm working on a custom Lovelace component to expose that information.
You can add "backup_time_of_day": "13:00" to your add-on configuration to make backups always happen at 1 pm. Specify the time in the 24-hour format of "HH:MM". When unspecified, the next backup will be created (roughly) at the same time of day as the last one.
This is just an overview of how to keep older backups longer. See here for a more in-depth explanation.
The add-on can be configured to keep generational backups on daily, weekly, monthly, and yearly intervals instead of just deleting the oldest backup. This can be useful if, for example, you've made an erroneous change but haven't noticed for several days and all the backups before the change are gone. With a configuration setting like this...
generational_days: 3
generational_weeks: 4
generational_months: 12
generational_years: 5
... a backup will be kept for the last 3 days, the last 4 weeks, the last 12 months, and the last 5 years. Additionally, you may configure the day of the week, day of the month, and day of the year that weekly, monthly, and yearly backups are maintained.
generational_days: 3
generational_weeks: 4
generational_day_of_week: "mon" # Can be 'mon', 'tue', 'wed', 'thu', 'fri', 'sat' or 'sun' (defaults to 'mon')
generational_months: 12
generational_day_of_month: 1 # Can be 1 through 31 (defaults to 1)
generational_years: 5
generational_day_of_year: 1 # can be 1 through 365 (defaults to 1)
days_between_backups: 1' to ensure a backup is available for each day.max_backups_in_drive appropriately high to keep enough backups (24 in the example above).max_backups_in_drive or max_backups_in_haIf you set 'days_between_backups: 0', then the add-on won't try to create new backups but will still upload up any it finds to Google Drive and clean up old backups in both Home Assistant and Google Drive. This can be useful if you already have for example an automation that creates backups on a schedule.
The config option backup_name can be changed to give backups a different name or with a date format of your choosing. The default is {type} Backup {year}-{month}-{day} {hr24}:{min}:{sec}, which makes backups with a name like Full Backup 2021-10-31 14:00:00. Using the settings menu in the Web UI, you can see a preview of what a backup name will look like but you can also set it in the add-on's options. Below is the list of variables you can add to modify the name to your liking.
{type}: The type of backup, either 'Full' or 'Partial'{year}: Year in 4 digit format (eg 2){year_short}: Year in 2 digit format (eg 19){weekday}: Long day of the week (eg Monday, ..., Sunday){weekday_short}: Short day of week (eg Mon, ... Sun){month}: 2 digit month (eg 01, ... 12){month_long}: Month long name (January, ... , December){month_short}: Month long name (Jan$ claude mcp add hassio-google-drive-backup \
-- python -m otcore.mcp_server <graph>