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

So I fought through the installation of this thing and I finally got to work and it’s worth it! I ran into the same error. I believe the issue to be that you have another device in smartthings with the same Network device ID which is a MAC address. Go to your IDE and look at your devices and search for your Mac address D43D7EDB954B and then decide if you can live with changing the network id for that device or getting rid of that device.

Or it would be a good idea if I could figure out how to do that!

Hmm, I can only assume that this isn’t working because I’m running node.js from the official Docker container. But on the flip side I’ve got the container set to use host networking, so it’s not like anything should be unintentionally blocked by the use of Docker.

I tried installing node directly on the server itself (a Synology NAS) using Synology’s own package, but there’s too many components missing to allow the npm install script to complete. Seems like it would be far too much extra work to get that working, when the Docker image appears to be working fine.

Any ideas of anything else I can try?

Edit: Possibly answering my own question: Turns out that Docker doesn’t pass multicast to containers so doesn’t work with SSDP, however, using host networking should apparently work around that, so I’m still at a loss. :confused:

Edit 2 (cos I can’t post more than 3 replies right now): Fixed it! The problem wasn’t Docker, but my ASUS router. Had to turn on “Enable multicast routing (IGMP Proxy)” and “Enable efficient multicast forwarding (IGMP Snooping)”, which is found under LAN/IPTV settings of all places.

If anyone else is having discovery issues, check your router for IGMP settings and enable them!

2 Likes

Great feedback, and great sleuthing.

If you still want POST commands they are on Greg’s GitHub…

Custom Broadcast
To send a Broadcast command, simply send a HTTP Post request:

http://<ip_address>:3000/customBroadcast
with the following parameters:

text: hello world
user:
The full request would be:

http://<ip_address>:3000/customBroadcast?text=hello+world&user=>user in config>
The Google Home device will now play an audio alert, and say Hello World

Will this work through this integration?

@rtikul8tim. Thanks a lot that worked. removed another network device(KODI) in ST running on the same windows PC as Node.js , I will not be using KODI anymore. :grinning:Back to less productive work again, creating pistons with webcore…oh boy this is addicting…:stuck_out_tongue_winking_eye:

1 Like

when google says please copy this code and paste it do I need to do anything? I am getting an unexpected error in smartthings app when trying to add it.

What step are you on in the process…are you copying code from Greg’s github to create the SmartApp and Device Type Handler (DTH)?

Make sure you copy SmartApp code to the SmartApp tab, and DTH code to the Device Handler tab in your IDE. If you paste SmartApp code into the Device Handler tab (or vice-versa) you will get an error.

I saw Docker mentioned several times in the thread. Has anyone gotten around to creating a Docker image for this yet?

Thankyou!! I had not installed the DTH in IDE. Everything is installed now, but not working still in progress. Thank you for your help.

Edit: when I try the hello world text I get “Cannot GET /customBroadcast”

Edit2: I am getting this in IDE but still no broadcast.

This is what I get on the RBP.
i@raspberry:~/assistant-relay-master $ curl -X POST http://192.168.86.185:3000/customBroadcast?text=hello

Error

Edit: Completely stuck here. No errors when starting the index.js and no errors in the app but still cant get a broadcast.

GOT IT!!! Running

Congrats. :slight_smile:

What were the final tweaks you had to do to make it work? Any learnings to share w/others?

First off I am a total newb with Raspberry Pi, I bought it just for this project. After almost giving up I slowly reread your guide at github and realized I was launching index.js wrong. This thread is full of _pm2 start index.js --name="asistant_relay" and that was how I was launching it. That never produced the prompt for the code in the terminal. I would just paste it at the prompt and get an error, didn’t think much of it because I could see it index.js running. When I launched it with what you said node index.js I got the prompt and pasted the code and BAM!!! Learning everyday. :slight_smile:

Bumping again for Docker image. Can one of you who are successful to make it run, create a docker image? That will be so awesome and useful. I currently tried to install this in Rpi v1 armv6 and could not make it run. A docker would be great. Thanks

Well, that was easy enough.

Thanks @ghesp - the only thing I had to change was the port - CastWebAPI is also set to use 3000

Would you accept a PR to make that configurable?

You can build one yourself. Here’s the Dockerfile I’m using (relay folder containing the js code and config files - no modules folder):

FROM node
RUN apt update && apt upgrade -y && apt install -y libasound2-dev
RUN mkdir /usr/src/relay
COPY relay /usr/src/relay/
RUN cd /usr/src/relay && npm install

Build it :

docker build .

When finished, tag the image with some meaningful name

docker tag <yourimageidhere> relay

then run the following to start the container

docker run -d --name assistant_relay --network=host --restart=always -w /usr/src/relay relay node index.js

If you do not want to package the code into the image then you can do something like (I have not tested this!)
docker run -d --name relay --network=host --restart=always -v /home/pi/relay:/usr/src/relay -w /usr/src/relay node node index.js
Just make sure that the node version on your system matches the one from the image (latest is v 9.5 i believe), if different version is installed on your base system match it accordingly e.g.

docker run -d --name relay --network=host --restart=always -v /home/pi/relay:/usr/src/relay -w /usr/src/relay node:4 node index.js

to use v 4.x of node

I’m running this on raspberry pi 3 btw.
HTH

I am having issue with this step: I get “an unexpected error” message when I try to save although I was able to find the assistant relay device.

Did you install the device type in your IDE?

Should see this in your Device Handlers tab in your IDE if you created the Device Type as specified in the setup instructions.:

Ah, that did it! Thanks a lot!