Pollytts voice service binding 2.2-snapshot is available in the marketplace.
PollyTTS is a TTS voice service for Openhab 2.x utilizing a Internet based TTS service provided by amazon called Polly. Polly includes multiple life like voices for a given languages. Can now select different voices within rules depending on the message context.
The free tier includes 5 million characters per month for the first 12 months. It looks like it’s $4 for a million characters after the one year. I plan to reevaluate using it after a year when and if the free tier ends for me.
This sounds very interesting to me, the voice quality seams quite good!
Is your TTS service caching? In this case, 5 milion characters seams endlessly much, at least in my set-up.
Yes it does cache, I used the code base from voicerss to get started so it functions in the same manner. I’m working on a first cut at use and configuration. Hope to be able to share it in a few days.
There’s not much actual code, to be honest. It was my first time playing around with the openHAB code, but it’s a start.
As I said in the comments, Ivona SpeechCloud has become Amazon Polly, so it would make sense to create an add-on for Polly directly (org.openhab.voice.polly). Both require AWS SDK to work.
Here is the info on how to use and download the snapshot of my implementation of the Amazon Polly voice service for openhab. It’s fully functional, supports all the voices and languages, a total of 47. I built it on the current 2.1 master but it runs on openhab 2.0 which I’m using.
In PaperUI (#/configuration/services) your add-on’s name is VoiceTTS instead of PollyTTS
First thing I did afer building the JAR was placing it to the /addons/ folder. NPE appeared in my log file due to the fact I didn’t put pollytts.cfg config file in /services/ folder
2017-06-10 09:32:01.428 [ERROR] [ce.pollytts.internal.PollyTTSService] - Failed to activate PollyTTS: Missing access key, configure it first before using
org.eclipse.smarthome.core.voice.TTSException: Missing access key, configure it first before using
at org.openhab.voice.pollytts.internal.cloudapi.PollyClientConfig.PollyInit(PollyClientConfig.java:68)
at org.openhab.voice.pollytts.internal.cloudapi.PollyClientConfig.<init>(PollyClientConfig.java:62)
at org.openhab.voice.pollytts.internal.PollyTTSService.activate(PollyTTSService.java:64)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[:1.8.0_131]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)[:1.8.0_131]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[:1.8.0_131]
at java.lang.reflect.Method.invoke(Method.java:498)[:1.8.0_131]
at org.apache.felix.scr.impl.inject.BaseMethod.invokeMethod(BaseMethod.java:224)
at org.apache.felix.scr.impl.inject.BaseMethod.access$500(BaseMethod.java:39)
at org.apache.felix.scr.impl.inject.BaseMethod$Resolved.invoke(BaseMethod.java:617)
at org.apache.felix.scr.impl.inject.BaseMethod.invoke(BaseMethod.java:501)
at org.apache.felix.scr.impl.inject.ActivateMethod.invoke(ActivateMethod.java:302)
at org.apache.felix.scr.impl.inject.ActivateMethod.invoke(ActivateMethod.java:294)
at org.apache.felix.scr.impl.manager.SingleComponentManager.createImplementationObject(SingleComponentManager.java:297)[40:org.apache.felix.scr:2.0.6]
at org.apache.felix.scr.impl.manager.SingleComponentManager.createComponent(SingleComponentManager.java:108)[40:org.apache.felix.scr:2.0.6]
at org.apache.felix.scr.impl.manager.SingleComponentManager.getService(SingleComponentManager.java:906)[40:org.apache.felix.scr:2.0.6]
at org.apache.felix.scr.impl.manager.SingleComponentManager.getServiceInternal(SingleComponentManager.java:879)[40:org.apache.felix.scr:2.0.6]
at org.apache.felix.scr.impl.manager.SingleComponentManager.getService(SingleComponentManager.java:823)[40:org.apache.felix.scr:2.0.6]
at org.eclipse.osgi.internal.serviceregistry.ServiceFactoryUse$1.run(ServiceFactoryUse.java:212)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
2017-06-10 09:34:02.126 [ERROR] [org.openhab.voice.pollytts ] - [org.openhab.pollytts(239)] modified method [modified] not found; Component will fail
2017-06-10 09:34:02.127 [ERROR] [org.openhab.voice.pollytts ] - [org.openhab.pollytts(239)] Declared modify method 'modified' cannot be found, configuring by reactivation
2017-06-10 09:34:05.350 [INFO ] [ce.pollytts.internal.PollyTTSService] - Using PollyTTS cache folder /var/lib/openhab2/pollytts/cache
2017-06-10 09:35:53.620 [ERROR] [org.openhab.voice.pollytts ] - [org.openhab.pollytts(239)] Declared modify method 'modified' cannot be found, configuring by reactivation
2017-06-10 09:35:54.219 [INFO ] [ce.pollytts.internal.PollyTTSService] - Using PollyTTS cache folder /var/lib/openhab2/pollytts/cache
Then I placed a proper config file with my credentials and it went all OK
I like the addon very much! Thank you for your work.
Weather_Condition
Weather_Temp // temperature
Some_Button
rule "Speak the weather"
when
Item Some_Button received command ON
then
var String weather = transform("MAP","weather_en.map", Weather_Condition.state.toString)
say("Today is " + weather + " and there's " + Weather_Temp.state + " degrees")
end
Great thanks!
I’m currently working with the PaperUI, so as I think its not possible to add rules/scripts like this. I need to add this as a file, right? Sorry for this “newbie” question - but it’s the 2nd day with OH2 But I’m loving it
@hillmanr may I suggest you to submit your work as a Pull Request with a [WIP] flag in the title already?
This way your addon will gain more visibility and more people would have access to it.
Hi,
Can you show your config file (obviously with your credentials scrambled)? I placed the JAR file in my addons-folder, and I am also getting the “Missing access key” error.