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

tts
requires_server
project_alerts
project_voice
googlehome

(Greg) #1

UPDATE:
This thread is mainly for V1 that I am no longer supporting. Please use Version 2 and use this thread here: [Release] Google Assistant Relay V2.0 - Google Home Audio Notifications!

image

ASSISTANT RELAY

I’ve wanted to get audio notifications on my Google Home for a long time as have a number of people. There are quite a few implementations of this, however they all use the cast feature to cast TTS audio to your speaker.

Back in Autumn/Fall last year, Google announced their broadcast feature for Google Home which lets you send audio notifications to all Google Home devices.

Until recently, there hasn’t been a way to do this, until one of the Node modules I follow was updated to use the new text input feature of the Google Assistant Service API

What is this?

  • This isn’t an extension of your Google Home
  • This isn’t some fancy local API that connects directly to your Google Home
  • This is a Node.js server that uses the Assistant SDK
  • This is basically another Google Home device, but without a microphone and speaker

What can I do with this?

Assistant Relay is a Node.js server that will accept requests, and then process them. These might be broadcast requests, predefined statuses or routines. It accepts text entry and then does something with it.

As an example, open up Google Assistant on your phone and then type broadcast hello world. Your Google Home devices will now announce “hello world”.

By sending a request to Assistant Relay like /customBroadcast?text=hello+world you will get the same outcome. There are lots of things you can do such as:

  • Send broadcasts, useful if you want to announce that the back door has been opened
  • Trigger routines through Google Home, useful if you don’t want to setup your Google Home routines again in SmartThings, WebCore, IFTTT or whatever other platform you might use

You can also hook this up to anything you want, it doesn’t have to be SmartThings:

  • Send broadcasts from your phone to Google Home if your phone rings using Tasker
  • Send a predefined movie announcement using WebHooks from Plex

Supported Systems

Assistant Relay relies on the Google Assistant SDK, therefore it only currently supports x64_64 or ARMv7 processors. It should work on the latest Raspberry Pi’s with an ARMv7 chip. Check the below pages for more information


Installation

What you need

  • A device capable of being always on
  • Node.js running on this device
  • A copy of Assistant Relay (Click the green button and hit download zip)

I’m not going to run you through how to get Node.js running on your device as there are hundreds of guides out there on how to do this. http://thisdavej.com/beginners-guide-to-installing-node-js-on-a-raspberry-pi/

You then need to configure your Assistant Relay so that it works with your Google Account. I’ve put the configuration guide on my Github Repo. Follow that and run the relay. If the relay is running successfully, your Google Home should make an announcement to tell you its running

How To Use

You can now make a call from WebCore, Tasker, IFTTT or anything else. I’ll share some of my Postman examples below:

Postman

If you want to test this out in Postman, import the below collection to see and test some examples:
https://www.getpostman.com/collections/42fe420662d38f74a45e

WebCore

Simply use the DO ACTION and then “Add Task”


Upgrading

To upgrade, simply download the files from github and copy them over to your existing Assistant Relay folder, overwriting any existing files.

If you have already used the npm run build-config command to build a config file, do not copy of the default configuration file, otherwise you will have to run the above command again.

Once the files are copied over, run npm install and then start the relay as per above


Bugs and Requests

Could you use the Github repo to add any bugs or feature requests please. It’s too difficult to track them here:


Updates

  • 3rd April
    – More bug fixes
    – Change so that default user is always used when no user parameter is passed

  • 30th March
    – Lots of bug fixes
    – Build Configuration tool includes
    – Added converse parameter to have your Google Home speak a text response back

  • 19th Jan
    – Nest Cam Integration


Google Home + SmartThings = Announcer for doors, motion, and everything else, I hope
Using Google Home (assistant) speaker for notifications/alarms?
[RELEASE] cast-web 1.0.0 - Chromecast Device Handler & SmartApps
Google Home, Harmony Hub, Chrome Cast, Nest Camera’s
Google Assistant & SmartThings Status Report HELP!
Casting a website to Chromecast with Voice Command from Google Assistant
Aeon Home Energy Meter v1 -- Read Clamps Separately
Off topic a bit maybe - Went and bought a Google Home Min
Google assistant - "BROADCAST" command as TTS
Custom google home announcements?
Sensi Thermostat
Want to have Google Home tell me when a contact sensor was last opened
Google Home Broadcasts
Alarm sounds?
Need to broadcast sounds in other parts of the house (including ADT/SmartThings panel announcements)
PA and/or intercom?
Google Home respond to a trigger?
Google Home/Audio with v2 Hub
#2

This is super cool. Hoping for a feature like this. Good luck getting it off the ground!


(Kebel87) #3

Thanks for your work, it looks promising.

I’ve tried similar solutions in order to have GH act as TTS (such as other node.js and Home Assistant triggered by a web request).

