Google Home Push Notifications - Is It Possible

Tags: #<Tag:0x00007f5c987876d8> #<Tag:0x00007f5c98787610> #<Tag:0x00007f5c98787548>

Hello, I tried to search in the forum, but the information is a bit scattered, I can’t understand if this is possible or not. I think that Google Home Already supports this, but and OpenHab, any solution developed or in the pipeline? It would be cool to be able to send TTS to my Google Home directly from OpenHab.

Thank You All

Do you mean getting openhab to send voice commands too your Google home

Yes, sending voice commads to Google Home, or even better Sending Voice Command and receiving back a response, for example “Welcome Home, Turn On Lights?” Response “Yes” Replay “Ok, turning on the lights”… That would be great… But sending TTS to Google Home would do it for now…

I already say I’m home too Google and it says welcome home and does some stuff with openhab

When you ask google to turn a light on it already says ok turning on light

And i also send mp3 files too the Google home for notifications from openhab

Ok, but I was talking about OpenHab detecting that you are home (presence rules) and when it gets “ON” sending a Text to Google Home that he would replay in sound.

I use IFTTT (when my phone exit or enter an area) to send my location data (I only moniter my house) too openhab so it can do some stuff turn lights on ect and Google then says welcome home

I used a tts app on a computer saved it as mp3 and used the chromecast binding to send the mp3 file too Google play

That’s the only way I can get google too talk although its not actually Googles voice

You use other TTS software to convert Text To a MP3 file and send it to Google Home. I’ve seen that solution, but I read somewhere that now is possible to make google home talk with a request. I’ve seen this http://www.notenoughtech.com/home-automation/google-home-notifications-tutorial/ and I was wondering if OpenHab has something on the pipeline to allow.

Yes that’s the way I do it seems too work perfectly fine apart from it not being exactly Googles voice

I just add a playsound into my rules when I want Google too play something

I’m not sure if anything is in the pipeline I’m still pretty new too all this and only just getting it done myself

I had a look at your link.
Do exactly what they do, use node-red
Send the command to node-red from OH with mqtt and bob’s your uncle…

I’ll try to setup it and see the result! And hope to have some kind of integration on the future!

Thank You

You can use the chromecast binding to send messages to your Google home. I use VoiceRSS for TTS, then send the message to Google home using the chromecast binding. This works very well.

Could you share your setup, please?

Hi Vincent,

It is actually quite simple. You just need to install a TTS Service and the Chromecast binding, then you can use the say command in a rule to send TTS messages to your Google home. Please note that the voice won’t be the regular Google Home voice, but the voice of the selected TTS Service.

See also https://docs.openhab.org/configuration/multimedia.html

Once you have installed/configured the TTS Service (I use VoiceRSS), install the Chromecast binding. Your Google Home should be discovered as a new thing.

I have a String item TTSTextUpstairs that holds the text that should be spoken by the Google Home.
I use the following rule to send the TTS message to my Google Home. Of course you have to change the “voicerss:nlNL” to match your TTS service/language and replace “chromecast:chromecast:69232a4cce678947ce237ece56ff” by the ID of your Google Home Chromecast.

rule "TTSTextUpstairs received command"
when
	Item TTSTextUpstairs received command 
then
	say(receivedCommand.toString(), "voicerss:nlNL", "chromecast:chromecast:69232a4cce678947ce237ece56ff")
end

Hope this helps.

Cheers,
Matt

3 Likes

@mstehle

Thanks for the detailed explanation, I managed to get it working for sounds (mp3 stream) but a “Say” is not working on my Google Home Hub, it hangs at “Notification” and doesn’t do anything. Does it still work for you?

Hi giejay,

Yes, the say command is still working for me without problems. Currently I am no longer using VoiceRSS though but Google.
What TTS service are you using?

Ah that might be it, I’m using voicerss.I will try Google this evening!

It should work with Voicerss as well. I used Voicerss for the same purpose, before I moved to Google TTS. Reason I moved was to get better support for the danish language and more clean voice/sound, which Google TTS provide.

So I tried it with Google Voice, with my Google Home Hub and my Google Home Mini. Both display the same behaviour, after sending the text, I get the “beep” sound, but after that nothing. When I try to submit a new message, I see the following log:

2019-08-04 12:23:14.298 [hingStatusInfoChangedEvent] - 'chromecast:chromecast:06c76ee5758f49d9bdd0---------12' changed from ONLINE to OFFLINE (COMMUNICATION_ERROR): Waiting for response timed out

And after a while it goes to Online again…

Are you also Using a Mini or a Hub?

My say is like this:

say(TextGH.state.toString(), "googletts:nlNLStandardA", "chromecast:chromecast:06c76ee5758f49d9bdd0b87c-------12")

I havn´t tried for a coupple of months, but I just tested again, and everything seems to work fine.
These is my test rules:

rule    "Voice Testing Rule"
     when
	Item   Voice_Robot  changed from OFF to ON  
    then
       say("I´m going to bed now :-)" )
end

I have one of my Google Home Mini´s set up as the default sink in the PaperUI/system configuration.
Voice_Robot is just a switch item like this:

Switch Voice_Robot     "Pushbutton to test Voice TTS [%s]"     <switch>    (gV)

(gV) is just a group to swicth off the switch after 200ms.

This is another rule, where I use the same Google Home mini to cast a stream (mp3) directly to the device:

rule "Play stream to Google Home Mini"
when
	Item lydknap changed from OFF to ON
then
	 	playSound("chromecast:chromecast:af8126e02c056c079c04f4f925fe4e47","Halloween1.mp3")
	logInfo("RULE.SWITCH_ON_STREAM", "Sending sound to Google Home Mini" )
end

lydknap is just a switch item. And I have set an 2min expire on this switch to turn off the switche and then the stream, (otherweise it will continue forever) like this:

Switch lydknap     "Lydknap til at test lyd 2min expire [%s]"      <switch>      { expire="2m,command=OFF" }

I have the halloween1.mp3 sound file in my sounds folder.

Hmm just went through my rules… It seems like I never actually tried using the above with googletts. But I have used it with voicerrs like this, and it worked fine:

	 say("Total alarm er blevet tilkoblet", "voicerss:daDK", "chromecast:chromecast:255f3cf49521e13fa5f92fc38ae7ac51")

Perhaps I should give it a try using google… Just need to figure how the voice is syntac is for google… Maybe googletts.daDKStandardA
Will test and report back.

EDIT: Now tested. This rule works fine for me:

rule    "Voice Testing Rule"
      when
	Item    Voice_Robot     changed from OFF to ON  
      then
	 say("Nu går jeg i seng :-)", "googletts:daDKStandardA", "chromecast:chromecast:af8126e02c056c079c04f4f925fe4e47")
end