Add-on: Home Assistant Google Drive Backup

Just to follow up from my last post…I don’t know what the deal is with the times of the snapshots. On further investigation, it doesn’t actually seem to be a time zone issue or anything like that. They are set to happen at 0600. The first two days on my new system, the snapshots happened around 0700, and since then the timestamps can be anything from about 0602 to 0645. If I create one manually, it only takes a minute, so I have no idea why the times are so spread around. It’s not an issue, as long as one happens every morning, which it is.

Firstly can I say what a great addon this is.

I’ve done a really stupid thing and I’m hoping that someone can help.

I set up a new google account purely to store my backups but I can’t remember what the email address. I never wrote it down as I never thought I would forget! Stupid me!!

I know I can simply create another account and then authorise the addon again but I wondered if there is a way to identify the original email account I used.

Thanks for any help.

Great app! I installed it on multiple installations of Hassio that I have in various relatives homes, but I can’t use the same Google Drive authentication since it merges it into one folder and deletes the backups from the other Hassio instances. Is there anyway to keep a separate backup folder for each instance of Hassio using the same Google Drive account?

2 Likes

Hi, would it be possible to have a Hass.io to NAS backup?

Nice looking App !
Can it be installed on Hassbian ?
Anyone help a noob with some quick steps ?

I just installed and was going to ask the same question.

I have decided for now to change the snapshot names by prepending an instance name. e.g. Home 1 Full snapshot, Home 2 Full snapshot, etc.

@Keith.Lovatt I’ve got a feature request open to support that, and I’d like to implement it eventually, but its actually a bigger ask than it seems. For the time being, using different Google Drive accounts is the only way to support multiple instances. Renaming the snapshot names won’t work right, one instance of the addon will overwrite (eg, delete) the snapshots from the other.

@cw1ght0n IIUC Hassbian is just a stock Home Assistant instance so I don’t think there is a way to make that work. The add-on requires Hass.io’s add-on framework and the snapshot service it exposes.

I want to +1 thank @sabeechen for this addon. I work in the IT industry and dabble in coding and scripting and its obvious the amount thought and effort that went into the UI and backend of this project. I want to encourage the continual focus on doing 1 thing and doing it exceptionally well. To many projects try to become everything and it destroys their usability. This add-on is laser focused and perfect for what its designed to do.

As others have mentioned, the only glaringly missing feature is a “buy me a coffee” link.

@sabeechen As many are probably not aware of your add-on it might be nice to feature on the hass io podcast (https://hasspodcast.io/) if you’re up for public speaking:)

My thought was to increase the limit on google to n x the desired limit, where n is the number I wish to keep on google per instance. I won’t actually be able to differentiate the files themselves, but in case of a restore, I would be able to tell from the snapshot name. Playing with schedules may also help separate the files (say 2:00am for instance 1, 3:00am for instance 2).

I’ll play and see what happens. Worst case is to create another google account. I can keep my old, less useful m=backup method running in parallel for safety while I play.

Found the answer, so forget this: That brings a question: how do the limits on backups work when using generational retention? Do the absolute limits take precedence?

@rhatguy Thanks, thats very kind. I’ll check out the podcast and might reach out to them when I hit v1.0

@Keith.Lovatt That strategy should work at least until it hits the max in Google Drive. Looks like you found the answer, but generational backup won’t start deleting naything until the number of backups exceeds the “max” count in hass.io or Google Drive. I’ve doc some more details about how that works in this writeup.

Its been some time since a release, so I’m happy to announce v0.98.1. Make sure you refresh the add-on store page to make it see the update. This release adds:

  • Support for Ingress! If you’re upgrading from an old version, you’ll see a dialog in the Web UI asking if you’d like to disable the external port serving the Web UI and use ingress only (which is recommended). The web UI will still be available over the “old” endpoint (usually port 1627) until you choose. This is done to prevent some of the confusion I’ve seen from other add-ons that enable ingress by disabling the older UI endpoint, making people confused about how to access the add-on. New users will be ingress-only, but you can always turn on an additional port from the web-ui’s settings.
  • Support for Google Drive’s Shared drives and team Drives.
  • A new config option to disable Upload to Google Drive, in case you’d like to use the add-on only to create snapshots.
1 Like

Thanks for Addon! When i click “Action” and “Restore” for at certain snapshot, a new window opens but it says that the url can’t be reach. Am im missing something?

Its supposed to take you to the snapshot restore page in hassio, you can get to the same place by going to “Hass.io” > “Snapshots” from the Home Assistant UI. The link probably got broken with he changes, I’ll fix it in an update.

Hi @sabeechen just updated to the latest version.
I receive this error when opening the web ui.

When navigating to http:\hass.io-ip:1627 or https:\hass.io-ip:1627 the website cannot be reached.
If i enable ingress by removing the port from the add-on settings page i receive the same error when opening the addon via the sidebar.

401 Unauthorized
You are not authorized to access that resource

Traceback (most recent call last):
  File "/usr/lib/python3.7/site-packages/cherrypy/_cprequest.py", line 628, in respond
    self._do_respond(path_info)
  File "/usr/lib/python3.7/site-packages/cherrypy/_cprequest.py", line 684, in _do_respond
    self.hooks.run('before_handler')
  File "/usr/lib/python3.7/site-packages/cherrypy/_cprequest.py", line 114, in run
    raise exc
  File "/usr/lib/python3.7/site-packages/cherrypy/_cprequest.py", line 104, in run
    hook()
  File "/usr/lib/python3.7/site-packages/cherrypy/_cprequest.py", line 63, in __call__
    return self.callback(**self.kwargs)
  File "/usr/lib/python3.7/site-packages/cherrypy/lib/auth_basic.py", line 111, in basic_auth
    401, 'You are not authorized to access that resource')
cherrypy._cperror.HTTPError: (401, 'You are not authorized to access that resource')
Powered by CherryPy 18.1.2

The logs shows that the addon is syncing with google drive.

I have the same issue as @Sjeff after upgrading and enabling Ingress.

thanks working fine!

I’ve opened an issue for what @sjeff and @Tony321 are seeing. Could you post your add-on config there?

How can I unpack the encrypted file without “Hass.io Google Drive Backup”. Well-known unpacking programs do not get that under macOS or Windows. Apparently the encryption is not clear …

Hass.io is responsible for creating the actual snapshot, the add-on just backs up what Hass.io gives it. I also haven’t been able to determine how to read data from an enctypted snapshot without fully restoring it. If anyone wants to take a dive into figuring that out, the python logic for how an archive gets encrypted/decrypted in Hass.io seems to be in this class. Wish I could be more helpful.