Google TTS addon for OH2

I’m guessing here but if you want to use the default TTS service as selected in the System config I don;t know why you would have to specify it for every call.

I only use one sink (which is a Sonos unit) for all announcements. I have not tried to target different units for announcements.


Well, I have tried “” as argument to tts service and voice, but that did not work either. I agree that it makes no sense to have to specify the tts service for every call, but I suppose this is how it is. It is a lot of changes in rules when changing tts service for sure.
I hope @gbicskei may have an answer for the syntax of the tts argument should look like.

The different tests I have made, indicates that google tts does a better job reading the sentences correctly (at least in swedish), than amazon. Amazon might have a nicer sounding voice though, but it is not a big difference). voicerss also does better than amazon in reading the sentence, but the voice quality is much worse.
So I am looking forward to getting this to work. :slight_smile:

So one of the rules I have that runs every morning, does not specify the TTS Service.

In fact, it’s very simple…

rule "coffeeready"
Item CoffeeStatus changed from Brewing to Brewed
say("Good Morning Madame, Your Coffee is Ready")


Yes, this works for me as well. Only I challenge you to get it to work, specifying that this should only be said in your bedroom! :wink:
I know you have only one sink, but afaict, there’s no way of specifying the sink, without also specifying tts enginge+voice? (I hope I’m wrong! :slight_smile: )

I don’t want to make my good-morning in all sonoses in the house, but, for other messages, such as “the owen is ready” etc (I have a lot; owen, microwave, washing machine, dishwasher, dryer that I announce they are ready), I do.

You can use
say( “Sändare Knapp 1”,“gtts:svSEStandardA”, “sonos:PLAY1:bedroom”)
format. In console use smarthome:voice voices command and the first column in the result is the ID of the voice.
It is also possible to use
say( “Sändare Knapp 1”, null, “sonos:PLAY1:bedroom”)
format. In this case the default voice will be used so you will not have to rewrite your rules in case you change the default voice of the system.

are these native IoT or something you added yourself?

Super-thanks, Gabor!
I thought I had tried everything, but ‘null’ argument, I had not thought of! :slight_smile: Also command for listing voices are very useful.

I simply monitors the energy consumption, mostly something along the line of this (for the owen);

var Integer ugn_startad = 0

rule "Ugnen klar"

  Item Energy_ch23 changed

  if( Energy_ch23.state > 200 ) 
  	if ( ugn_startad == 0 )
  		ugn_startad = 1
  		logInfo("Vitvaruregel","Ugn startad")
  else if ( Energy_ch23.state < 100 ) 
  	if ( ugn_startad == 1 )
  		var String message = "Nu är ugnen klar!"
  		ugn_startad = 0

1 Like

And what are you monitoring the energy consumption with?

clever! and same question as @KidSquid

I have two GreenEye Monitors from Brultech to monitor about 40 channels. They also do 1-wire temp for my house.

I installed org.openhab.voice.gtts-2.4.0-SNAPSHOT.jar, created google api key, copied JSON and now this error in the log:

2018-08-12 11: 01: 03.764 [ERROR] [b.voice.gtts.internal.GoogleCloudAPI] - The architecture is not x86_64 but ARM_32. Only x86_64 platforms are supported.

Is it working on RPI raspbian?

The prerequisites in the addon documentation clearly state which platforms are supported:

Please make sure your installation runs on x86_64 Linux/Windows/Mac. Dependencies of Google Cloud Javasupport only these platforms. For details please visit Google Cloud Java/Supported platforms.

Today I finally tested the addon and it works really well!
The only issue I ran into so far is that when you want to test with different voices/pitch/speed for the same locale you have to manually purge the cache or it will replay cached TTS results using previous settings. :frowning:

I see two options here: either we purge the cache each time the configuration changes OR the cache file name could reflect the configuration state as well…

Pull request fixing cache management

This is sweet! Now I can dump my ghetto script that downloads an mp3 and casts to my chromecast. Gonna try this out right now. Nice job!

I’m sorry for the noob question, i searched but didn’t find the answer.
It is possible to have the same voice as the assistant?

Btw, just today i made some rules for Google home + IFTTT to ask for sensor’s state:awesome!

There are a lot of voices in lots of different languages to choose from. You can also select a number of different voices in the Google Home. I wouldn’t be surprised if at least some of them are the same in the voice API and in the Google Home.

thanks for the reply.
Here in Italy there’s still only one voice for the Assistant! And the closer one, the more similar, to choose in openHab it’s somewhat different. It would be cooler to have the exact same one (especially the default Assistant one, which i find the best).
Thanks anyway!