Allow to mount Google Drive (and other cloud drives) to Home Assistant

Hi there,

in the following thread, there is a discussion about mounting Google Drive to Home Assistant but I have not yet found a feature request:

There is already an Add-On which allows to backup Home Assistant to Google Drive but as far as I know this Add-On is restricted to backups only.

The goal would be to allow to mount Google Drive (and other cloud drives) as an extension drive to Home Assistant. This would be neat for example if you have security cameras running in Home Assistant and you want to store pictures and videos automatically taken from the camera as soon as motion or a person has been detected. In such a case you would quickly fill up the storage of the Home Assistant installation which is not a good idea. Therefore my goal would be to be able to store all these pictures and videos taken from the camera directly to Google Drive (or other cloud drives such as One Drive, Dropbox, …).

Best regards
The Smart Home Maker

Not exactly the same, but this FR is similar:

Personally, I think the ability to mount my own NAS would be the priority. I try to do as much as possible locally, and avoid third-party cloud solutions.

After that, the next logical step would be to allow mounting cloud storage. So you have my vote.

One final point: The existing add-on does not exactly back up to Google Drive. It does a normal HA backup to the local storage device, then copies it to Google Drive. This is a great solution for many, and it’s a very well-written and well-supported add-on.

But my HA local storage device is an SD card, so this isn’t good for me. Instead, I use my existing backup process to copy the HA config folder to my NAS along with all my other data, and only use the HA backup procedure when I change something in HA. This cuts way down on SD card writes.

I would much prefer to back up directly to external storage, but that FR doesn’t seem to be getting much love.

1 Like

So, I am trying to do this for personal security reasons.

My set up is to use PoE cameras that have their own onboard SD chips and also FTP their video file wherever. (currently they are Reolink. I like their interface and non-cloud independence. They have a PoE doorbell cam I love)

I was using an older WD MyCloud EX2 Ultra. It has a dropbox app that sync every 5 mins… It’s not immediate, but it will backup the cameras’ videos when they FTP to the
NAS.This is has a 5min delay flaw, I know.

I am working on an AWS S3 dump via FTP.

Same reason I need this as well.

Homeassistant SMB or Local Folder to GoogleDrive

I stumbled across your post years ago. But I had a slightly different goal. Now I’ve started working on the topic because I wanted to replace my old Raspbarry Pi running FHEM and rClone.

My goal:
I have a scanner that can scan via SMB (Samba).
I want to transfer the scanned file on the Samba server to Google Drive.

Previously, I realised this via SMB Share and rClone on the Pi.

I can now also realise this in HomeAssistant:

Step 1: Configure the AddOn: Samba share in HA so that you can access HA via SMB share.

I used the ‘Share’ folder for testing. And put a PNG file in here.

Step 2:

You need to create a client_id and a client_secret in your Google account. I already had these from my FHEM PI.

But the instructions should work:

Step 3:

Now you need the add-on ‘Rclone Backup’ which you have to add as an additional add-on repository.

Step 4

Create the file in your HA Config folder: ‘rclone.conf’
In other words, where the configuration.yaml is located.

Example Configure:

[google]
type = drive
scope = drive
token = {"access_token":"ya2...178","token_type":"Bearer","refresh_token":"1//0...KU","expiry":"2024-...+01:00"}
; immediately delete backups instead of sending them to the trash
use_trash = false
client_id = 549...79eim.apps.googleusercontent.com
client_secret = GOCS...D0

Step 5

My configuration currently looks like this in the AddOn under Configuration. It is currently being synchronised. rClone can also move.

I am currently syncing everything from the HA Sync folder to the Google Drive Sync folder every minute. * * * * * * is a chron job time.

- name: Sync every minute
  schedule: "* * * * *"
  command: sync
  sources:
    - /share
  destination: google:/share
  include: []
  exclude: []
  flags: {}

Don’t forget the ‘dry_run’ switch. switch off. Otherwise you will get the following message in the log. skipped copy as --dry-run is set
But you can leave it on for now. Then you can see what Clone would do.

Step 6
Start rClone AddOn and see what is output in the log. It actually tells you everything. Whether it is connected and which files it is copying. In my case, the job starts every full minute.

Tip. If you are connected to Google Drive, you can see the folder structure in the Rclone Backup user interface.

SMB Share with File

Sync via Rclone Backup

Google Drive File Explorer in Rclone Backup

File in Google Drive

Hi @LHBL2003 wow, thank you for this solution and the great, detailed instructions! I will definitely give this a try!