OpenHAB 3 Google TTS

Hi, re posting my issue as previous got deleted it seems…

I’m running Openhab in docker, version openhab/openhab:3.1.0-snapshot-debian.
I have Google TTS , bundle 3.1.0.202102070347 in active state.

I followed the instructions to configure oAuth for GoogleTTS which resulted with the following log entries:

2021-02-08 20:02:36.335 [DEBUG] [.googletts.internal.GoogleTTSService] - Updating configuration
2021-02-08 20:02:36.337 [DEBUG] [ce.googletts.internal.GoogleCloudAPI] - Trying to get access and refresh tokens.
2021-02-08 20:02:36.869 [WARN ] [.googletts.internal.GoogleTTSService] - Audio format OGG_OPUS is not yet supported.
2021-02-08 20:02:36.873 [DEBUG] [.googletts.internal.GoogleTTSService] - Updating configuration
2021-02-08 20:02:36.944 [WARN ] [.googletts.internal.GoogleTTSService] - Audio format OGG_OPUS is not yet supported.

In UI , the Default Voice section is empty, e.g no GoogleTTS voice listed.

Any commands that require TTS results in the following error:

java.util.NoSuchElementException: null
        at java.util.ArrayList$Itr.next(ArrayList.java:1000) ~[?:?]
        at org.openhab.core.voice.internal.VoiceManagerImpl.getPreferredVoice(VoiceManagerImpl.java:440) ~[?:?]
        at org.openhab.core.voice.internal.VoiceConsoleCommandExtension.getDefaultVoice(VoiceConsoleCommandExtension.java:115) ~[?:?]
        at org.openhab.core.voice.internal.VoiceConsoleCommandExtension.execute(VoiceConsoleCommandExtension.java:92) ~[?:?]
        at org.openhab.core.io.console.ConsoleInterpreter.execute(ConsoleInterpreter.java:55) [bundleFile:?]
        at org.openhab.core.io.console.karaf.internal.CommandWrapper.execute(CommandWrapper.java:78) [bundleFile:?]
        at org.apache.karaf.shell.impl.console.osgi.secured.SecuredCommand.execute(SecuredCommand.java:68) [bundleFile:4.2.7]
        at org.apache.karaf.shell.impl.console.osgi.secured.SecuredCommand.execute(SecuredCommand.java:86) [bundleFile:4.2.7]
        at org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:599) [bundleFile:4.2.7]
        at org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:526) [bundleFile:4.2.7]
        at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:415) [bundleFile:4.2.7]
        at org.apache.felix.gogo.runtime.Pipe.doCall(Pipe.java:416) [bundleFile:4.2.7]
        at org.apache.felix.gogo.runtime.Pipe.call(Pipe.java:229) [bundleFile:4.2.7]
        at org.apache.felix.gogo.runtime.Pipe.call(Pipe.java:59) [bundleFile:4.2.7]
        at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
        at java.lang.Thread.run(Thread.java:834) [?:?]

@tnemrap , in my previous post , you mentioned i did not succeed with the auth and code. How can i debug it? What should I look for?

Thank you for your time and help!!!
Yuly

Set the logging level to TRACE and got the following:

2021-02-08 20:15:34.524 [DEBUG] [.googletts.internal.GoogleTTSService] - Updating configuration
2021-02-08 20:15:34.525 [TRACE] [.googletts.internal.GoogleTTSService] - New configuration: GoogleTTSConfig{pitch=0.0, speakingRate=1.0, volumeGainDb=0.0, purgeCache=false}
2021-02-08 20:15:34.526 [DEBUG] [ce.googletts.internal.GoogleCloudAPI] - Trying to get access and refresh tokens.
2021-02-08 20:15:34.956 [TRACE] [.googletts.internal.GoogleTTSService] - Initializing voices
2021-02-08 20:15:34.957 [TRACE] [.googletts.internal.GoogleTTSService] - Initializing audio formats
2021-02-08 20:15:34.958 [WARN ] [.googletts.internal.GoogleTTSService] - Audio format OGG_OPUS is not yet supported.
2021-02-08 20:15:34.958 [TRACE] [.googletts.internal.GoogleTTSService] - Audio format not supported: OGG_OPUS
2021-02-08 20:15:34.959 [TRACE] [.googletts.internal.GoogleTTSService] - Audio format supported: MP3
2021-02-08 20:15:34.960 [TRACE] [.googletts.internal.GoogleTTSService] - Audio format supported: LINEAR16
2021-02-08 20:15:34.963 [DEBUG] [.googletts.internal.GoogleTTSService] - Updating configuration
2021-02-08 20:15:34.964 [TRACE] [.googletts.internal.GoogleTTSService] - New configuration: GoogleTTSConfig{pitch=0.0, speakingRate=1.0, volumeGainDb=0.0, purgeCache=false}
2021-02-08 20:15:35.024 [TRACE] [.googletts.internal.GoogleTTSService] - Initializing voices
2021-02-08 20:15:35.025 [TRACE] [.googletts.internal.GoogleTTSService] - Initializing audio formats
2021-02-08 20:15:35.026 [WARN ] [.googletts.internal.GoogleTTSService] - Audio format OGG_OPUS is not yet supported.
2021-02-08 20:15:35.027 [TRACE] [.googletts.internal.GoogleTTSService] - Audio format not supported: OGG_OPUS
2021-02-08 20:15:35.028 [TRACE] [.googletts.internal.GoogleTTSService] - Audio format supported: MP3
2021-02-08 20:15:35.029 [TRACE] [.googletts.internal.GoogleTTSService] - Audio format supported: LINEAR16

Still no google tts voices present…

It looks in the log as you are connected ok.
Have you tried to restart?

Got it working! The problem was with google billing account which effectively disabled the google TTS api.

Sounds good. I am glad you got it working.

btw. I submitted an improvement for OHC which will avoid future NoSuchElementException like we can see in your op.

1 Like

I had the same exception, but for me except enabling billing, also regeneration and re-setting of “Authorization Code” was required in openHAB.