For those interested in keeping use of google tts engine, which I personally prefer to all others (better voice and I like support for multiple languages):
I wrote a different version of googletts action 2 years ago, never bothered to publish it till now.
It differs from the one in the official repository, mainly in caching function and ability to invoke it each time with language given as parameter (if desired).
I added the caching to files for two reasons:
- Reduce load on google API - for most people tts text is not dynamic and can be saved to mp3 and repeated from cache. The less abuse we put on the API - less reason for Google to keep restricting free use of it
- Playing previously recorded files from cache obviously works faster than sending it to API each time
It would be probably good to merge the functionality with the one already in the repository, but I won’t get to it soon.
- Action bundle can be obtained here - drop it into addons folder as always
- Configuration in openhab.cfg
Both settings may be optional. Defaults will be used as above if not configured.
With cache enabled, mp3 files will be saved in etc\googletts folder for re-use.
When cache is set to false, API will be called each time.
- Use in rules (note the difference - since I implemented it as a separate action back then, it does not use “say”, but “voice” instead):
voice(“Front door opened”)
voice(“Front door opened”,“en”)
voice(“Входная дверь открыта”,“ru”)
Might contain bugs, even though I was running it for 2 years without any issues (did not even notice Google changed restrictions to API again until recently, since most of my voice notifications were playing from cache already anyway).