However, every hack I tried, while working, had a flaw that rendered it somewhat useless. It’s that the spoken text is not as loud as when the assistant is responding to a verbal request.

Is your solution having that issue or is the sound volume the same as when the assistant is triggered verbally?

Also, my issue might be related to the fact I’m using GH in Canadian French. I haven’t tried it yet in another language to see if it’s any different.

Thanks.


(Greg) #4

This solution doesn’t use TTS at all. It uses the Google Assistant API to directly hook into the broadcast command.

The volume will be the same as whatever the current volume the device is set to, however it is possible to increase the volume before sending a command, however this does add further delay.

It shouldn’t matter what language it is used in so long as the Google Home official supports that language

As for the project itself, I’ve just built in further stand Google commands, i’ll get a video demo up shortly.
For example, you could set a Geo-location action so that if you leave the boundaries of work, it automatically sends a command to Google Home and notifies people that you’re on the way home. Unfortunately, I haven’t figured out how to change the user on this action yet! I have an idea how to do it though.


(Michael Harman) #5

That’s awesome, I’ll be looking forward to your progress on this. It’s exactly the kind of thing I’ve been hoping for since I got SmartThings and Google Home.

Unfortunately I don’t have any experience with SmartApps or Device Handlers in SmartThings so I can’t help on development.

But I’m rooting for you to be successful!


(Eddy) #6

Hey thanks for working on this
I saw you were reading my post previously regarding this
Oh and do you think its possible to broadcast to a specific google home? (if u have multiple of them?)


(Greg) #7

Yes that should be possible. I just need to figure out what the commands are!


(Eddy) #8

Im interested in getting a node server to run this off a android device
Get me your repo :slight_smile:


(Greg) #9

Someone else was asking me about this, however I’m not sure if it will work. PM me your email address and ill add you to the repo


(Dana ) #10

No developer chops here, unfortunately.

I do have a Synology NAS that has an available node.js package that I have installed. No idea how to use it. :slight_smile:

Once you have something that is more “packaged” (e.g., including Linux doofus level node.js setup instructions) I’ll be happy to test. I am comfortable in webCore (and am using webCore to make a DLNA speaker speak announcements via TTS) so that part is not an issue for me.

Thanks for working on this.


(Kebel87) #11

No developer here either, but I’ve been fooling around with raspberrys, .js and docker a lot so I’ll be happy to test once you got something to share.

A dockerised version could be very useful too, I’ll look into that.


(Dana ) #12

BTW @ghesp, maybe you saw this, but does the activity/work on this thread relate/help at all in terms of what you’re doing?


(Greg) #13

Again, I believe that’s another implementation of the cast protocol that uses TTS. Basically it overrides whatever is on the device with no resume feature.

My implementation supports pause/resume since it does not use the cast protocol. The downside of that though is that you can only play back words and phrases, rather than sound effects.

Ie, If the doorbell rang, you can’t play a “ding dong” sound, Only broadcast out that someone is at the front door.

Give me 2 minutes to make a video and i’ll show you how mine works in terms of existing cast content


(Dana ) #14

NP, thanks. Just wanted to make sure you saw it in case it related.

I don’t need sounds, just text announcements, so I prefer what you are doing here…the ability to pause/resume, and the ability to control which GH devices get the message are both key capabilities.

Thanks!


(Paul) #15

If you’d like to send over the repo information - I will take a look at it.


(Greg) #16

So its a public repo now. I’m not going to release it as a finished product yet, but if people want to install and play around they can


(Dana ) #17

I have a Synology NAS w/its node.js package installed.

My NAS does not support Docker so I can’t use that option (which I believe might simplify matters if it was supported).

If anyone is kind enough to write basic setup steps for the Linux toddler then I’d be happy to try to set this up and test it a bit. NVM…oops, finally clicked on the link and noticed the install/setup instructions. I’ll go through that and ask if I have questions. If there are obvious Linux noob pitfalls to warn me about, I would appreciate that. :slight_smile:

This might eventually push me over the edge to getting a Raspberry Pi…is this a good way to start? I have a 64GB SD micro SD card w/SD card adapter sitting around so I don’t think I need to purchase any storage. I don’t want to sit at a desk to use it (prefer my comfy couch), so I guess I’d need small integrated touchscreen monitor and either use a touchscreen keyboard or get a small external keyboard.

https://www.amazon.com/CanaKit-Raspberry-Clear-Power-Supply/dp/B01C6EQNNK/ref=sr_1_5?s=electronics&ie=UTF8&qid=1516039168&sr=1-5&keywords=raspberry+pi+3


(Eddy) #18

<<<<<<< ACtually bought a RPI because of this


(Michael Harman) #19

Be a good use of my Pi Zero W that I couldn’t get working for my MagicMirror build. :slight_smile:


(Dana ) #20

What did you buy, specifically - any suggestions?