Problem with Amazon Echo Control Binding sending several TTS commands at the same time

I have generate a notification for forgotten open window and send TTS commands to all my Echo devices

it is working fine for one device, but if i put all of them i generates errors and it doesn’t work

your code goes here2019-01-26 17:17:06.653 [ome.event.ItemCommandEvent] - Item 'Echo_Emelie_Volume' received command 60

2019-01-26 17:17:06.670 [nt.ItemStatePredictedEvent] - Echo_Emelie_Volume predicted to become 60

2019-01-26 17:17:06.685 [ome.event.ItemCommandEvent] - Item 'Echo_Kueche_Volume' received command 60

2019-01-26 17:17:06.689 [ome.event.ItemCommandEvent] - Item 'Echo_Bad_Volume' received command 60

2019-01-26 17:17:06.694 [vent.ItemStateChangedEvent] - Echo_Emelie_Volume changed from 27 to 60

2019-01-26 17:17:06.697 [ome.event.ItemCommandEvent] - Item 'Echo_Garten_TTS_Volume' received command 60

2019-01-26 17:17:06.703 [ome.event.ItemCommandEvent] - Item 'Echo_Emelie_TTS' received command Sehr geehrte Bewohner, das Badezimmer Fenster ist noch offen bitte umgehend, schliessen   , danke

2019-01-26 17:17:06.705 [ome.event.ItemCommandEvent] - Item 'Echo_Kueche_TTS' received command Sehr geehrte Bewohner, das Badezimmer Fenster ist noch offen bitte umgehend, schliessen   , danke

2019-01-26 17:17:06.707 [nt.ItemStatePredictedEvent] - Echo_Kueche_Volume predicted to become 60

2019-01-26 17:17:06.710 [ome.event.ItemCommandEvent] - Item 'Echo_Bad_TTS' received command Sehr geehrte Bewohner, das Badezimmer Fenster ist noch offen bitte umgehend, schliessen   , danke

2019-01-26 17:17:06.714 [ome.event.ItemCommandEvent] - Item 'Echo_Garten_TTS' received command Sehr geehrte Bewohner, das Badezimmer Fenster ist noch offen bitte umgehend, schliessen   , danke

2019-01-26 17:17:06.716 [nt.ItemStatePredictedEvent] - Echo_Bad_Volume predicted to become 60

2019-01-26 17:17:06.719 [vent.ItemStateChangedEvent] - Echo_Kueche_Volume changed from 20 to 60

2019-01-26 17:17:06.721 [nt.ItemStatePredictedEvent] - Echo_Garten_TTS_Volume predicted to become NULL

2019-01-26 17:17:06.738 [nt.ItemStatePredictedEvent] - Echo_Emelie_TTS predicted to become Sehr geehrte Bewohner, das Badezimmer Fenster ist noch offen bitte umgehend, schliessen   , danke

2019-01-26 17:17:06.745 [nt.ItemStatePredictedEvent] - Echo_Kueche_TTS predicted to become Sehr geehrte Bewohner, das Badezimmer Fenster ist noch offen bitte umgehend, schliessen   , danke

2019-01-26 17:17:06.748 [vent.ItemStateChangedEvent] - Echo_Bad_Volume changed from 25 to 60

2019-01-26 17:17:06.751 [nt.ItemStatePredictedEvent] - Echo_Bad_TTS predicted to become Sehr geehrte Bewohner, das Badezimmer Fenster ist noch offen bitte umgehend, schliessen   , danke

2019-01-26 17:17:06.754 [vent.ItemStateChangedEvent] - Echo_Emelie_TTS changed from  to Sehr geehrte Bewohner, das Badezimmer Fenster ist noch offen bitte umgehend, schliessen   , danke

2019-01-26 17:17:06.756 [vent.ItemStateChangedEvent] - Echo_Kueche_TTS changed from  to Sehr geehrte Bewohner, das Badezimmer Fenster ist noch offen bitte umgehend, schliessen   , danke

2019-01-26 17:17:06.758 [nt.ItemStatePredictedEvent] - Echo_Garten_TTS predicted to become Sehr geehrte Bewohner, das Badezimmer Fenster ist noch offen bitte umgehend, schliessen   , danke

2019-01-26 17:17:06.761 [vent.ItemStateChangedEvent] - Echo_Bad_TTS changed from  to Sehr geehrte Bewohner, das Badezimmer Fenster ist noch offen bitte umgehend, schliessen   , danke

