Google TTS addon for OH2


I found some spare time and tried to implement a Google TTS addon for OH 2. Something similar had been available for openhab 1 already but never was ported until now.

I opened a pull request on Github, the ci-built jar can be downloaded here.

It’s working fine for me, if you find this interesting and give it a try I’d be curious to hear how it went.


Working for me to with a squeezebox as audio sink.
thx !!

Great. Thanks for reporting back.

Hi André,

I tested this service with Kodi as audio sink and it works very well for me. I’m surprised of the speed especially for cached text / phrases / sentences. Do you have any long-term experience with the size of the googletts/cache/ folder?

One thing I noticed: When you are using different TTS services with several voices you see a very confusing list in e.g. Paper UI or the console (see attached examples). But this is more a problem of the framework not of your implementation - I’ll take care of that.


openhab> voice voices
googletts:hi GoogleTTS - Hindi
googletts:esUS GoogleTTS - Spanisch (Vereinigte Staaten von Amerika)
googletts:zh GoogleTTS - Chinesisch
googletts:fr GoogleTTS - Französisch
googletts:es GoogleTTS - Spanisch
googletts:ro GoogleTTS - Rumänisch
googletts:no GoogleTTS - Norwegisch
googletts:ko GoogleTTS - Koreanisch
googletts:vi GoogleTTS - Vietnamesisch
googletts:sv GoogleTTS - Schwedisch
googletts:hu GoogleTTS - Ungarisch
googletts:enUS GoogleTTS - Englisch (Vereinigte Staaten von Amerika)
googletts:sq GoogleTTS - Albanisch
googletts:ru GoogleTTS - Russisch
googletts:af GoogleTTS - Afrikaans
googletts:zhTW GoogleTTS - Chinesisch (Taiwan)
googletts:el GoogleTTS - Griechisch
googletts:mk GoogleTTS - Mazedonisch
googletts:nl GoogleTTS - Niederländisch
googletts:enUK GoogleTTS - Englisch (UK)
googletts:sw GoogleTTS - Suaheli
googletts:sk GoogleTTS - Slowakisch
marytts:bits3hsmm bits3-hsmm - Deutsch
googletts:it GoogleTTS - Italienisch
googletts:pt GoogleTTS - Portugiesisch
googletts:cs GoogleTTS - Tschechisch
googletts:ca GoogleTTS - Katalanisch
googletts:sr GoogleTTS - Serbisch
googletts:uk GoogleTTS - Ukrainisch
googletts:ta GoogleTTS - Tamilisch
marytts:bits1hsmm bits1-hsmm - Deutsch
googletts:fi GoogleTTS - Finnisch
googletts:eo GoogleTTS - Esperanto
googletts:da GoogleTTS - Dänisch
googletts:tr GoogleTTS - Türkisch
marytts:cmuslthsmm cmu-slt-hsmm - Englisch (Vereinigte Staaten von Amerika)
googletts:id GoogleTTS - Indonesisch
googletts:la GoogleTTS - Lateinisch
googletts:lv GoogleTTS - Lettisch
googletts:enAU GoogleTTS - Englisch (Australien)
googletts:pl GoogleTTS - Polnisch
googletts:zhCN GoogleTTS - Chinesisch (China)
googletts:hy GoogleTTS - Armenisch
googletts:ja GoogleTTS - Japanisch
googletts:is GoogleTTS - Isländisch
googletts:en GoogleTTS - Englisch
googletts:hr GoogleTTS - Kroatisch
googletts:th GoogleTTS - Thai
googletts:cy GoogleTTS - Walisisch
googletts:ptBR GoogleTTS - Portugiesisch (Brasilien)
googletts:ar GoogleTTS - Arabisch
googletts:bn GoogleTTS - Bengalisch
googletts:esES GoogleTTS - Spanisch (Spanien)
googletts:de GoogleTTS - Deutsch

Paper UI:

Hey @aduffeck,

I have an issue with running your Add-on with the latest snapshot OH2 release:

openhab> bundle:list | grep Google
 17 │ Active    │  80 │ 18.0.0                 │ Guava: Google Core Libraries for Java
 18 │ Active    │  80 │ 3.0.0.v201312141243    │ Google Guice (No AOP)
 87 │ Installed │  80 │     │ Google TTS Voice Service
250 │ Active    │  80 │    │ openHAB Google Calendar
openhab> bundle:start 87
Error executing command: Error executing command on bundles:
        Error starting bundle 87: Could not resolve module: org.openhab.voice.googletts [87]
  Unresolved requirement: Import-Package: org.eclipse.jdt.annotation; resolution:="optional"
  Unresolved requirement: Import-Package: org.eclipse.jetty.util; version="9.3.22"

Any idea how to move forward?


1 Like


Did you see the new Google voice service that was just released with better voices?


@kubawolanin @KidSquid Yes, I’ve seen the new Google TTS API. When I submitted this addon there only was the unofficial, undocumented Google Translate API that could do TTS. With the release of the official API it is no longer justifiable to misuse the translate service for this purpose, so I will have to retract my submission until I or someone else finds the time to port it to the new API. Unfortunately I’m very busy these days so I won’t make it anytime soon…

If someone’s willing to create a Google Cloud TTS voice add-on, I believe you can use Polly TTS (developed by @hillmanr) as a template:

Good luck!


Did you have found a solution for that. I’ve just upgraded from snapshot 2.2.0 to 2.3.0 and the Google TTS stopped working with the same issue. But it is so much better then VoiceRSS.

1 Like

even im facing the issue after upgrading, can some one fix it

