Google TTS addon for OH2

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!

sorry, i am a liitle bit confused

  1. are we speaking about this add on ?

  1. it’s not supported on raspberry. Please correct me i am wrong

tHANKS

I don’t believe that @gbicskei has merged his version of the plugin, but I could be wrong. You can download the JAR file from a link in my post above.

That is correct, here is a link to the supported platforms

1 Like

I’ve created a PR to remove the native dependencies so the Google TTS addon can be used on any platform :slight_smile: :
https://github.com/openhab/openhab2-addons/pull/4221

If you want to help out testing, here’s a org.openhab.voice.googletts-2.4.0-SNAPSHOT.jar containing the changes.

2 Likes

That’s very cool. Will this require any extra maintenance on the developer side if Google updates the API?

Squid

Yes that’s the only downside. But it’s a relatively simple API. If they change the API we might also need to upgrade the library and maybe change how we use it. :wink: So in the end I think it’s worth it also because the bundle size got reduced by 10 MB.

@wborn, thanks i have downloaded the addon but i am still still seeing this error in the log

2018-11-15 10:27:48.714 [INFO ] [.googletts.internal.GoogleTTSService] - Using home folder: /var/lib/openhab2/googletts
2018-11-15 10:27:48.718 [INFO ] [.googletts.internal.GoogleTTSService] - Using cache folder /var/lib/openhab2/cache/org.openhab.voice.googletts
2018-11-15 10:27:48.721 [ERROR] [ce.googletts.internal.GoogleCloudAPI] - The architecture is not x86_64 but ARM_32. Only x86_64 platforms are supported.

Looks like you’re still using the old version because I completely removed the code that checks the architecture. :wink: I think you can fix it by removing the JAR from the addons dir, uninstalling the Google TTS addon using Paper UI and then adding the JAR to the addons dir again.

1 Like

Hi!
So I hope I don’t get slapped in the face now but:
Is the RPi still not supported? Or have you removed the architecture checks because it is now supported?
I have installed the latest jar on 2.3 stable but get an error when it tries to get the voice list from Google.

Thank you so much for your help and coding :slight_smile:

can you post the error?
I don’t use it on rPi but I recently installed it on my Debian Jessie and maybe I can help to debug

1 Like

Thank you so much! Here is the error:
Seems like it can’t place the http request because of some stuff missing…
My credentials are all set.