2019-01-26 17:17:06.763 [vent.ItemStateChangedEvent] - Echo_Garten_TTS changed from  to Sehr geehrte Bewohner, das Badezimmer Fenster ist noch offen bitte umgehend, schliessen   , danke

and here the Error

2019-01-26 17:17:07.481 [ERROR] [nal.common.AbstractInvocationHandler] - An error occurred while calling method 'ThingHandler.handleCommand()' on 'org.openhab.binding.amazonechocontrol.internal.handler.EchoHandler@177f55c': POST url 'https://alexa.amazon.de/api/behaviors/preview' failed: Bad Request

org.openhab.binding.amazonechocontrol.internal.HttpException: POST url 'https://alexa.amazon.de/api/behaviors/preview' failed: Bad Request

	at org.openhab.binding.amazonechocontrol.internal.Connection.makeRequest(Connection.java:549) ~[?:?]

	at org.openhab.binding.amazonechocontrol.internal.Connection.executeSequenceNode(Connection.java:1067) ~[?:?]

	at org.openhab.binding.amazonechocontrol.internal.Connection.executeSequenceCommand(Connection.java:1052) ~[?:?]

	at org.openhab.binding.amazonechocontrol.internal.Connection.textToSpeech(Connection.java:1043) ~[?:?]

	at org.openhab.binding.amazonechocontrol.internal.handler.EchoHandler.startTextToSpeech(EchoHandler.java:640) ~[?:?]

	at org.openhab.binding.amazonechocontrol.internal.handler.EchoHandler.handleCommand(EchoHandler.java:527) ~[?:?]

	at sun.reflect.GeneratedMethodAccessor98.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) [102:org.eclipse.smarthome.core:0.10.0.oh240]

	at org.eclipse.smarthome.core.internal.common.InvocationHandlerSync.invoke(InvocationHandlerSync.java:59) [102:org.eclipse.smarthome.core:0.10.0.oh240]

	at com.sun.proxy.$Proxy153.handleCommand(Unknown Source) [229:org.openhab.binding.amazonechocontrol:2.4.0]

	at org.eclipse.smarthome.core.thing.internal.profiles.ProfileCallbackImpl.handleCommand(ProfileCallbackImpl.java:75) [109:org.eclipse.smarthome.core.thing:0.10.0.oh240]

	at org.eclipse.smarthome.core.thing.internal.profiles.SystemDefaultProfile.onCommandFromItem(SystemDefaultProfile.java:49) [109:org.eclipse.smarthome.core.thing:0.10.0.oh240]

	at sun.reflect.GeneratedMethodAccessor97.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) [102:org.eclipse.smarthome.core:0.10.0.oh240]

	at org.eclipse.smarthome.core.internal.common.Invocation.call(Invocation.java:53) [102:org.eclipse.smarthome.core:0.10.0.oh240]

	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) [?:?]

2019-01-26 17:17:07.500 [ERROR] [nal.common.AbstractInvocationHandler] - An error occurred while calling method 'ThingHandler.handleCommand()' on 'org.openhab.binding.amazonechocontrol.internal.handler.EchoHandler@149717d': POST url 'https://alexa.amazon.de/api/behaviors/preview' failed: Bad Request

org.openhab.binding.amazonechocontrol.internal.HttpException: POST url 'https://alexa.amazon.de/api/behaviors/preview' failed: Bad Request

	at org.openhab.binding.amazonechocontrol.internal.Connection.makeRequest(Connection.java:549) ~[?:?]

	at org.openhab.binding.amazonechocontrol.internal.Connection.executeSequenceNode(Connection.java:1067) ~[?:?]

	at org.openhab.binding.amazonechocontrol.internal.Connection.executeSequenceCommand(Connection.java:1052) ~[?:?]

	at org.openhab.binding.amazonechocontrol.internal.Connection.textToSpeech(Connection.java:1043) ~[?:?]

	at org.openhab.binding.amazonechocontrol.internal.handler.EchoHandler.startTextToSpeech(EchoHandler.java:640) ~[?:?]

	at org.openhab.binding.amazonechocontrol.internal.handler.EchoHandler.handleCommand(EchoHandler.java:527) ~[?:?]

	at sun.reflect.GeneratedMethodAccessor98.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) [102:org.eclipse.smarthome.core:0.10.0.oh240]

	at org.eclipse.smarthome.core.internal.common.InvocationHandlerSync.invoke(InvocationHandlerSync.java:59) [102:org.eclipse.smarthome.core:0.10.0.oh240]

	at com.sun.proxy.$Proxy153.handleCommand(Unknown Source) [229:org.openhab.binding.amazonechocontrol:2.4.0]

	at org.eclipse.smarthome.core.thing.internal.profiles.ProfileCallbackImpl.handleCommand(ProfileCallbackImpl.java:75) [109:org.eclipse.smarthome.core.thing:0.10.0.oh240]

	at org.eclipse.smarthome.core.thing.internal.profiles.SystemDefaultProfile.onCommandFromItem(SystemDefaultProfile.java:49) [109:org.eclipse.smarthome.core.thing:0.10.0.oh240]

	at sun.reflect.GeneratedMethodAccessor97.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) [102:org.eclipse.smarthome.core:0.10.0.oh240]

	at org.eclipse.smarthome.core.internal.common.Invocation.call(Invocation.java:53) [102:org.eclipse.smarthome.core:0.10.0.oh240]

	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) [?:?]

