Created new add-on to backup snapshots to Google Drive

I created a new add-on to backup hass.io snapshots to Google Drive. You can install it using my add-on repository following these Home Assistant Add-on Instructions. You can see the readme here for information.

This is my first HA add-on, and my first community code contribution of any kind…so buyer beware. :slight_smile:

I couldn’t find the i386 build script. So, despite the fact that my add-on advertises support for the i386 architecture, it doesn’t really. :frowning: If anyone can offer some help there, I’d appreciate it. I appears I need proper authorization to pull that builder from Docker Hub???

I’ve tested this on my Raspberry Pi Hass.io setup.

19 Likes

Hi @samccauley,
Thanks for sharing your add-on. I just gave it a try and it just works as specified, after following the instructions. :+1:

Do you have any future plans to include features like keeping a certain number of backups and deleting older backups?

Thanks a lot. I use the Dropbox backup addon which works perfectly but since my log is so big (1gb +) it fills up my Dropbox space immediately so for me is unusable.
From first reading seems this addon enables to choose which files to backup (what I would need is just NOT backup a single file, the log file), so it’s great for my needs, thanks

Tried to add your repository, but after clicking ADD, it’s not adding the repositopry in HASSIO

Yes! That is exactly what I have planned. Maybe in a couple weeks.

1 Like

Hmmm… Do you see anything in your hass.io system log when this happens?

Nothing in log, I put the below link, is it correct (https without spaces of course)?

h t t p s://github.com/samccauley/hassio-repository

Yeah. That’s right. Here it is again copied and pasted from my hass.io add-on store on my own HA: GitHub - samccauley/hassio-repository: Scott McCauley's repository of hass.io add-ons.

Have you tried adding any other third party repositories before? Successfully?

Yes I have more than 5. I run hassio on a NUC

Hmmm… I have no idea what the cause might be. I did try something, though. I removed i386 from the list of supported architectures in the configuration for my add-on (I shouldn’t have had it in the list to begin with). That shouldn’t cause a problem with you adding the repository, though. But, it was the only thing I could think of to try. You may try again, but I’m honestly not hopeful that what I did would make a difference.

No, still not working, below the LOG

18-11-05 11:03:13 INFO (SyncWorker_7) [hassio.docker.addon] Start Docker add-on homeassistant/amd64-addon-mosquitto with version 3
18-11-05 11:03:13 INFO (MainThread) [hassio.services.mqtt] Set core_mosquitto as service provider for mqtt
18-11-05 11:03:13 INFO (MainThread) [hassio.discovery] Send discovery to Home Assistant mqtt from core_mosquitto
18-11-05 11:03:13 INFO (MainThread) [hassio.homeassistant] Updated Home Assistant API token
18-11-05 11:03:13 INFO (MainThread) [hassio.discovery] Discovery 74313f3847c04af080xxx message send
18-11-05 11:06:54 INFO (MainThread) [hassio.addons.git] Update add-on GitHub - danimtb/dasshio: Hass.io add-on to easily use Amazon Dash Buttons with Home Assistant repository
18-11-05 11:06:54 INFO (MainThread) [hassio.addons.git] Update add-on GitHub - stefangries/hassio-addons: Addons for HomeAssistannt's HassIO. repository
18-11-05 11:06:54 INFO (MainThread) [hassio.addons.git] Update add-on GitHub - stefangries/hassio-addons: Addons for HomeAssistannt's HassIO. repository
18-11-05 11:06:54 INFO (MainThread) [hassio.addons.git] Update add-on GitHub - neffs/hassio-addons repository
18-11-05 11:06:54 INFO (MainThread) [hassio.addons.git] Update add-on GitHub - home-assistant/addons: ➕ Docker add-ons for Home Assistant repository
18-11-05 11:06:54 INFO (MainThread) [hassio.addons.git] Update add-on GitHub - marthoc/hassio-addons: Hass.io Add-ons repository
18-11-05 11:06:54 INFO (MainThread) [hassio.addons.git] Update add-on GitHub - hassio-addons/repository: Home Assistant Community Add-ons repository
18-11-05 11:06:55 WARNING (MainThread) [hassio.addons.git] It is already a task in progress
18-11-05 11:06:55 WARNING (MainThread) [hassio.addons.git] It is already a task in progress
18-11-05 11:06:55 WARNING (MainThread) [hassio.addons.git] It is already a task in progress
18-11-05 11:06:55 WARNING (MainThread) [hassio.addons.git] It is already a task in progress
18-11-05 11:06:55 WARNING (MainThread) [hassio.addons.git] It is already a task in progress
18-11-05 11:06:55 WARNING (MainThread) [hassio.addons.git] It is already a task in progress
18-11-05 11:06:55 WARNING (MainThread) [hassio.addons.git] It is already a task in progress
18-11-05 11:06:55 INFO (MainThread) [hassio.addons] Load add-ons: 80 all - 0 new - 0 remove
18-11-05 11:06:56 INFO (MainThread) [hassio.addons] Load add-ons: 80 all - 0 new - 0 remove

Klagio,

As a test/workaround, could you try setting my add-on up as a local add-on? This involves these steps:

  1. Create a subdirectory in your hassio addons directory named something like googlebackup. You may need to use something like the Samba add-on to get access to do this.
  2. Download my config.json file and place it into that directory.
  3. Go to your hass.io add-on store and click the refresh circle in the top-right corner.
  4. You should (hopefully) see my add-on appear there under “Local add-ons”.

Let me know how that goes. If it doesn’t show up, please look in your logs to see if there are any helpful messages from this test. Thank you.

1 Like

It works fine. Thanks a lot

Well, the good news is that it worked. The bad news is that it’s still a mystery as to why it would not add directly from my repository, and this is not a very good long-term workaround because you won’t get updates with this setup.

I’ll keep giving this some thought. It seems more likely now that the problem is with my repository rather than with my add-on. That at least helps narrow down where I need to focus. Thank you for your patience.

I get the following error when trying to perform the backup, any idea?

{“errorMessage”: “<HttpError 404 when requesting https://www.googleapis.com/drive/v3/files?q=name%3D’34347d59.tar’+and+‘hassio-backup’+in+parents+and+trashed+%3D+false&spaces=drive&fields=files(id%2C+name)&alt=json returned “File not found: .”>”}

You are using the wrong string for the google drive folder - follow instructions in the documentation. I had the same issue. :blush:

Blockquote

You must instead provide Google Drive’s unique opaque ID of the folder. Google Drive doesn’t make it easy to get this value. But, here’s how you can get it:

  1. In your favorite web browser, navigate to the Google Drive folder to which you plan to upload your files (create a new folder in Google Drive if you wish). Be sure that you have the perferred folder open so that its contents (even if it’s empty) are displayed.
  2. From the address bar of your browser, copy the last portion of the URL. That value is Google Drive’s unique opaque ID for the folder. Paste that value in for the backupDirID value in the configuration.

Blockquote

1 Like

hi guys,

is it possible to set up an automation to create a snapshot daily or once a week, i so could you please share the config code?

many thanks

Yes. It’s described in this thread.

1 Like

Version 1.1.0 is out now and it has this “purge” support added to it.

1 Like

I completely missed this on my search
Thank you

1 Like