2018-11-19 11:09:48.775 [ERROR] [org.openhab.voice.googletts         ] - [org.openhab.voice.googletts.internal.GoogleTTSService(312)] The updateConfig method has thrown an exception
java.lang.NoClassDefFoundError: org/eclipse/smarthome/io/net/http/HttpRequestBuilder
        at org.openhab.voice.googletts.internal.GoogleCloudAPI.listVoices(GoogleCloudAPI.java:232) ~[?:?]
        at org.openhab.voice.googletts.internal.GoogleCloudAPI.initVoices(GoogleCloudAPI.java:215) ~[?:?]
        at org.openhab.voice.googletts.internal.GoogleCloudAPI.setConfig(GoogleCloudAPI.java:140) ~[?:?]
        at org.openhab.voice.googletts.internal.GoogleTTSService.updateConfig(GoogleTTSService.java:220) ~[?:?]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
        at java.lang.reflect.Method.invoke(Method.java:498) ~[?:?]
        at org.apache.felix.scr.impl.inject.BaseMethod.invokeMethod(BaseMethod.java:229) ~[39:org.apache.felix.scr:2.0.12]
        at org.apache.felix.scr.impl.inject.BaseMethod.access$500(BaseMethod.java:39) ~[39:org.apache.felix.scr:2.0.12]
        at org.apache.felix.scr.impl.inject.BaseMethod$Resolved.invoke(BaseMethod.java:650) ~[39:org.apache.felix.scr:2.0.12]
        at org.apache.felix.scr.impl.inject.BaseMethod.invoke(BaseMethod.java:506) [39:org.apache.felix.scr:2.0.12]
        at org.apache.felix.scr.impl.inject.ActivateMethod.invoke(ActivateMethod.java:307) [39:org.apache.felix.scr:2.0.12]
        at org.apache.felix.scr.impl.inject.ActivateMethod.invoke(ActivateMethod.java:299) [39:org.apache.felix.scr:2.0.12]
        at org.apache.felix.scr.impl.manager.SingleComponentManager.invokeModifiedMethod(SingleComponentManager.java:772) [39:org.apache.felix.scr:2.0.12]
        at org.apache.felix.scr.impl.manager.SingleComponentManager.modify(SingleComponentManager.java:727) [39:org.apache.felix.scr:2.0.12]
        at org.apache.felix.scr.impl.manager.SingleComponentManager.reconfigure(SingleComponentManager.java:645) [39:org.apache.felix.scr:2.0.12]
        at org.apache.felix.scr.impl.manager.SingleComponentManager.reconfigure(SingleComponentManager.java:609) [39:org.apache.felix.scr:2.0.12]
        at org.apache.felix.scr.impl.manager.ConfigurableComponentHolder.configurationUpdated(ConfigurableComponentHolder.java:426) [39:org.apache.felix.scr:2.0.12]
        at org.apache.felix.scr.impl.manager.RegionConfigurationSupport.configurationEvent(RegionConfigurationSupport.java:284) [39:org.apache.felix.scr:2.0.12]
        at org.apache.felix.scr.impl.manager.RegionConfigurationSupport$1.configurationEvent(RegionConfigurationSupport.java:89) [39:org.apache.felix.scr:2.0.12]
        at org.apache.felix.cm.impl.ConfigurationManager$FireConfigurationEvent.sendEvent(ConfigurationManager.java:2090) [8:org.apache.felix.configadmin:1.8.16]
        at org.apache.felix.cm.impl.ConfigurationManager$FireConfigurationEvent.run(ConfigurationManager.java:2058) [8:org.apache.felix.configadmin:1.8.16]
        at org.apache.felix.cm.impl.UpdateThread.run0(UpdateThread.java:141) [8:org.apache.felix.configadmin:1.8.16]
        at org.apache.felix.cm.impl.UpdateThread.run(UpdateThread.java:109) [8:org.apache.felix.configadmin:1.8.16]
        at java.lang.Thread.run(Thread.java:748) [?:?]

hmmm… I am worried that you may have to upgrade to OH 2.4.0 Snapshot to use the testing jar from here: Google TTS addon for OH2 - #63 by wborn

Can you try that?

Hi!
Unfortunately not, I’m on stable 2.3 and didn’t want to upgrade yet.
But probably that’s the issue so I’ll just leave the google tts aside until I upgrade!

Thank you so much for taking time to have a look!

1 Like

That explains because it depends on the HttpRequestBuilder for creating HTTP requests. The HttpRequestBuilder is only available in 2.4.0-SNAPSHOT. So upgrading to a recent milestone or SNAPSHOT should solve it.

2 Likes

I try install GoogleTTS Addon without platform dependencies and show this errors:

2018-11-25 16:22:11.660 [ERROR] [org.openhab.voice.googletts         ] - bundle org.openhab.voice.googletts:2.4.0.201811120148 (279)[org.openhab.voice.googletts.internal.GoogleTTSService(28)] : The activate method has thrown an exception

    java.lang.NullPointerException: null
    2018-11-25 16:22:11.699 [WARN ] [org.openhab.voice.googletts         ] - FrameworkEvent WARNING - org.openhab.voice.googletts

    org.osgi.framework.ServiceException: org.apache.felix.scr.impl.manager.SingleComponentManager.getService() returned a null service object

Thanks for help
I have: openHAB 2.4.0~20181119183855-1

did you use the testing jar in your addons folder and uninstalled the one from PaperUI?

Please post full logging and stack traces so we can see when and what code throws the NullPointerException.

Yes, i uninstall Google TTS from PaperUI and install this addon https://github.com/wborn/openhab2-addons/releases/download/googletts-remove-native-dependencies/org.openhab.voice.googletts-2.4.0-SNAPSHOT.jar