Add Google Home account issue

After download Google Home module from HACS and restart HA. I try to setup google home. it pops up google home authentication page with account account username (yes I knew). google account app password (yes. I can go to google account webpage, login to create it). Google account master token. Don’t know where to get it. tried to go to HA user profile long-lived access tokens and create one. It doesn’t work. Where can I get this master tokens?

2 Likes

I am also facing the same issue. Any idea on how to generate a master token?

Did you ever figure this out? I’m struggling with the same problem.

I solved this issue by following

basically

  1. sign in Google security account to create app password for HA
  2. in Windows PC, install docker engine for win11 (not docker desktop). it will install ubuntu.
  3. in ubuntu, following leikoilja instruction to get image and run commands. (if using GUI interface, no luck)

I ran the generation script in every possible way and it’s not working. Super frustrating. If someone figures out a reliable way to get it done I’m all ears. I read some comments about the process not working with passkeys active.

all current solution need to be run at Linux text screen that can mount docker. If you try running from docker GUI or inside of docker, it doesn’t work. That took me a lot of time to figure out.

sorry could you expand a bit on this? What does it mean exactly?

I am windows man. In Microsoft Windows OS, the bottom base is Windows OS, if you need load a docker on it. you need install the environment, that is Linux (2nd layer) and then docker (3rd layer). Finally you can load some docker image. On the web you can find installation that create GUI to make easy. However, after installation, you are on 3rd layer docker environment already. It will be a problem. You need using the solution instruction in 2nd Layer (linux environment).

1 Like

Windows 11 Guide:

  • Install Linux Subsystem
  1. Start CMD with administrative privileges.

  2. Execute Command:
    wsl --install

  3. Set up Username and Password

  • Update Linux Subsystem
  1. Execute Command:
    sudo apt-get update
    sudo apt-get install ca-certificates curl
    sudo install -m 0755 -d /etc/apt/keyrings
    sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
    sudo chmod a+r /etc/apt/keyrings/docker.asc

  2. Execute Command:
    echo
    “deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] Index of linux/ubuntu/
    $(. /etc/os-release && echo “$VERSION_CODENAME”) stable” |
    sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
    sudo apt-get update

  • Install Docker Engine
  1. Execute Command:
    sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
  • Download and Run Docker
  1. Execute Command:
    sudo docker run --rm -it breph/ha-google-home_get-token

  2. Enter gmail address and then app password

  3. Copy the Master Token into the Component and your good to go

Hope this helps

1 Like

Hi asa79
I followed all of the instructions and generated a master token. Went back to the Google Home Cofiguration dialogue to authenticate and now receive:

“Master token invalid. Make sure that the full token has been specified (including ‘aas_et/’)”

I am using the full token.

I re-ran the dialogue “sudo docker run --rm -it breph/ha-google-home_get-token” and it produced a different master token.

I can find nothing in this forum, or anywhere else on the internet to help.

Any suggestions

I have solved this problem. I am posting my solution in hope that no-one else has to repeat my journey.

To get the Google Master Token, I installed the Windows Docker and in the Terminal window, ran the command:

docker run --rm -it breph/ha-google-home_get-token

After entering my email address and App password, a 233 character master token was produced.

Important
If you use 2FA for google, your primary Google password will not work, so you will need to generate an app password to make this work. See Create and manage your app passwords

Chances are that if you cut and paste your master token into HA, authentication will probably fail with an “Master token invalid” error. In my case, this is because the token is so long that when you cut and paste, you will pick up one or more carriage return characters.

Not the most elegant way to deal with this, I first pasted the token into Microsoft word so that I could see and remove the carriage return characters.

I then copied the token from word and put it into an excel spreadsheet. I created a formula to check the length of the token, like =LEN(A1), where the token was in cell A1. This confirmed that the length was 233 characters.

I then cut and pasted the token into HA Google Home Cofiguration dialogue and it authenticated correctly.

There are a few moving parts here that need to be dealt with and you need to get them all correct for this to work.

3 Likes

I had to turn SVM (virtualization) in BIOS, but then it works! Thanks!

In case it helps anyone:

  1. Install Brephlas/dockerfile_breph-ha-google-home_get-token (I am using Synology)
  2. Run the image
  3. Open a terminal
  4. type in the user name
  5. Use the google app password
  6. A token should be generated but the container closes
  7. Export the log file
  8. Copy the token from the log
1 Like

Thanks very much Snash. This actually worked for me with my Syn NAS.