2019-01-26 17:17:07.489 [ERROR] [nal.common.AbstractInvocationHandler] - An error occurred while calling method 'ThingHandler.handleCommand()' on 'org.openhab.binding.amazonechocontrol.internal.handler.EchoHandler@756fb6': POST url 'https://alexa.amazon.de/api/behaviors/preview' failed: Bad Request

org.openhab.binding.amazonechocontrol.internal.HttpException: POST url 'https://alexa.amazon.de/api/behaviors/preview' failed: Bad Request

	at org.openhab.binding.amazonechocontrol.internal.Connection.makeRequest(Connection.java:549) ~[?:?]

	at org.openhab.binding.amazonechocontrol.internal.Connection.executeSequenceNode(Connection.java:1067) ~[?:?]

	at org.openhab.binding.amazonechocontrol.internal.Connection.executeSequenceNodes(Connection.java:1076) ~[?:?]

	at org.openhab.binding.amazonechocontrol.internal.Connection.textToSpeech(Connection.java:1038) ~[?:?]

	at org.openhab.binding.amazonechocontrol.internal.handler.EchoHandler.startTextToSpeech(EchoHandler.java:640) ~[?:?]

	at org.openhab.binding.amazonechocontrol.internal.handler.EchoHandler.handleCommand(EchoHandler.java:527) ~[?:?]

	at sun.reflect.GeneratedMethodAccessor98.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) [102:org.eclipse.smarthome.core:0.10.0.oh240]

	at org.eclipse.smarthome.core.internal.common.InvocationHandlerSync.invoke(InvocationHandlerSync.java:59) [102:org.eclipse.smarthome.core:0.10.0.oh240]

	at com.sun.proxy.$Proxy153.handleCommand(Unknown Source) [229:org.openhab.binding.amazonechocontrol:2.4.0]

	at org.eclipse.smarthome.core.thing.internal.profiles.ProfileCallbackImpl.handleCommand(ProfileCallbackImpl.java:75) [109:org.eclipse.smarthome.core.thing:0.10.0.oh240]

	at org.eclipse.smarthome.core.thing.internal.profiles.SystemDefaultProfile.onCommandFromItem(SystemDefaultProfile.java:49) [109:org.eclipse.smarthome.core.thing:0.10.0.oh240]

	at sun.reflect.GeneratedMethodAccessor97.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) [102:org.eclipse.smarthome.core:0.10.0.oh240]

	at org.eclipse.smarthome.core.internal.common.Invocation.call(Invocation.java:53) [102:org.eclipse.smarthome.core:0.10.0.oh240]

	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) [?:?]


any idea ?
thanks
Thomas

If your sending all the echos a TTS at the same exact time you may need to add something like a Thread sleep or timer between each TTS command. I don’t know the limit of commands you can send simultaneously but I would imagine the errors are due to the flood of TTS commands.

You could create an audio group in the alexa app and send the command to this group Thing instead of sending to each specific device.

1 Like

That’s brilliant,:+1: I never thought of that as a workaround.

could someone confirm that TTS is availible for Alexa groups ?
i couldn’t find it in the documentation.

thanks
Thomas

I get the same thing on mine sometimes. I have the TTS string item of 4 different echos assigned to an OpenHAB item group. And I send the TTS command to that group so all the echo devices blast it out at once. That error pops up sometimes, even when nothing actually fails to work. So I solved the problem by suppressing the error in the log config.

So the problem isn’t solved. You just swept it under the carpet.
DO you get the same error log as above?

The problem to me is a verbose error spamming my logs, when there is no error taking place that affects operation, and no other solution to make it go away. So yes, it fixed it for me. FYI, I’m not the one that broke it.

Please see my response above.

for me it isn’t only error spamming, it works only sometimes…and TTS to group isn’t supported :frowning: