Errors attempting to integrate with Google Home

I have a number of devices which are not supported by any integrations in HA but they are controllable by Google Home i.e.it can turn them on or off. I have been following Lewis 's video from about 12 months ago on YouTube about how to achieve a connection between HA & Google so that HA can send voice commands to Google. After I had input the generated id and codes using the Google console then I received an error message:

Access blocked: This app’s request is invalid
You can’t sign in because this app sent an invalid request. You can try again later or contact the developer about this issue. Learn more about this error
If you are a developer of this app, see error details.
Error 400: redirect_uri_mismatch

I have retried adding the Google Assistant SDK but it keeps coming back to the same error message. Any ideas how to get out of this mess??

Have you considered Home Assistant cloud? It’s by far a simpler solution for integrating with Google.

No, I wasn’t aware that it could be done with Home Assistant cloud.

If you already have a Nabu Casa subscription you can turn on Google Assistant via Settings>Voice assistants.

It’s awesome. I have been using it for years.

I took your advice and started a triak of the Nabu Casa cloud, set up an account etc., then went to Settings>Voice, scrolled to Google Assistant and clicked on Activate the Home Assistant Cloud skill for Google Assistant and received this error: 404. That’s an error.

The requested URL /services/a/uid/00000091fd5fb875?hl=en-US was not found on this server. That’s all we know.

Reading the Nabu Casa document it is referencing controlling HA entities from Google Home whereas I am wanting to control devices connected to Google Home from HA. Is that possible?

Did your Nabu Casa remote control error resolve itself over time?
Re the control of Google Home devices from HA. Are you saying that these particular devices are only connected to Google Home & not connected to HA. I’m not aware of any way to control a device that HA knows nothing about.

I’m super new to all this so hopefully I didnt do something really bad.

The links in this reply either have parentheses around the “h” in “https” or I had to put a space. I’m allowed (2) links apparently, and I’m not quick enough to figure out how to do that the right way.

I’m running proxmox with HA on a separate laptop, and performed the following on a separate laptop used to access the HA OS GUI.

I followed the instructions (Google Assistant SDK - Home Assistant) and clicked around aimlessly until I stumbled upon something that seems to work.

After downloading the “client_secrets_XXXXX…json” file from Google Cloud Console and renaming it (remember the directory), I needed to run the “google-oauthlib-tool.”
I’ve never used Python for Windows (using win10), but I downloaded it and eventually realized that you need to be sure Windows Terminal can use it. So I wrote “python --version” in the command line, and it came back with an error or nonsense.
In order to make it work, I had to go to System Properties → Advanced System Settings → Environment Variables.
From that screen, look under “System Variables” and find “Path.”
Click “Edit” button, then click “New” on the next screen to add a new path for windows to use to find the Python code (I guess?), then enter the directory where you installed Python (mine was C:\Users.…\AppData\Local\Programs\Python\Python312)

Then, be sure to hit “OK” on all the boxes before opening a new Terminal window.

Type your “python --version” command and you should see something like (directory redacted below but that’s the command and result):

C:\Users.…>python --version
Python 3.12.3

I then ran the Python code: “python -m pip install --upgrade google-auth-oauthlib[tool]” but received some weird errors in Terminal warning about something or other.
Anyway, turns out I had to go back into the “Environment Variables → System Variables - Path” screen and add a New directory to the path shown on warning screen (for me, the folder missing from Path was “scripts” so I hit “New” then pasted in C:\Users.…\AppData\Local\Programs\Python\Python312\Scripts)

NOW, I actually got something to happen after restarting Terminal and using the command:
pip --version (Windows Terminal command and output below):

C:\Users.…>pip --version
pip 24.0 from C:\Users.…\AppData\Local\Programs\Python\Python312\Lib\site-packages\pip (python 3.12)

So I have Python and Pip running, so now I could run (Windows Terminal) to paste:

google-oauthlib-tool --scope (h)ttps://www.googleapis.com/auth/assistant-sdk-prototype --scope (h)ttps://www.googleapis.com/auth/gcm --save --client-secrets %userprofile%\Downloads\client_secret.json

-----OR------

python -m pip install --upgrade google-auth-oauthlib[tool]

Well, all’s well and a browser popped open but no dice…turns out this redirect_uri is OOB or something

Google error: (h)ttps://developers.google.com/identity/protocols/oauth2/web-server#authorization-errors-redirect-uri-mismatch

Finally, after screwing around, I changed the command to include the path to the “clients_secret.json” file

(Change %userprofile% to whatever your path is. Mine was like C:\Users\Downloads\client_secret.json)

But still no dice.

Finally, I clicked a link on the Google error page:

If you are a developer of this app, see [error details]
(http ://accounts.google.com/)

which brought me to a popup:

Error 400: redirect_uri_mismatch

You can’t sign in to this app because it doesn’t comply with Google’s OAuth 2.0 policy.

If you're the app developer, register the redirect URI in the Google Cloud Console.

Request details: redirect_uri=http://localhost:8080/

[Related developer documentation]
(h ttps://developers.google.com/identity/protocols/oauth2/web-server#authorization-errors-redirect-uri-mismatch)

Done

Welp, I figured that if it was a misdirect then maybe, just maybe, I could go back into Cloud Console and add another Authorized Redirect URL under that particular name. So mine just redirects the oauthlib tool back to my HA server:

(Under Google Cloud Console → Credentials (left bar) → Oauth 2.0 Client IDs (pick the one you used originally to set up Google-assistant-sdk):

(Please note the lack of “h” in “https”; apparently I put too many links but I dont know how to un-hyperlink in this forum):

Authorized redirect URIs
For use with requests from a web server
URIs 1
‘ttps://my.home-assistant.io/redirect/oauth’
URIs 2
‘ttp://localhost:8080/’

Lo and behold, a browser popped up, asked me to allow access and all that jazz, and now here I am explaining it poorly.

If you can follow that gibberish, maybe you can find your own way.

Good luck out there, and please let me know if I’ve opened my home up to let just anyone turn on and off my lights.