Whilst it’s entirely possible that I inadvertently broke this myself, I can’t work out how to fix it for the life of me.
It was working perfectly until recently, but now I just get messages like the following from the logs :-
2021-02-14 14:14:09 ERROR (MainThread) [homeassistant.components.rest_command] Client error http://192.168.0.99:3000/assistant
14 UNAVAILABLE: Getting metadata from plugin failed with error: invalid_grant
If there is more info I can provide that might help, or another log file I can reference, then I’m more than happy to check if somebody can point me in the right direction.
Kinda confused now - my Assistant Relay shows “Current version: 0.7.4” but that page shows [v3.2.0] as the latest (non-Beta) version.
My presumption is that what I have installed is " Assistant Relay for Hassio" and that relies on Assistant Relay in the background…but I don’t know how to update that.
I’ve already tried with a new user, doesn’t seem to make a difference.
For the update, I think the same way.
The ‘original’ Assistant Relay has an update, and the version for home assistant is relying on that one.
auto-update is on, so I assume this will fix itself in some time.
I’ve added Assistant Relay a week ago, and wanted to start making some automations with it today.
Guess I’ll have to wait a few more days.
The error happens to me periodically. I have NOT known how to solve it after searching many forums.
What I do to temporarily solve it is delete the user from the interface and re-enter it to renew the permissions against Google. Since it seems that they are lost.
I would like to at least create a “switch” that checks the assistant relay log and tells me when there is “error 500” but I have not been able to access the log either (I’m in HASSIO)
I am experiencing the identical issue… After about a week or so I start getting the 14 UNAVAILABLE: Getting metadata… errors. It can be resolved by uninstall-reinstall of the Relay Assistant and re-entering the same client secret. Obviously not a long-term solution.
Although I have not proved it yet, I suspect this may be happening on a fixed schedule of some sort.(i.e. fails exactly 1 week or 10 days from initial setup).
Perhaps the issue is on the Google side??? After 1 week, something needs to be re-authenticated for some reason? I have looked at all the settings in the O-Auth section, but I don’t see any clues. Frustrating.
Publishing my App in Google and then recreating my users has meant I have had no issues for nearly 3 months now and everything has been running smoothly.
Hi Craig,
Sorry for the delayed response. I had not published my App. I have done that now and created a new user. I guess I will know if it works or not in about a weeks time.
I finally found a place trying to figure this out where it is documented that user consent for test users expires after 7 days. Look under Publishing Status and Testing on this page.
I am still not 100% comfortable setting this integration to “Published” since it says that then any user with a Google account can use it, but I figure there is little risk since only users on my local network have access to it.
A big note of caution to other users however this integration has NO other built in security. Anyone that can access port 3000 on your HA system can execute arbitrary Assistant commands for the Google account linked to it including sending/reading email, Google Drive etc. For this reason I created a separate Google account to use with it and added it to my home that does not have access to my main Google account.
I am a bit confused when publishing the integration in regard to security risk. Since port 3000 is used locally (by default port 300 is not open on the firewall) the potential threat is limited to someone on my local network accessing port 300 on my HA system, am I right? Creating another google account for the integration does that means I have to add this new account to my google home? Thks.
Yes. Since I had already created a separate email account [email protected] for HA to use for notifications I just created a google account for it as well (select other email when registering.) Then after adding it to Assistant Relay I also added this user as a member of my household in the Google Home app.
Make sure port 3000 is not open on your firewall either. If you remember when you connected to it (or whatever port Assistant Relay is installed on) to configure it all you had to do was type in the URL to your browser. And it shows all the authorized users and even has a sandbox to test out any command you want. Very convenient but not very secure. As long as no one you don’t trust is on your local network it’s fine. But if your router or other computer gets hacked it would be possible to exploit it to obtain personal information. Better safe than sorry.
Google cloud developer console has made changes to the oath authentication process and it will now give an error 400 when trying to authenticate. If I set the oath client id for web app instead of TVs and configure a https redirect url it will authenticate but when redirect to the https redirect url (https://xxxx.duckdns.org:3000) it will give an error such as this site cant provide a secure connection ERR_SSL_PROTOCOL_ERROR. Is there a way to have assistant relay provide a secure connection. Do you have any other ideas how to resolve this issue. It was working ok for a while until I try to create another google account. Since then even with my main google account it will give me an error 400. Thanks.
Just wanted to share that after I got the 400 error, I was able to get this to work by creating an OAuth client id with Application Type - “Desktop app”, instead of “TV and limited input devices”. Not sure what’s the difference, but I got assistant relay to work for me now.
Hi, I deleted my prior messages as I said at first it didn’t work for me, but i was using webapp as application type, not desktop app. So I can confirm that ‘Desktop app’ does the trick.
I was able to get this setup up and am not getting any errors from assistant relay in the sandbox environment as a desktop app. However, when I select broadcast it does not actually broadcast to any of my devices on the network. I can see the calls are hitting the API and am not seeing any errors in logs for the add on. Any ideas on what might be the cause here?
Creating an audio-responses folder... This needs to be done once.
Assistant Relay is now starting...
> [email protected] start /assistant_relay
> pm2 start ./bin/www && pm2 log www
-------------
__/\\\\\\\\\\\\\____/\\\\____________/\\\\____/\\\\\\\\\_____
_\/\\\/////////\\\_\/\\\\\\________/\\\\\\__/\\\///////\\\___
_\/\\\_______\/\\\_\/\\\//\\\____/\\\//\\\_\///______\//\\\__
_\/\\\\\\\\\\\\\/__\/\\\\///\\\/\\\/_\/\\\___________/\\\/___
_\/\\\/////////____\/\\\__\///\\\/___\/\\\________/\\\//_____
_\/\\\_____________\/\\\____\///_____\/\\\_____/\\\//________
_\/\\\_____________\/\\\_____________\/\\\___/\\\/___________
_\/\\\_____________\/\\\_____________\/\\\__/\\\\\\\\\\\\\\\_
_\///______________\///______________\///__\///////////////__
Runtime Edition
PM2 is a Production Process Manager for Node.js applications
with a built-in Load Balancer.
Start and Daemonize any application:
$ pm2 start app.js
Load Balance 4 instances of api.js:
$ pm2 start api.js -i 4
Monitor in production:
$ pm2 monitor
Make pm2 auto-boot at server restart:
$ pm2 startup
To go further checkout:
http://pm2.io/
-------------
[PM2] Spawning PM2 daemon with pm2_home=/root/.pm2
[PM2] This PM2 is not UP TO DATE
[PM2] Upgrade to version 5.2.0
[PM2] PM2 Successfully daemonized
[PM2] Starting /assistant_relay/bin/www in fork_mode (1 instance)
[PM2] Done.
┌─────┬────────┬─────────────┬─────────┬─────────┬──────────┬────────┬──────┬───────────┬──────────┬──────────┬──────────┬──────────┐
│ id │ name │ namespace │ version │ mode │ pid │ uptime │ ↺ │ status │ cpu │ mem │ user │ watching │
├─────┼────────┼─────────────┼─────────┼─────────┼──────────┼────────┼──────┼───────────┼──────────┼──────────┼──────────┼──────────┤
│ 0 │ www │ default │ 3.2.0 │ fork │ 56 │ 0s │ 0 │ online │ 0% │ 22.5mb │ root │ disabled │
└─────┴────────┴─────────────┴─────────┴─────────┴──────────┴────────┴──────┴───────────┴──────────┴──────────┴──────────┴──────────┘
[TAILING] Tailing last 15 lines for [www] process (change the value with --lines option)
/root/.pm2/logs/www-out.log last 15 lines:
/root/.pm2/logs/www-error.log last 15 lines:
0|www | Assistant Relay Server Initialized
0|www | Visit http://172.30.33.3:3000 in a browser to configure
0|www | An update is available. Please visit https://github.com/greghesp/assistant-relay/releases
0|www | GET / 304 12.260 ms - -
0|www | GET /static/css/2.4af953f8.chunk.css 304 1.707 ms - -
0|www | GET /static/js/2.2f2d0ed6.chunk.js 304 1.281 ms - -
0|www | GET /static/js/main.4e10c66e.chunk.js 304 1.540 ms - -
0|www | POST /server/userCount 200 49.412 ms - 10
0|www | GET /favicon-32x32.png 304 1.275 ms - -
0|www | GET /favicon-32x32.png 304 1.066 ms - -
0|www | POST /server/addUser 200 29.797 ms - 297
0|www | POST /server/processOAuth 200 393.686 ms - -
0|www | POST /server/userCount 200 21.411 ms - 10
0|www | POST /server/getResponses 200 29.337 ms - 16
0|www | POST /server/getConfig 200 36.838 ms - 126
0|www | Conversation Complete
0|www | POST /assistant 200 2692.964 ms - 70
0|www | An update is available. Please visit https://github.com/greghesp/assistant-relay/releases
0|www | GET / 304 2.115 ms - -
0|www | GET /static/css/2.4af953f8.chunk.css 304 3.307 ms - -
0|www | GET /static/js/main.4e10c66e.chunk.js 304 3.785 ms - -
0|www | GET /static/js/2.2f2d0ed6.chunk.js 304 3.108 ms - -
0|www | POST /server/userCount 200 27.290 ms - 10
0|www | POST /server/getResponses 200 27.100 ms - 93
0|www | POST /server/getConfig 200 26.635 ms - 126
0|www | Conversation Complete
0|www | POST /assistant 200 3241.838 ms - 70
0|www | Conversation Complete
0|www | POST /assistant 200 3532.700 ms - 70
0|www | Conversation Complete
0|www | POST /assistant 200 2937.706 ms - 70
0|www | Conversation Complete
0|www | POST /assistant 200 2098.175 ms - 106
Thank you for this tip! After diving headlong into Google Cloud Services and the different OAuth2 application types, this is a welcome relief. I can confirm that “Desktop app” credentials works.
However, the redirect_uri in the secrets file will point your browser to a URL formed like this
If your hass.io is running in a virtual machine and your browser is not, then the redirect will not work, so an extra manual step is needed. Just copy out the YOUR_AUTHENTICATION_CODE part from your browsers URL bar and paste this code into the Assistant Relay setup’s Auth Code text box and click the Finish button.
After doing this, and all goes well, expect all your Google Speakers to broadcast a welcome message announcing Assistant Relay is working.
Confrm working for me, now 20days already. used to fail every 7 days.
I am using HASSIO on RPi4 with SD
Need to combine the above 2 instructions to make it works.
create another credential OAuth2 under “desktop app”.
Make it into production mode.
Add it as new user in Assistant Relay, when the redirect URL fail, follow the “your_authentication_code” explain above.
Let us know if it works for you so that other could benefit. Assistant relay is really cool.