New HA scripts not syncing to Google Assistant

I’ve just created a new script, and restarted HA. I then opened Google Assistant on my phone and issued the “sync devices” command.
When I tried to find the new script in the Google Home app (by searching for a Scene when adding a new Automation) the new script is not listed. All of the existing scripts are visible.
Any idea what might be preventing the new script from syncing with Google Assistant??

Have you enabled “Google Assistant” in the scripts settings?

I have the “Expose” and “Assist” sliders turned on. There’s no slider that’s specific to Google Assistant, though
ha-ga
??

Interesting that Google Assistant wouldn’t be shown there. Mine always shows Alexa as a slider value. I wonder if that might be part of the problem?

image

This has been working for me in the past (I have several scripts triggered by Google Assistant), so I don’t know what’s changed.
I just noticed that there is a button in the Google Assistant integration to sync devices, but when I press it I get an error. This is what is in the log:
Request for https://homegraph.googleapis.com/v1/devices:requestSync failed: 403

403 is HTTP unauthorized. You probably need to refresh your Google OAUTH2 token. That might be the root cause here.

How do you refresh an OAuth token??

It depends on if you are using self-hosted HA or nabu casa:

I’ve had this happen with Amazon before and I had to sign out of nabu casa in HA, restart HA and then log in again with nabu casa. The same thing might work for GA?

I don’t use nabu casa (I have GA manually configured). I have already tried restarting the HA server, but it didn’t help.
I can see this is in the list of Refresh Tokens in my HA settings:

Refresh token for https://oauth-redirect.googleusercontent.com/r/ha2022-d76b4
Created 2 years ago
Last used 2 days ago from 108.177.64.79

I did migrate my router to DD-WRT yesterday (and reinstated all of my port forwarding). Not sure if that would have broken anything. I can still trigger my other scripts from GA, though
???

Honestly? I’m not 100% certain. Maybe creating a new refresh token might help? It’s outside my knowledge though of how to actually do that.

I doubt it. TBH, this is kinda one of the main reasons I use nabu casa. I got tired of self-hosting certs and port forwards and such.

I don’t think I’m going to be a lot of help here :frowning:

OK thanks for your feedback anyway. I’ve tried going into the Google Cloud Platform and defining a new service action. When I select that in the Google Home app and try to reconnect the account I get:
Could not reach [test action]. Please try again
(after entering my HA login credentials)

So now I’ve gone right back to scratch, and created a new project in the Google Cloud Console - following the guide here:

Everything went OK, but when I got to Step 12 of “Enable device sync” there was no Save button to press, andfI got this message:
no change - principal already exists on the policy

I completed the remaining steps, but my new action was not visible as as service when I tried it in the Google Home app (Step 6 in “Enable device sync”).

Any ideas for how I can recover GA access to HA?