SmartThings Community

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

tts
requires_server
project_alerts
project_voice
googlehome

#331

@cjcharles

Thank you! The above worked like a charm, just like the rest of this project! I really appreciate you taking the time to create this project, it is so needed!


(Dana ) #332

Actually, the Google Assistant Relay was created by @ghesp, but @cjcharles is a really good guy too. :smiley:


(cjcharles) #333

Yup, I can only claim minor credit! :slight_smile: @ghesp is the one to thank!


#334

Well that was embarrassing lol

Thank you @ghesp for your hard work on this…you have some great folks helping out!


(Old and in the Way) #335

Anybody know where there’s guidance for Smartthings integration? I see in Greg’s initial post a reference to a guide made by Danabw, but that doesn’t describe how you actually add the repository and DTH. I’m an old fart, new to SmartThings, and am probably trying to run before I can walk, but I don’t quite understand the steps needed to get the Assistant Relay linked to ST. I’ve got Assistant Relay setup and it’s working great (thanks for sharing this Greg). Also have WebCoRe installed and having fun with that. Ultimate goal is to have it exposed to WebCoRe, but assume I need to add it through the Smartthings IDE first, correct?


(Dana ) #336

These should help.


(Old and in the Way) #337

Really appreciate your feedback. Making me stare at that second link may help get me back on the right track.

I may not have shaped my question well due to my lack of understanding the fundamentals. I already had GitHub linked from previously setting up WebCoRe. The first post in this thread says, “you can either add in my repository to the IDE, or manually copy in the SmartApp and DTH from my repository.” That’s the step I’m hung on - as I’m not sure where to point to find/pull in the custom code. I assume that’s my next step to make SmartThings recognize assistant-relay as a device/thing.

I think I just need to know where to go to pull the SmartApp and DTH code, then follow the steps in Section II from the 2nd link you provided. Does this sound anywhere close to right?


(Dana ) #338

Greg’s GitHub is here:

The code is under the devicetypes and smartapps links:

59%20PM

You can also integrate Greg’s repository into your IDE (if you’re familiar w/that, and I would expect you are from webCore setup) using the info below:

53%20PM


(Old and in the Way) #339

Perfect - just what I was after. Thanks again! That got me on to my next problem, where it momentarily finds the relay, but stays in eternal discovery and throws an “Unexpected Error” message when I save. I see others have had the same issue so I’ll read up to see how to dig out. Appreciate your patience Dana.


(Dana ) #340

NP…tons of help from others to me on more complex stuff.

This is the post to get around the SmartApp not discovering the relay.


(Old and in the Way) #341

WebCoRe now sees Google Assistant Relay and everything’s humming along nicely. Thanks again for greasing the path.


#342

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.


(Eric) #343

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.


(Don) #344

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


#345

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.


(Eric) #346

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.


(Chris Walker) #347

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?


#348

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


(Dana ) #349

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

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


#350

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