I’ve created a service implementation that uses the new Google Cloud TTS API. I’ve been using it for a week now without any problems but it would be good to here your feedback as well to improve the solution.

The pull request can be found here, the binary can be downloaded from here and this is the documentation for setup.

1 Like


This is exciting…thank you for taking the time to work on this.

I’ll test this weekend and report back my findings.



FYI - The link you have above for the binary returns a 404 error, I have found the following link on the GitHub page.

Download JAR File Here

Does this require 2.4 or will it work on previous OH 2.x versions?

Thanks Again,


Sorry, I’ve fixed the link. The jar version is 2.4 but I’ve tested it on 2.3

I get an error when adding json file in PaperUI-voice-google_tts settings.

2018-07-13 20:23:24.856 [ERROR] [b.voice.gtts.internal.GoogleCloudAPI] - Error initializing the service using /var/lib/openhab2/gtts/Google Assistant SDK-83f3efb18d22.json

java.lang.IllegalStateException: Could not find TLS ALPN provider; no working netty-tcnative, Conscrypt, or Jetty NPN/ALPN available

	at [271:org.openhab.voice.gtts:]

	at [271:org.openhab.voice.gtts:]

	at [271:org.openhab.voice.gtts:]

	at$NettyTransportFactory$DefaultNettyTransportCreationParamsFilterFactory.<init>( [271:org.openhab.voice.gtts:]

	at$NettyTransportFactory$DefaultNettyTransportCreationParamsFilterFactory.<init>( [271:org.openhab.voice.gtts:]

	at$NettyTransportFactory.<init>( [271:org.openhab.voice.gtts:]

	at [271:org.openhab.voice.gtts:]

	at [271:org.openhab.voice.gtts:]

	at [271:org.openhab.voice.gtts:]

	at [271:org.openhab.voice.gtts:]

	at [271:org.openhab.voice.gtts:]

	at [271:org.openhab.voice.gtts:]

	at [271:org.openhab.voice.gtts:]

	at [271:org.openhab.voice.gtts:]

	at<init>( [271:org.openhab.voice.gtts:]

	at [271:org.openhab.voice.gtts:]

	at org.openhab.voice.gtts.internal.GoogleCloudAPI.setConfig( [271:org.openhab.voice.gtts:]

	at org.openhab.voice.gtts.internal.GoogleTTSService.updateConfig( [271:org.openhab.voice.gtts:]

	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]

	at sun.reflect.NativeMethodAccessorImpl.invoke( ~[?:?]

	at sun.reflect.DelegatingMethodAccessorImpl.invoke( ~[?:?]

	at java.lang.reflect.Method.invoke( ~[?:?]

	at org.apache.felix.scr.impl.inject.BaseMethod.invokeMethod( [32:org.apache.felix.scr:2.0.12]

	at org.apache.felix.scr.impl.inject.BaseMethod.access$500( [32:org.apache.felix.scr:2.0.12]

	at org.apache.felix.scr.impl.inject.BaseMethod$Resolved.invoke( [32:org.apache.felix.scr:2.0.12]

	at org.apache.felix.scr.impl.inject.BaseMethod.invoke( [32:org.apache.felix.scr:2.0.12]

	at org.apache.felix.scr.impl.inject.ActivateMethod.invoke( [32:org.apache.felix.scr:2.0.12]

	at org.apache.felix.scr.impl.inject.ActivateMethod.invoke( [32:org.apache.felix.scr:2.0.12]

	at org.apache.felix.scr.impl.manager.SingleComponentManager.invokeModifiedMethod( [32:org.apache.felix.scr:2.0.12]

	at org.apache.felix.scr.impl.manager.SingleComponentManager.modify( [32:org.apache.felix.scr:2.0.12]

	at org.apache.felix.scr.impl.manager.SingleComponentManager.reconfigure( [32:org.apache.felix.scr:2.0.12]

	at org.apache.felix.scr.impl.manager.SingleComponentManager.reconfigure( [32:org.apache.felix.scr:2.0.12]

	at org.apache.felix.scr.impl.manager.ConfigurableComponentHolder.configurationUpdated( [32:org.apache.felix.scr:2.0.12]

	at org.apache.felix.scr.impl.manager.RegionConfigurationSupport.configurationEvent( [32:org.apache.felix.scr:2.0.12]

	at org.apache.felix.scr.impl.manager.RegionConfigurationSupport$1.configurationEvent( [32:org.apache.felix.scr:2.0.12]

	at$FireConfigurationEvent.sendEvent( [8:org.apache.felix.configadmin:1.8.16]

	at$ [8:org.apache.felix.configadmin:1.8.16]

	at [8:org.apache.felix.configadmin:1.8.16]

	at [8:org.apache.felix.configadmin:1.8.16]

	at [?:?]

@sjef86 what OH version are you using? JDK?


I’m running openHAB 2.4.0 Build #1310 on a raspberry pi3 (openhabian)…

[20:43:58] openhabian@openHABianPi:~$ java -version
java version "1.8.0_171"
Java(TM) SE Runtime Environment (build 1.8.0_171-b11)
Java HotSpot(TM) Client VM (build 25.171-b11, mixed mode)


Thanks for working on it! Was hoping it would be available!

@sjef86 Thank you for testing! It is very strange, because I just tried the 2.4.0-SNAPSHOT version, and it works fine. The difference is that I’m using the official docker image which is build #1305 and java 1.8.0_144…

@sjef86 It seems that GoogleCloudPlatform / gRPC doesn’t support Raspberry Pi. Check Supported Platforms. This is the same issue that you have…