I’ve been letting this idea stew in the back of my mind for a few days now. Looking at my thoughts below I realize now that I’ve written a lot of text. Sorry! Then again I’m also confident that overthinking features is what leads to happy users and fewer bug reports.
First let me restate a little more specifically what I think you’re thinking of, just to make sure we’re on the same page. I think you want some kind of “hot swap” backup HA installation, where when your primary installation fails a backup one is ready to take over with just a restart (and maybe plugging in some hardware). This would be accomplished by having the backup installation automatically download from Google Drive the backups created by the primary installation, then restore them automatically, presumably on the same schedule the backups are created.
This biggest problem I see with this concept is that a number of HA features/addons/integrations don’t play nice if two versions are running with identical configuration at the same time. This addon is one example, if two versions of the addon run with identical configuration (as would happen if they were automatically restored) then the two instances would overwrite eachother’s backups in Google Drive. The Nabu Casa Google Home/Alexa integration is another, it assumes only one instance should be handling requests from the cloud for a given account. If you don’t use any such features I think this could work, but it would be a fragile thing to remember to maintain as your smart home grows. When it does go wrong, it would be difficult to figure out why because the problems would only surface after the backup is created and restored on the backup, potentially days later.
Another problem is that in my experience restores rarely go smoothly. Every time I restore there is some finky addon that doesn’t download or some other bullshit that puts the installation in a bad state until I fix it, but maybe my install is just complicated.
That being said, I really like the idea of making the restore process easier and faster. I can think of two ways of getting maybe 90% of the way toward what you want, but that also isn’t likely to break things silently in the background.
-
Something you could do right now
For your backup instance, create a blank HA installation with default settings and nothing installed on it except this addon. Before connecting the addon to Google Drive change its settings to have:- “Backups in Google Drive”: 0
- “Days between snapshots”: 0
Then connect the addon to Google Drive. When the addon prompts you about preexisting snapshots in Google Drive, tell it to use the “existing” backup folder. With these setting, the addon will do nothing except stay connected to Google Drive (no automatic backups, no uploads). When the time comes to make the backup installation your primary installation you would open the addon web-ui, select the latest backup, select “Upload into Home Assistant”, wait for it to upload, when restore it.
- Pros:
- Quicker than starting from zero.
- Saves wear n’ tear on the backup machine since it isn’t really doing anything except waiting.
- Cons:
- You have to wait for the backup to download from Google Drive
- You have to wait for the restore to happen
- Requires an internet connection.
-
Something I would have to implement
Set up a blank HA install the same as (1) above except I add another setting named something like “Download the latest backup from Google Drive” (not the final name), which when enabled always downloads the latest backup from Google Drive as soon as its available. That way the backup would be available, but not yet restored.- Pros:
- Quicker than (1), no need to wait for a download.
- Only requires internet if your addons/integration need it as part of the resotre.
- Relatively safe and easy for me to implement.
- Cons:
- You have to wait for a restore (eg its not “instant” recovery).
- Pros:
Just to be clear, you could do (1) right now as it doesn’t require anything about the addon to change, (2) would be me making a new feature. With either solution you would still have to periodically manually update the supervisor version of the backup installation because every so often a new version of the supervisor changes the backup format and older versions of the supervisor can’t restore it.
Personally for my home, I don’t think its much trouble to spend the 30-60 minutes setting up a machine from zero and copying the backup manually when I need to restore. In fact I’d prefer to do that instead of having the burden of continually maintaining a backup instance. What do you guys think, would (2) be worthwhile to you?