[Release] [Closed] Google Assistant Relay V1 - Google Home Audio Notifications!

Thanks so much @ghesp! I am a noobie to all of this, but with your directions I was surprisingly able to get it up and running on my Raspberry Pi 3 with no problems at all. I also set it up to run the service forever at startup.

Now, onto trying to create some webcore pistons…thanks in advance @Danabw for all your comments/instructions.

Can you please tell me how to do this. I have googled and found many methods but none have worked for me. I am a pi noob.

me too as a pi noob. Seems must have PI 3 for the working. I can see Google Assistant relay in WebCoRe already…

Well as I said in my post, I’m a noob too…it appears that I can’t get this to run on startup because after some testing anytime I stop the service and restart it, I’m required to paste a link into my web browser to allow access.

Does anyone know how to get around this? If not, anytime I restart my RPI I’m required to manually enter ‘node index.js’ in terminal and then click the link to allow access, and then paste the code provided.

Well with mine I dont have to enter the code every time. I did it once. I have rebooted the pi and restarted the node.js many times and have not had to enter it again.

Thanks @ghesp for your work with this. I got it up and running this evening and it’s exactly what I hoped it would be.

I just have one question. I have another node.js app running on the same vm and currently both are trying to use port 3000. How easy would it be to move this to another port? I greped for 3000 and there were quite a few mentions. Which ones do I need to change?

Hmm, well that’s at least good to hear. Let me try that when I get home tonight.

As far a getting it to start at boot, I have used this method successfully for two other services.

The first step, on terminal window, is change to the etc/init.d folder (as root)

$ cd /etc/init.d

Create a new file, using a text editor like ‘nano’. In this case let’s call the service we want to create “AssistantService”:

$ nano AssistantService

The contents of the new file are these:

#!/bin/sh 
#/etc/init.d/AssistantService 
export PATH=$PATH:/home/pi/assistant-relay-master 
export NODE_PATH=$NODE_PATH:/home/pi/assistant-relay-master/node_modules 

### BEGIN INIT INFO 
# Provides:             AssistantService 
# Required-Start:  $remote_fs $syslog 
# Required-Stop:  $remote_fs $syslog    
# Default-Start:     2 3 4 5 
# Default-Stop:     0 1 6 
# Short-Description: Google Assistant Relay Service 
### END INIT INFO 

case "$1" in 
start) 
exec forever --sourceDir=/home/pi/assistant-relay-master -p /home/pi/assistant-relay-master index.js  #scriptarguments 
;; 
stop) 
exec forever stop --sourceDir=/home/pi/assistant-relay-master index.js 
;; 
*) 
echo "Usage: /etc/init.d/AssistantService {start|stop}" 
exit 1 
;; 
esac 
exit 0 

Then enter the following in terminal:
$ sudo chmod 755 /etc/init.d/AssistantService

$ sudo sh /etc/init.d/AssistantService start/stop

$ sudo update-rc.d AssistantService defaults

1 Like

See @cjcharles posts above on changing port. Here’s one:

[Pre-Release] Google Assistant Relay - Google Home Audio Notifications!

I’m using pm2 to start mine automatically… came across this a month ago and it works well.

1 Like

So I tried again tonight both by stopping the service and rebooting my RPI, and any time I start the service back up it makes me enter the URL to allow access and then paste the code to set up assistant relay. Am I doing something wrong that’s making me do this each time?

Well that’s crazy… I tried your method of automatic startup and it didn’t work either. I wonder if its because I am booting to the GUI???

I boot to GUI, that’s not causing your problem.

Make sure that after you do ‘npm install’ you also have to do ‘npm install forever -g’.

@ghesp, @danabw or anyone else with expertise, is there a reason why each time I start Assistant Relay with the command node index.js that I’m having to sign into my Google account, get a code, and copy this code back into the terminal?

Total guess here, but what user are you using to run the relay, and where have you copied the installation files? It seems like the script may not have write access to the folder, hence it cant save the credentials or something like that.

2 Likes

And I don’t think this is your problem, but just to confirm the basics, do you have your config.json file setup w/your client secret info?

E.g.,

{
“users” : {
“danabw”: “client_secret_xxxxxxxxxxx-xxxxxxxxxxxxxxxxx.apps.googleusercontent.com”
},
“language”: “en-US”
}

That was it! Thanks so much. I ended up typing sudo node index.js and it works after I stop/restart the service.

1 Like

Got it!! Thank you!

Hi guys, I had everything set up and running on my windows server with my one google home. I liked it so much I went out and bought another home (mini) for the basement, and added it to my google account. After I did that I am not getting any more announcements. I have restarted the service, re-configured the smart app, etc. any suggestions? Did i miss something I need to do if I change or add google homes?

I started w/two (GH and mini) so no experience adding additional GH devices, but I know I didn’t have to do anything to tell it I had two.

Are you logged into the GH mini on the same Google account that your logged into on your regular GH?

Also, the old reboot and retry is likely worth a shot - reboot both GH devices and then reboot your server and see if the GH devices announce the service is running or not.