Platform Info: OpenHABian 4.2.1 / Raspbian Bullseye on Raspberry Pi 4 / 8 GB
I am using Google TTS (with prepaid account) for about half a year.
Ever since and throughout all OH updates I had the issue that the add-on is generally functional after configuration, but stops working with invalid credentials after two to five days.
The short-term solution is visiting my Google account, request a new auth code (and copy it from the address bar as described in the docs), save it in the GoogleTTS config and have it immediately working again. But only for a few days until this repeats.
I have read about such issues in the Git Repo, but found them marked as solved. In the forum, it seems that no such issues are currently actively reported.
What am I missing?
Thanks in advance!
By the way: In the store, the add-on title reads “Google Text-to-Speech” if it is not installed. After installation, it reads “Google Test-to-Speech” which is kind of funny but surely not intended
Well, I see your point in the sense of getting things just working and end the hassle of configuration. It’s a cool workaround, but IMHO not a real solution for the OH platform.
On limited resource platforms like a Raspberry, it would probably be hard to get it working reliably, if at all. My OH config is large and most of the time around 6 GB RAM is being used. So no trouble with OH alone, but yet another server?
Besides, if it runs on HA, there should not be any reason for which it would not run on OH. Especially if it is an official binding which gives the illusion of being stable.
Which brings me to the question how it is possible that this issue seems be existing for years, several people being annoyed about it - and no fix was done over all that time? And what could be done?
Yes it is known issue for some time and there are several topics on that.
For example:
I don’t think HA uses Google TTS login since I don’t remember giving authorization. I think it is some kind of built in feature in the HA (but I don’t guarantee this).
Interesting… At least the high-quality voices are paid services - really not much, but paid. Anyhow, I would doubt that these are available to HA without a Google account.
But anyway, HA is open source, OH is open source. And although I personally have no experience with Auth APIs, I am pretty sure that Google does not require black magic to make their API work.
So still, no serious reason in sight which would make it impossible to work in OH.
Question is, who has some knowledge / experience with the Google TTS plugin, and what would be a nice and decent way to make it functional
Most important first: If you use the most recent Google TTS binding and set the configuration up with the current manual, you actually should end up right with a flawlessly working TTS.
For the issue described, this part of the manual is crucial:
Go to OAuth consent screen (link (opens new window)) and set the publishing status to production to activate the created project.
In my case, it was NOT set to production. This, and only this, was the root cause of my issues.
Now, it gets more interesting: Why did it take me roughly one year finding out that such a simple thing which is already part of the docs is the solution? And why are there seemingly many more affected by this?
There are three answers:
The important part mentioned above only found its way into the manual about one year ago. Checking GIT Blame, I found that I did my configuration just a few days before this crucial update. Argh. Murphy. But good to know that it works right now.
There is no real / searchable clue that missing this setting does not lead to an unfunctional binding (which would be easy to debug), but instead works at first and then has totally erratic outages which can still be fixed by manually renewing the token (which feels totally like a bug in the binding).
Some not-so-straight-forward hints can be found in older threads actually, but this is for OH 3.x or older, and in the logs for GoogleTTS it can be seen that much has changed in the binding ever since, including auth bugs. So easy to falsely assume that these threads are outdated.
So, to make it searchable in the forum:
If you are using OH 4.x (4.2.1 in my case)
If you have OAuth issues in the GoogleTTS binding, losing authentication every few days (usually 2 to 5), but you can renew it manually
If you see [WARN ] [core.voice.internal.VoiceManagerImpl] - Error saying ' ... ': No TTS service can be found for voice googletts:deDEStandardE in the logs whenever you want to generate voice output after the token has expired
Then you should consider checking if especially the setting mentioned above says “production”.
Special thanks to @lsiepel and @wborn for the good discussions and support in the GIT issue!