Add-on: Home Assistant Google Drive Backup

Does this backup stored data for Hass.io addons … for example all the flows within NodeRED ?

This will create a snapshot just as if you created a full snapshot manually from Home Assistant. I can’t speak to how the other add-on is configured, but a full snapshot includes the add-on configuration as well so I’d say yes.

Great add-on!

Thanks for your efforts. This is running well on my rpi3 system as far as I can see.

Thanks ! Working great again!

1 Like

I’ve released a new version, v0.6, with some fixes and new features. This release includes:

  • Support for generational backup, which lets you keep older snapshtos on daily, weekly, monthly, and yearly rotations.
  • The ability to disable automatic snapshots, for example if you already have an automation for creatign backups and just want this to back them up to Google Drive.
  • Better logging and easy access to the debug logs (if you need to file a bug for example) from a top level menu.
  • A menu option for “simulating” stale backups.
  • Some better error messaging when you run out of space in Google Drive or your credentials expire.
  • Moved “easy” authentication to a webserver, so project credentials aren’t stored locally.
  • Added an option to authenticate with Google Drive by creating your own client secret and client ID, in case you don’t trust my server.

I’m not planning to add support for creating partial snapshots in add-on any time soon, but if you’re interested in setting up a slightly more hacky solution then with the latest release (v0.6) you could:

  • disable automatic snapshots in the add-on, which will still make it upload any snapshots it finds to drive and cleanup old ones. It just won’t create new ones on a schedule automatically.
  • Create an automation that calls hass.io.partial_snapshot on a daily schedule (or whatever schedule you want) to handle creating partial snapshots to your liking. This thread has some guidance for using that service.

You wouldn’t get staleness notifications anymore if creating the snapshot failed, but you’d still be notified if one of the snapshots couldn’t be uploaded to Google Drive. Doming soemthign like this should work flawlessly with generational backups too, if you plan to use that.

What would you be interested in calling from node red? Hassio already exposes a service for creating snapshots (this add-on basically just calls that) and the state of the snapshots are already exposed through sensors that node red can read.

Actually I’m using another addon for GDrive Backup and I call it X minutes after calling the Snapshot.

When I asked my question, I didn’t notice that you can define this directly in the config.

Thanks for making this! works perfect.

Will there be an opportunity to make hourly backups in a given time frame in the future? For example, every X hours in the period from 09.00am - 09.00pm.

You can specify the time of day, but the add-on won’t do anything faster than once a day.

If you want a more custom schedule, you can set time_between_snapshots=0, which will prevent the add-on from creating snapshots on a schedule, and then create an automation that calls the hassio.full_snapshot service to create snapshots using whatever rules and intervals you configure it with. The add-on will still upload snapshots you create like this to Google Drive, cleanup old ones, etc.

Out of curiosity, what are you doing that makes hourly snapshots desirable? Even daily seems like overkill to me.

Beeen running this now for some week and it works great. Best backup addon. Also, very nice that it implements the security that it only has access to the specific folder in Drive. Some of the other addons get access to everything on ones Drive which is really dangerous.

Great work!

So, saw this in the log. What needs to be done?

api_password is going to deprecate. You need to use a bearer token to access /api/states/binary_sensor.snapshots_stale

Thanks for the explanation. If I have time, and change the one or the other of the configuration files, it is great to fall back on an “intact” version in case of errors.

This seems to have broken my Home Assistant. I installed it, went through the motions, everything worked fine and then suddenly HA frontend became inaccessible, can’t SSH in to it - it’s completely dead. Any idea how to rectify?

Ironically, I never back it up so wanted to use this addon to do that.

EDIT: After about 20 minutes of waiting HA has finally started up again but the addon has not started on boot. I think I’ll just leave it and find another way to back up.

The add-on runs in its own little docker container that only starts up after home assistant (like any add-on) so its unlikely to be able to prevent HA from booting, but if I had to guess it could be:

  • Your instance has gone non-responsive while its creating a snapshot. Unlikely but possible, I’ve seen my little rpi get pretty sluggish while it struggles to compress a big sensor database.
  • Creating a snapshot made you run out of space. Home assistant doesn’t really handle an exhausted disk well and to the best of my knowledge Hassio will happily run the system into the ground if it doesn’t have enough space to make a snapshot. I think you should be able to pop the SD card into another computer to verify if this is the case if you’re running this off an rpi.

This looks particularly interesting. Loving the web front end. I wonder though if this could go a step further with both onedrive and dropbox integration :thinking:

2 Likes

Hi,
this looks really good, just one question

whats the difference between this one and this one linked below

Feature request: Ingress :slight_smile:

1 Like

@phairplay Some of the existing backup add-ons are similar (especially that one), but the problem I’ve had with most things in Home Assistant is that its a huge pain to robustly configure. I’m a pretty adept technology enthusiast, and it still takes me hours to adapt every add-on/plugin/feature to work reliably.
Right out of the box when you install this add-on and authenticate it with Google Drive:

  • It starts making snapshots and backing them up.
  • It has default settings that make sense for most people.
  • It notifies you in Home Assistant if it runs into problems (other notifications, like mobile, are easy to configure too, see the FAQ).

I’ve designed the web UI around making very clear what its doing, eg when is the next snapshot, how often they happen, when was the last snapshot, etc. When its doing something with a snapshot (creating one, backing one up, etc) I also try to make that clear. You don’t have to set up any node-red flows, automations, service calls, or lookup esoteric yaml settings to make it work well or understand what its doing in the background.

Errors are presented front-and-center in the UI so you don’t have to parse through logs. I also haven’t seen an add-on that makes recovery simple, eg if you want to restore a snapshot from a fresh install. I’ll be pushing a new release soon (optimistically today) targeted at this. I’m getting pretty close to what I envisioned this being a completed product, but its still a work in progress so some of the differentiating features are yet to come.

2 Likes