openHAB can now use Amazon Echo devices to speak any text (TTS) - new feature in the amazonechocontrol binding

echo
tts
alexa
Tags: #<Tag:0x00007f51e4581fa0> #<Tag:0x00007f51e4581be0> #<Tag:0x00007f51e45815a0>

(Kris K) #23

Thanks! That seems to work :slight_smile:


(Mr. Wiseman) #24

Only issue I’m experiencing with calling multiple Echos as a group is; if I call the group back to back (even with 10 seconds between the calls); the binding blows up. Tried it numerous times.

Maybe calling 11 Echo’s is a bit too much?

2019-01-25 15:51:13.224 [ERROR] [nal.common.AbstractInvocationHandler] - An error occurred while calling method 'ThingHandler.handleCommand()' on 'org.openhab.binding.amazonechocontrol.internal.handler.EchoHandler@74624bf8': POST url 'https://alexa.amazon.com/api/behaviors/preview' failed: Bad Request
org.openhab.binding.amazonechocontrol.internal.HttpException: POST url 'https://alexa.amazon.com/api/behaviors/preview' failed: Bad Request
	at org.openhab.binding.amazonechocontrol.internal.Connection.makeRequest(Connection.java:586) [187:org.openhab.binding.amazonechocontrol:2.5.0.Beta_03]
	at org.openhab.binding.amazonechocontrol.internal.Connection.executeSequenceNode(Connection.java:1124) [187:org.openhab.binding.amazonechocontrol:2.5.0.Beta_03]
	at org.openhab.binding.amazonechocontrol.internal.Connection.executeSequenceNodes(Connection.java:1133) [187:org.openhab.binding.amazonechocontrol:2.5.0.Beta_03]
	at org.openhab.binding.amazonechocontrol.internal.Connection.executeSequenceCommandWithVolume(Connection.java:1097) [187:org.openhab.binding.amazonechocontrol:2.5.0.Beta_03]
	at org.openhab.binding.amazonechocontrol.internal.Connection.textToSpeech(Connection.java:1073) [187:org.openhab.binding.amazonechocontrol:2.5.0.Beta_03]
	at org.openhab.binding.amazonechocontrol.internal.handler.EchoHandler.startTextToSpeech(EchoHandler.java:717) [187:org.openhab.binding.amazonechocontrol:2.5.0.Beta_03]
	at org.openhab.binding.amazonechocontrol.internal.handler.EchoHandler.handleCommand(EchoHandler.java:600) [187:org.openhab.binding.amazonechocontrol:2.5.0.Beta_03]
	at sun.reflect.GeneratedMethodAccessor167.invoke(Unknown Source) ~[?:?]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:?]
	at org.eclipse.smarthome.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:153) [99:org.eclipse.smarthome.core:0.10.0.201805151356]
	at org.eclipse.smarthome.core.internal.common.InvocationHandlerSync.invoke(InvocationHandlerSync.java:59) [99:org.eclipse.smarthome.core:0.10.0.201805151356]
	at com.sun.proxy.$Proxy210.handleCommand(Unknown Source) [187:org.openhab.binding.amazonechocontrol:2.5.0.Beta_03]
	at org.eclipse.smarthome.core.thing.internal.profiles.ProfileCallbackImpl.handleCommand(ProfileCallbackImpl.java:75) [106:org.eclipse.smarthome.core.thing:0.10.0.201805151356]
	at org.eclipse.smarthome.core.thing.internal.profiles.SystemDefaultProfile.onCommandFromItem(SystemDefaultProfile.java:49) [106:org.eclipse.smarthome.core.thing:0.10.0.201805151356]
	at sun.reflect.GeneratedMethodAccessor166.invoke(Unknown Source) ~[?:?]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:?]
	at org.eclipse.smarthome.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:153) [99:org.eclipse.smarthome.core:0.10.0.201805151356]
	at org.eclipse.smarthome.core.internal.common.Invocation.call(Invocation.java:53) [99:org.eclipse.smarthome.core:0.10.0.201805151356]
	at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:?]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:?]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:?]
	at java.lang.Thread.run(Thread.java:748) [?:?]

Best, Jay


(xdxoxkx) #25

Works great with a single echo. The group also works, but the voice output is not syncronous - or is there a solution that the speakers really all talk at the same time?

Question:
Thing echo works on ECHO und ECHOSHOW.
Thing echoshow doesnt work at all … or do I have to change anything else (in the items for example)?


(Michael Geramb) #26

No, please take a look in this posting
for more details.

No, the only difference is the type, please check your thing file again, maybe the serial is wrong. Do you see the thing in PaperUI?
You can also try to use the echo thing for echo show devices, currently is no difference, but this may change in the future.


(xdxoxkx) #27

Now it is working with an an “EchoShow”-item

I changed in the amazonechocontrol.items the channel definition from …

{channel="amazonechocontrol:echo:account1:echo_sz:textToSpeech"}

to

{channel="amazonechocontrol:echoshow:account1:echo_sz:textToSpeech"}

For me this part is missing in the full example here:

However, thx for your help.


(Jürgen Baginski) #28

The examples given in the document are ALL from a single Echo thing. You missed to read:

Sample for the Thing echo1 only. But it will work in the same way for the other things, only replace the thing name in the channel link.

After defining a thing (with a .things file or via PaperUI) you can copy the correct channel Syntax from PaperUI!


(xdxoxkx) #29

Maybe reading was the problem …

In the documentation:
"Sample for the Thing echo1 only. But it will work in the same way for the other things, only replace the thing name in the channel link. "

Only the thing name?
No - that was the problem - you have to change thing name AND the thing type.

However, my note what just a suggestion to make it easier for other users.


(John Riker) #30

Do we know if this works with the Sonos ONE with built in Alexa? My understanding Sonos only has limited Alexa API support and some things don’t work in general.

Thanks.

JR


(idan) #31

Thank you for the hard work
after spending a lot of time, i found this post and finally manage to get alexa to speak for me :slight_smile:


(Justin B) #32

I don’t have a SONOSONE to test, but I do have a BEAM that I got working.
This is what I did it to get it working.

  1. Go to the http://openhab:8080/amazonechocontrol/
  2. Get the serial number for the sonos enabled Alexa you want to setup.
  3. Go in PAPERUI and then INBOX, click the big + sign, Select AMAZON ECHO CONTROL BINDING. Click ADD MANUALLY. click on AMAZON ECHO. Select your Bridge then paste in the Serial Number.

Your mannually added Alexa enabled Sonos’s name will be shorter then the rest, but mine still worked. After that you just have to create the items like below and make/call it a rule.

String 		Echo_TV_Room_TTS				"TV Room Text to Speech [%s]"			(gTVRoom_EchoDot)		{channel="amazonechocontrol:echo:AlexaTVRoom:textToSpeech"}
Dimmer 		Echo_TV_Room_TTS_Volume			"TV RoomText to Speech Volume [%s]"		(gTVRoom_EchoDot) 		{channel="amazonechocontrol:echo:AlexaTVRoom:textToSpeechVolume"}

Hopefully this helps!