Release Candidate and Support: Amazon Echo Control Binding

Yes but you need to create dummy items for that.
A rule triggers when your TTS item changes and writes the current state into the dummy item.

Just a quick example:

rule "save TTS"
when
     echo_TTS changed
then
     echo_lastTTS.postUpdate(echo_TTS.state.toString)
end

Iā€™m running OH 2.4.0 Build 1412 with the Nov 16 (2.4.0.201811161948) Echo Control Binding. These work fine together. But all the Echo Control Binding updates since the Nov 16 release break my system. That is to say, the Echo binding stops working and throws errors into the log whenever it is called.

Here is an excerpt from the logs after installing the todayā€™s 2.5 (6):

2019-03-06 13:10:22.812 [ERROR] [nal.common.AbstractInvocationHandler] - An error occurred while calling method 'ThingHandler.handleCommand()' on 'org.openhab.binding.amazonechocontrol.internal.handler.EchoHandler@28acb8': 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:593) ~[?:?]
	at org.openhab.binding.amazonechocontrol.internal.Connection.executeSequenceNode(Connection.java:1140) ~[?:?]
	at org.openhab.binding.amazonechocontrol.internal.Connection.executeSequenceNodes(Connection.java:1149) ~[?:?]
	at org.openhab.binding.amazonechocontrol.internal.Connection.executeSequenceCommandWithVolume(Connection.java:1113) ~[?:?]
	at org.openhab.binding.amazonechocontrol.internal.Connection.textToSpeech(Connection.java:1089) ~[?:?]
	at org.openhab.binding.amazonechocontrol.internal.handler.EchoHandler.startTextToSpeech(EchoHandler.java:738) ~[?:?]
	at org.openhab.binding.amazonechocontrol.internal.handler.EchoHandler.handleCommand(EchoHandler.java:586) ~[?:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?]
	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) [101:org.eclipse.smarthome.core:0.10.0.201810290804]
	at org.eclipse.smarthome.core.internal.common.InvocationHandlerSync.invoke(InvocationHandlerSync.java:59) [101:org.eclipse.smarthome.core:0.10.0.201810290804]
	at com.sun.proxy.$Proxy156.handleCommand(Unknown Source) [155:org.openhab.binding.amazonechocontrol:2.5.0.Beta_06]
	at org.eclipse.smarthome.core.thing.internal.profiles.ProfileCallbackImpl.handleCommand(ProfileCallbackImpl.java:75) [108:org.eclipse.smarthome.core.thing:0.10.0.201810290804]
	at org.eclipse.smarthome.core.thing.internal.profiles.SystemDefaultProfile.onCommandFromItem(SystemDefaultProfile.java:49) [108:org.eclipse.smarthome.core.thing:0.10.0.201810290804]
	at sun.reflect.GeneratedMethodAccessor103.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) [101:org.eclipse.smarthome.core:0.10.0.201810290804]
	at org.eclipse.smarthome.core.internal.common.Invocation.call(Invocation.java:53) [101:org.eclipse.smarthome.core:0.10.0.201810290804]
	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) [?:?]

Last Nov I fixed a similar problem (nearly identical error logs) by changing my Echo Volume commands to use the TextToSpeechVolume channel instead. This workaround was recommended by michi and it solved the problem back then.

It would be great to be able to use the latest Echo Control Binding. So Iā€™m looking for suggestions on how to fix the problem.

  • Thomas

Hello Thomas,

Please take a look in this post:

Best, Michael

2 Likes

Hi Michael

Working on the TTS alerts to a group, some odd behaviour. But in any case I have large binding error. Should I open an issue on github? The odd behavior may relate to too many requests to the API (as I had it working and then it stopped working)

Cheers

Thank you @michi! I was having issues with TTS and getting the same error. Following the steps in that post got the TTS working again, and everything seems to work. Oddly though, I now see ā€˜Customer Id: Unknownā€™. Iā€™m using Beta 6.

@michi, Thank you! Choosing Logout and create new Device ID fixed it.

In case it matters, my Customer ID is now Unknown, same as 5iver reported when he did the same fix. But TTS is working and no warnings/errors is in the OH2 log.

  • Thomas

After restarting OH, TTS was not working again. But creating a new device ID fixed it again.

Update: Unfortunately the fix is not permanent. Same as @5iver, restarting OH2 causes the problem to return. The reboot caused the newly assigned ā€œUnknownā€ Customer ID to change back to the original value seen before applying the fix.

Until a permanent solution is available Iā€™ve reverted back to the Nov 16 Echo Control binding. It survives a reboot, which is preferred over creating a new device ID with each reboot.

  • Thomas

The announcement channel is working perfectly on my echo spot :slight_smile: Nice feature.
Thanx!

Regards
Olli

Hi All

Is anyone using the TTS for alerts?

This kinda works on and off. Its very odd. Itā€™s not working nowā€¦ Presense is ON but it wonā€™t send the alert to the echo devices.


  // Alert if necessary
  if(alert && gPresenceSensors.state == ON) {
    gAllEchoAlerts.sendCommand(msg.toString)
  }

I use it to announce trash pickup day.:grinning:

Can somebody help?

How can I adress the homekit:HeatingCoolingMode using voice commands? Say, to switch the thermostat off?

If you have a hint for the (German) command, I would be very glad :slight_smile: Thanks!

Do you use it in my scenario with msg.toString? id love t see your examples as Im failing to get it running

Hi Guys

Iā€™m getting the following error in my logs when adjusting the volume of my Echoā€™s & the volume on the device does not change. This has been happening since updating to OpenHAB 2.4.0 & 2.5.0 of the binding. Any help would be great!

Iā€™m currently running 2.5.0.Beta_05 of the binding

2019-03-10 22:41:00.037 [ERROR] [nal.common.AbstractInvocationHandler] - An error occurred while calling method 'ThingHandler.handleCommand()' on 'org.openhab.binding.amazonechocontrol.internal.handler.EchoHandler@47d1eb89': POST url 'https://alexa.amazon.com.au/api/behaviors/preview' failed: Bad Request
org.openhab.binding.amazonechocontrol.internal.HttpException: POST url 'https://alexa.amazon.com.au/api/behaviors/preview' failed: Bad Request
	at org.openhab.binding.amazonechocontrol.internal.Connection.makeRequest(Connection.java:593) ~[?:?]
	at org.openhab.binding.amazonechocontrol.internal.Connection.executeSequenceNode(Connection.java:1140) ~[?:?]
	at org.openhab.binding.amazonechocontrol.internal.Connection.executeSequenceCommand(Connection.java:1125) ~[?:?]
	at org.openhab.binding.amazonechocontrol.internal.handler.EchoHandler.handleCommand(EchoHandler.java:388) ~[?:?]
	at sun.reflect.GeneratedMethodAccessor204.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.$Proxy146.handleCommand(Unknown Source) [263:org.openhab.binding.amazonechocontrol:2.5.0.Beta_05]
	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.GeneratedMethodAccessor202.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) [?:?]
1 Like

I use it for a single echo device. The one in the kitchen where everyone is usually eating breakfast. My example may not help as I use a simple cron job to send the TTS command but I can post if you like.

This is a reported problem but unresolved. Look back at the March 7+ discussions for a ā€œtemporaryā€ solution.

  • Thomas

Michael, could you please give me a short description of the TextToSpeechVolume channel?

I tried to use this right before my TTS commands but the Volume of the speech doesnĀ“t change.
The Volume only changes when changing the volume channel.

The idea of this channel is, that you set in the GUI. I have not testet, what happens if it is set in the rule just before the call.

@5iver, @ThomasOH
Please test my beta preview: Dropbox - org.openhab.binding.amazonechocontrol_2.5.0.Beta_07_Preview_1.jar - Simplify your life
I would be also interested if you see any differences in the customer id on the account page. Check if the column with customer id for each device is equal and if it match with the customer id for the account.

2 Likes

@michi
The ā€œworkingā€ Nov 2018 echo binding Iā€™ve been using does not report the Customer ID value. The newly installed Beta_07_Preview_1 Customer ID is shown as a 14 character (alphanumeric) value and matches all the echo devices reported in my Echo Control Account.

Now for more good news. The preview binding fixes the problem. And the binding continues to work after a reboot. Plus no errors in the log. Thank you!

Thomas

1 Like