greghesp / assistant-relay

A Node.js server that allows for sending commands to Google Home/Assistant from endpoints
GNU General Public License v2.0
781 stars 224 forks source link

Someone please fix it (im on last home assistant) #268

Open malosaa opened 2 years ago

malosaa commented 2 years ago

Well i see the dev went to home assistant aswell, but in home assistant is no way to use the broadcast command.

Anyone know if there is a working version?

I did try a couple of docker images what did get updated some weeks ago, but they don't work and you cant get an auto code anymore with google auth2.0

caraar12345 commented 2 years ago

Ah crap, the about:blank error is a Google cock up?

asheliahut commented 2 years ago

I found a work around for this issue btw @malosaa Add this line into the downloaded google credentials file: "redirect_uris": ["urn:ietf:wg:oauth:2.0:oob", "http://localhost"] as an extra line and that should then allow for it to work.

malosaa commented 2 years ago

@asheliahut thanks, While testing and testing for hours, you can also choose WEB APPLICATION when making the credentials. It gives u an blank page, but in that url there is the auth code and it works.

But let me remember everyone, that you need to apply the project(post it) and don't leave it in testing, as in 7 days it stops working.. thats a thing in google policy.

But then you will have an other problem, people can start using your api and mess with it. So i can only advice use v4.04 because there you can create a special token so nobody can use,

Like me i use it in home assistant, but to using POST it's a different url than we used in v3. normally its 192.168.xxx.x/assistant now its /api/assistant Because 4.04 is outdated, when u try to set it up, u get a screen to track the versions, just dont select that. when pressing next u get a 500 error, just go to your adress bar and replace after/setup to /credentials and you good to go

ShayGus commented 2 years ago

"redirect_uris": ["urn:ietf:wg:oauth:2.0:oob", "http://localhost"]

I'm actually getting Error 400: invalid_request with this one.

If you’re the app developer, make sure that these request details comply with Google policies. redirect_uri: urn:ietf:wg:oauth:2.0:oob

malosaa commented 2 years ago

Like me i use it in home assistant, but to using POST it's a different url than we used in v3.

U doing it wrong, dont add that line into the config.

Choose web app while creating the api auth2. import that one and when it opens an url, connect to your email and then it will give u an error, but the auth vode is visable in your url, just copy paste.

jherby2k commented 2 years ago

Just a suggestion: I finally ripped assistant relay out of HA and am using this script for broadcast-like behavior. it sends your TTS or whatever and then resumes playback of Spotify, Youtube et al:

https://community.home-assistant.io/t/script-to-resume-google-cast-devices-after-they-have-been-interrupted-by-any-action/383896

ryancasler commented 2 years ago

You should not have to modify anything. You want to select Desktop as your Oauth2 client (at least that's what I've chosen). I'm going to go through later this week and grab new screenshots of all the updated Google Console screens of the correct options to choose.

ryancasler commented 2 years ago

I have created a PDF to walk you through all the steps necessary to create a Google Cloud app and get the oauth code without having to do any editing of anything: https://github.com/ryancasler/assistant-relay/blob/master/Create%20Cloud%20Proejct.pdf

thesuperben commented 2 years ago

I have created a PDF to walk you through all the steps necessary to create a Google Cloud app and get the oauth code without having to do any editing of anything: https://github.com/ryancasler/assistant-relay/blob/master/Create%20Cloud%20Proejct.pdf

Just wanted to say your guide was super helpful! Really appreciate the time you put in to making this and got me up and running perfectly!

ryancasler commented 2 years ago

I have created a PDF to walk you through all the steps necessary to create a Google Cloud app and get the oauth code without having to do any editing of anything: https://github.com/ryancasler/assistant-relay/blob/master/Create%20Cloud%20Proejct.pdf

Just wanted to say your guide was super helpful! Really appreciate the time you put in to making this and got me up and running perfectly!

You are most welcome. I glad you found it helpful.

malosaa commented 2 years ago

It will stop working anyways, as in october the new auth will be updated on google side. lets hope soneone will update it.