No because the way OH communicates with devices is through commands to Items. If you don’t have a single Item that represents all those settings, you have to send separate commands to each Item individually.
However, Amazon Echo Control - Bindings | openHAB talks about a proxy to the Alexa API so maybe you can use sendHttpXRequest actions to interact with the API directly instead of through the Items.
Maybe I’m doing something wrong.
Maybe the Amazon API and the OH documentation are no longer in sync.
I can’t use a json formatted string to control sound and volume in a single command.
I have an Echo Dot 4 with clock.
What’s working here is:
The combination of sound=true and speak in SSML syntax is not allowed. Not all properties need to be specified. The value for volume can be between 0 and 100 to set the volume. A volume value smaller then 0 means that the current alexa volume should be used. No specification uses the volume from the textToSpeechVolume channel.
Note that this is a command to be sent to the item linked to the announcement channel, not the TTS channel.
This is new to me too, so thanks for the question!
I am still looking for a local TTS engine that sounds as nice as Amazon’s or Google’s. If there’s one, we can play it on an audio sink like google home.
Amazon Polly (Echo) sounds nice but it has a bit of a delay.
I had a look around and found that there’s already one supported by openhab: PiperTTS. I like “English (US)” “hfc_female” voice, so I downloaded the onnx file. A brief test shows that it works very well and the voice is quite nice, i.e. not robotic.
Once set up, to make it work (using JRuby)
Voice.say "Hello, World!", volume: 100 # plays to the default sink
Voice.say "Hello, World!", sink: LivingRoom_GH_Player.thing.uid, volume: 100
I had a look in the openhab amazonecho binding code. This json syntax is a made up syntax by the binding, so it’s very much specific to openhab only. Amazon doesn’t know anything about it.
The binding absolutely splits it into a separate sets of commands. So it’s a matter of inserting a delay.
The echo binding is currently undergoing a merge from smarthome/j. Once that’s merged, I want to add an extra parameter or setting to specify a custom delay between volume setting and announcement, if that’s possible.