Google Assistant Relay and cUrl commands

Thanks mate!

Now we need a docker Pi image. :wink:
Then I'd feel like Santa satisfied my needs. :smiley:

So I thought I had done that via a fork from your master on github, but I still am not getting any TTS output from the device when I click "speak" in the device.

All I did was create a new input to allow people to add a directory after the port of the server that defaults to "/assistant" and if the input is blank, use the V1 logic.

Still, no go Hubitat/V2.X Driver at master ยท nrmoles/Hubitat ยท GitHub

I would recommend using the Device Notification capability rather than speak. That's what I used for the Cast-Web-Driver. I like Cast-Web better because you can use it to control the volume on your GH speakers through HE. For example, when my bathroom light turns off, it turns the volume back down from the level i have while in the shower back down to a reasonable level.
If you're interested in trying, I can post links to the code.

That would be fantastic. I would like to do just what you described with my bathroom mini, but I also would like to be able to have a broadcast of TTS triggered when my toddler's door opens during specific hours so I know when she is out of bed or when someone opens my front door.

Much appreciated!

Yup...here's the link to the adapted drivers and smart-app.
https://github.com/ryancasler/Hubitat_Ryan/tree/master/cast-web-api

And to get the code for your server, just run:

sudo npm install cast-web-api@beta -g

Then you'd have to use standard methods to start it and start it again at reboot (i.e. rc-local or create a systemctl service). If you don't know what the hell I'm talking about, just let me know and I'll post more details. Once you install the driver and app and server, you have to authorize the server the same as you go assistant-relay but you don't have to create any users. You also don't need to create a second project or oauth credentials, both servers can use the same one.

Once installed and devices are synced, you can use the notification capability to send a broadcast to all cast-web speakers or you can pick an individual one and use the "Speak" command to send something to that speaker only as a "cast" message. FYI, the "cast" message will cause whatever is playing on the speaker to stop because it is basically casting another file for the device to play. That's why I stick to the broadcasts via notifications as much as possible.

1 Like

Ok I got it installed and running using forever start 'cast-web-api' and when I go to http://192.168.1.XXX:3000 I get a response of { "cast-web-api" : "v1.1.0-rc19" } so I can tell I'm i business there, but I am not getting prompted to authorize with google. Do I need to manually copy my OAuth file to a location in /usr/local/bin/cast-web-api to get it to prompt for that?

Thanks for the assist, this looks great

Nope...just go ahead and add the drivers and app....then install the app and it will walk you through authorization. Just click on this:

And you'll be walked through setup. Then you can discover your devices and whatnot. Supports all devices that support "cast" so Chromecast Audio and Video and all GH devices and devices with "Assistant Built In".

Great, thanks for the help Ryan, I walked through the setup no problem, supplied my ClientID, secret, etc., and now can see all of my GH devices. Just have to update my rc.local on the rPi and I think I am done.

This community has made getting migrated from ST pretty darn easy

1 Like

You ordered a GH hub? I thought you ordered a homepod :stuck_out_tongue_winking_eye:

1 Like

I'm offended by Apple ATM. I can't bring myself to leave iOS and Apple TV but the Homepod and the new iPhones really urk me, Home Hub seems awesome.

2 Likes

I got this error when I clicked on "setup the google assistant with webcast....
"GoogleAssistant not installed, error: Error: The gRPC binary module was not installed. This may be fixed by running "npm rebuild" Original error: Cannot find module '/usr/local/lib/node_modules/cast-web-api/node_modules/grpc/src/node/extension_binary/node-v59-linux-arm-glibc/grpc_node.node'"

I was able to add a couple speakers and got them to play text

What version of Node are you running on your cast-web server?

9.9.0

I'm currently running 8.11.1. Can you try with that version?

I would love to, if I had any idea how to change it LOL

You're running on an RPi? If so, I would recommend using this script.

You can install by running:

wget -O - https://raw.githubusercontent.com/audstanley/NodeJs-Raspberry-Pi/master/Install-Node.sh | sudo bash

Then run sudo node-install -v 8

You will be prompted with what version of node you want to install. Fastest way I've found to swap version of Node on an RPi.

Yep

OK got node 8.11.1 installed, and rebooted, got the same error. I tried running NPM rebuild in the /usr/local/bin directory, and it didn't help

I have been starting the web-cast-api by double clicking on web-cast-api file and running it in a terminal window. I couldn't figure out any other way to start it