Like most millennials, I grew up with Napster, then Kazaa, then eDonkey2000, obviously CD rips, and of course LAN parties. Over the years, this has led to a large collection of completely legal MP3 files that I have backed up on two large external USB spinning disks that haven't spun for a long time now, but the files also exist on Google Drive.
I'm also heavily invested in the Home Assistant ecosystem, which lets you install a full-featured music player app called Music Assistant.
These days, of course I pay for my music (we have the YouTube Music family plan), but I recently thought it'd be fun to revive my old MP3 collection. This blog post describes how to connect Google Drive to Music Assistant on Home Assistant.
Create a rclone configuration for Google Drive ๐
The first step is running rclone, a command-line program to manage files on cloud storage. Among many other providers, it supports Google Drive. Download rclone to your regular computer (that is, very likely, not your Home Assistant), and then follow the instructions to configure rclone for Google Drive. This requires you to go through the hell that is Google's Cloud Console, but it's a one-time setup. All you need in the end is a configuration file that you then have to copy over to your Home Assistant. Essentially, you run the configuration wizard, show the configuration file, and then copy its contents.
rclone config rclone config show
It should look something like the following snippet, but of course with your own client ID, client secret, and token:
[ drive ] type = drive client_id = *.apps.googleusercontent.com client_secret = *-* scope = drive token = { "access_token" : "*" , "token_type" : "Bearer" , "refresh_token" : "*" , "expiry" : "*" , "expires_in" :3599 } team_drive =
In Home Assistant, use the File editor addon (app) and create a file called rclone.conf in the config/rclone directory. Paste the contents of your rclone configuration file into it and save it.
Set up rclone in Home Assistant ๐
... continue reading