Release Candidate and Support: Amazon Echo Control Binding

@Saracen
That is awesome, thanks for pointing out the presence of the link.
I have difficulty seeing the links from normal text.

Regards
Paul

Hey Michael,

Is it possible to create an item for the binding that does the Alexa notifications (yellow blinking light)? This would allow us to trigger delivery notifications (item coming, item delivered, etc.).

Keep up the great work! One of the most important bindings in my collection.

Best, Jay

Hi Guys, does anyone have continued issues with using a group with your TTS channels inside to send alerts? Its very flakey and never works consistently. I dont think this is really a binding issue but perhaps some kind of rate limit on Alexa requests. Is there a way around this or even a method to pay for more requests to the Alexa?

Thanks

Are you sending alot of requests to Amazon? I get this error too.

Have you tried adding org.eclipse.smarthome.threadpool:RuleEngine=20 at the end of /etc/openhab2/services/runtime.cfg to see if that helps? I can not, at the moment, remember exactly what this does but it may be worth a try.

1 Like

Ill give it a go! Thanks

Beta 7 released

This is a bugfix release with no new features.

  • Fix issue ā€˜Bad requestā€™ for TTS calls if the devices are owned by another customer id than the account
  • Repeat calls in case of ā€˜Bad requestā€™ if there are many request at the same time

Download Beta 7 from the top most posting

Roadmap

openHAB 2.5:

  • I will create a pull request for this version to get merged into the openHAB master, so that it will hopefully part of the offical OH 2.5

openHAB 2.6:

  • Q3/2019 feature for synchronization of timers and alarms between alexa devices

openHAB 2.7:

  • 2020 support for smarthome devices connected directly to echo devices (e.g. build in smarthome hub)
5 Likes

Hi Jay,
The notifications have an documented API for Alexa Skills. But I assume, that a Skill could only be one of the different type of skills and the current existing openHAB skill is a smarthome skill. So I assume, a new skill would be necessary for this. But Iā€™am not really sure, maybe you can ask the developer of the openHAB skill.
I do not see currently any possibility to this from the binding. But of course, this could change if amazon add this feature to routines.
Best,
Michael

Hi @michi

Group announcements are now working much better. They are more in sync

Echo Dot, Echo Show, Echo all in a group >>> I make short attention tone and then the announcement to the group >>> all 3 are now in sync and there are no errors in the log but ā€¦

I did have an initial error while I was updating some other rules I was working on but its not repeated since.

2019-04-18 10:18:56.149 [ERROR] [nal.common.AbstractInvocationHandler] - An error occurred while calling method 'ThingHandler.handleCommand()' on 'org.openhab.binding.amazonechocontrol.internal.handler.EchoHandler@11a90a': 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

Thanks, Mark.

Hi @michi,

I just installed the latest beta, but when I try to login, I get the following error:

HTTP ERROR 500

Problem accessing /amazonechocontrol/bfd9850d/ap/signin. Reason:

Server Error

Caused by:

org.openhab.binding.amazonechocontrol.internal.HttpException: POST url ā€˜https://www.amazon.com/ap/signinā€™ failed: Found at org.openhab.binding.amazonechocontrol.internal.Connection.makeRequest(Connection.java:628) at org.openhab.binding.amazonechocontrol.internal.AccountServlet.handleProxyRequest(AccountServlet.java:628) at org.openhab.binding.amazonechocontrol.internal.AccountServlet.doVerb(AccountServlet.java:225) at org.openhab.binding.amazonechocontrol.internal.AccountServlet.doPost(AccountServlet.java:133) at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)

Do you have any idea what I am doing wrong?

Thanks a lot!
Christoph

1 Like

@michi
Hi Michael - Am continuing to have issues with the binding - Ive followed your instructions that I must use a beta version - Iā€™ve now tried version 6 & 7 and Iā€™m no further forward in being able to use the binding. - prior to the change in the binding I had little issue - when i could add the .com.au suffix (under OH2.3 - In paper ui)

I get the following error
HTTP ERROR 500
Problem accessing /amazonechocontrol/854bfe87/ap/signin/131-8618649-0793801. Reason:

Server Error

Caused by:
org.openhab.binding.amazonechocontrol.internal.HttpException: POST url ā€˜https://www.amazon.com/ap/signin/131-8618649-0793801ā€™ failed: Found
at org.openhab.binding.amazonechocontrol.internal.Connection.makeRequest(Connection.java:628)
at org.openhab.binding.amazonechocontrol.internal.AccountServlet.handleProxyRequest(AccountServlet.java:628)
at org.openhab.binding.amazonechocontrol.internal.AccountServlet.doVerb(AccountServlet.java:225)
at org.openhab.binding.amazonechocontrol.internal.AccountServlet.doPost(AccountServlet.java:133)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:865)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:535)
at org.ops4j.pax.web.service.jetty.internal.HttpServiceServletHandler.doHandle(HttpServiceServletHandler.java:71)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:146)
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:257)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1595)
at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:255)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1317)
at org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.doHandle(HttpServiceContext.java:293)
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:203)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:473)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1564)
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:201)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1219)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:144)
at org.ops4j.pax.web.service.jetty.internal.JettyServerHandlerCollection.handle(JettyServerHandlerCollection.java:80)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
at org.eclipse.jetty.server.Server.handle(Server.java:531)
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:352)
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:260)
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:281)
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:102)
at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:118)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:333)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:310)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:168)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:126)
at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:366)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:762)
at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:680)
at java.lang.Thread.run(Thread.java:748)

I am using OH2.4 Release Build
Thanks
Matt

That does not work for me:
ā€œspeak and breakā€ are both just said by alexa.
How did you make it run? @Saracen?

Did you copy and paste the text from the post or re-type it?

Try copy-and-pasting it verbatim in case you are using the wrong characters for the quote marks.

echo_TTS.sendCommand('<speak>Wait for the <break/> Pause</speak>')

Does the api expose whoā€™s talking? If so, could this be exposed as a channel?

My alexa knows my voice and knows me as Crispin. Everyone else is unknown.

Thanks
C

This is no API and no itā€˜s currently not possible.
The binding only works with things that work on the Alexa website.
Currently thereā€˜s no feature to use the voice recognition.
Iā€˜m also waiting for this :slight_smile:

Booo :frowning:

Hereā€™s adding it to my list :slight_smile:

Hi @michi,

Since Beta7, command sent to TTS channel no longer interrupts on-going speech as quickly as in previous versions. This is quite problematic for me because I run a prioritized notification queue which allows a notification to be interrupted by a more important one (I handle a priority level) and restarted after the most urgent notification was completed. With latest Beta7, it behaves quite erratically.

See below my test: when I send sequentially 3 TTS commands, I would expect the first 2 to be interrupted and only hear the 3rd one. In the example below, I only hear the 2nd notification and 1st and 3rd seem to get lost.

22:38:22.082 [INFO ] [me.model.script.rules.sys.ItemCommand] - [EC_TTS] EC_mN2_Sdb_TTS received command Premiā–’re notification
22:38:22.085 [INFO ] [me.model.script.rules.sys.ItemCommand] - [EC_TTS] EC_mN2_Sdb_TTS received command Seconde notification
22:38:22.099 [INFO ] [me.model.script.rules.sys.ItemCommand] - [EC_TTS] EC_mN2_Sdb_TTS received command Troisiā–’me notification
22:38:22.476 [DEBUG] [amazonechocontrol.internal.Connection] - Call to https://alexa.amazon.fr/api/behaviors/preview succeeded
22:38:22.478 [DEBUG] [amazonechocontrol.internal.Connection] - Make request to https://alexa.amazon.fr/api/behaviors/preview
22:38:22.479 [DEBUG] [amazonechocontrol.internal.Connection] - POST: {"behaviorId":"PREVIEW","sequenceJson":"{\"@type\":\"com.amazon.alexa.behaviors.model.Sequence\",\"startNode\":{\"@type\":\"com.amazon.alexa.behaviors.model.OpaquePayloadOperationNode\",\"type\":\"Alexa.Speak\",\"operationPayload\":{\"deviceType\":\"A7WXQPH584YP\",\"deviceSerialNumber\":\"GXXXXXXXXXXXXXXX\",\"locale\":\"\",\"customerId\":\"AAAAAAAAAAAAAA\",\"textToSpeak\":\"Seconde notification\"}}}","status":"ENABLED"}
22:38:22.890 [DEBUG] [amazonechocontrol.internal.Connection] - Call to https://alexa.amazon.fr/api/behaviors/preview succeeded
22:38:22.892 [DEBUG] [amazonechocontrol.internal.Connection] - Make request to https://alexa.amazon.fr/api/behaviors/preview
22:38:22.893 [DEBUG] [amazonechocontrol.internal.Connection] - POST: {"behaviorId":"PREVIEW","sequenceJson":"{\"@type\":\"com.amazon.alexa.behaviors.model.Sequence\",\"startNode\":{\"@type\":\"com.amazon.alexa.behaviors.model.OpaquePayloadOperationNode\",\"type\":\"Alexa.Speak\",\"operationPayload\":{\"deviceType\":\"A7WXQPH584YP\",\"deviceSerialNumber\":\"GXXXXXXXXXXXXXXX\",\"locale\":\"\",\"customerId\":\"AAAAAAAAAAAAAA\",\"textToSpeak\":\"Troisiā–’me notification\"}}}","status":"ENABLED"}
22:38:23.282 [DEBUG] [amazonechocontrol.internal.Connection] - Call to https://alexa.amazon.fr/api/behaviors/preview succeeded
22:38:23.348 [DEBUG] [ocontrol.internal.WebSocketConnection] - Message received: {"payload":"{\"destinationUserId\":\"AAAAAAAAAAAAAA\",\"key\":{\"entryId\":\"1555965505806#A7WXQPH584YP#GXXXXXXXXXXXXXXX\",\"registeredUserId\":\"AAAAAAAAAAAAAA\"},\"timestamp\":1555965506252}","command":"PUSH_ACTIVITY"}
22:38:23.350 [DEBUG] [amazonechocontrol.internal.Connection] - Make request to https://alexa.amazon.fr/api/activities?startTime=1555965506252&size=10&offset=1
22:38:23.579 [DEBUG] [amazonechocontrol.internal.Connection] - Call to https://alexa.amazon.fr/api/activities?startTime=1555965506252&size=10&offset=1 succeeded
22:38:23.583 [DEBUG] [ocontrol.internal.WebSocketConnection] - Message handled: {"payload":"{\"destinationUserId\":\"AAAAAAAAAAAAAA\",\"key\":{\"entryId\":\"1555965505806#A7WXQPH584YP#GXXXXXXXXXXXXXXX\",\"registeredUserId\":\"AAAAAAAAAAAAAA\"},\"timestamp\":1555965506252}","command":"PUSH_ACTIVITY"}
22:38:23.648 [DEBUG] [ocontrol.internal.WebSocketConnection] - Message received: {"payload":"{\"destinationUserId\":\"AAAAAAAAAAAAAA\",\"key\":{\"entryId\":\"1555965506160#A7WXQPH584YP#GXXXXXXXXXXXXXXX\",\"registeredUserId\":\"AAAAAAAAAAAAAA\"},\"timestamp\":1555965506554}","command":"PUSH_ACTIVITY"}
22:38:23.650 [DEBUG] [amazonechocontrol.internal.Connection] - Make request to https://alexa.amazon.fr/api/activities?startTime=1555965506554&size=10&offset=1
22:38:24.286 [DEBUG] [ocontrol.internal.handler.EchoHandler] - Handle updateState amazonechocontrol:echo:f71ef12f:GXXXXXXXXXXXXXXX
22:38:24.288 [DEBUG] [amazonechocontrol.internal.Connection] - Make request to https://alexa.amazon.fr/api/np/player?deviceSerialNumber=GXXXXXXXXXXXXXXX&deviceType=A7WXQPH584YP&screenWidth=1440
22:38:29.937 [DEBUG] [ntrol.internal.handler.AccountHandler] - check login amazonechocontrol:account:f71ef12f
22:38:30.406 [DEBUG] [amazonechocontrol.internal.Connection] - Call to https://alexa.amazon.fr/api/activities?startTime=1555965506554&size=10&offset=1 succeeded
22:38:30.410 [DEBUG] [ocontrol.internal.WebSocketConnection] - Message handled: {"payload":"{\"destinationUserId\":\"AAAAAAAAAAAAAA\",\"key\":{\"entryId\":\"1555965506160#A7WXQPH584YP#GXXXXXXXXXXXXXXX\",\"registeredUserId\":\"AAAAAAAAAAAAAA\"},\"timestamp\":1555965506554}","command":"PUSH_ACTIVITY"}
22:38:30.411 [DEBUG] [ocontrol.internal.WebSocketConnection] - Message received: {"payload":"{\"destinationUserId\":\"AAAAAAAAAAAAAA\",\"key\":{\"entryId\":\"1555965506550#A7WXQPH584YP#GXXXXXXXXXXXXXXX\",\"registeredUserId\":\"AAAAAAAAAAAAAA\"},\"timestamp\":1555965506753}","command":"PUSH_ACTIVITY"}
22:38:30.413 [DEBUG] [amazonechocontrol.internal.Connection] - Make request to https://alexa.amazon.fr/api/activities?startTime=1555965506753&size=10&offset=1
22:38:30.570 [DEBUG] [amazonechocontrol.internal.Connection] - Call to https://alexa.amazon.fr/api/activities?startTime=1555965506753&size=10&offset=1 succeeded
22:38:30.573 [DEBUG] [ocontrol.internal.WebSocketConnection] - Message handled: {"payload":"{\"destinationUserId\":\"AAAAAAAAAAAAAA\",\"key\":{\"entryId\":\"1555965506550#A7WXQPH584YP#GXXXXXXXXXXXXXXX\",\"registeredUserId\":\"AAAAAAAAAAAAAA\"},\"timestamp\":1555965506753}","command":"PUSH_ACTIVITY"}
22:38:44.507 [DEBUG] [ntrol.internal.handler.AccountHandler] - checkData amazonechocontrol:account:f71ef12f finished

Can you have a look and give a feedback on this?

Thank you

Wawa

Hi @michi using your 2.7 binding and when I go to authorise the account, I get this

Anyone seen this? Tryed to delete the Account thing and reset it up. Everything was working fine before that

rg.openhab.binding.amazonechocontrol.internal.HttpException: POST url 'https://www.amazon.com/ap/signin/140-6969213-6284412' failed: Moved Temporarily
	at org.openhab.binding.amazonechocontrol.internal.Connection.makeRequest(Connection.java:628)
	at org.openhab.binding.amazonechocontrol.internal.AccountServlet.handleProxyRequest(AccountServlet.java:628)
	at org.openhab.binding.amazonechocontrol.internal.AccountServlet.doVerb(AccountServlet.java:225)
	at org.openhab.binding.amazonechocontrol.internal.AccountServlet.doPost(AccountServlet.java:133)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
	at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:865)
	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:535)
	at org.ops4j.pax.web.service.jetty.internal.HttpServiceServletHandler.doHandle(HttpServiceServletHandler.java:71)
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:146)
	at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548)
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
	at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:257)
	at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1595)
	at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:255)
	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1317)
	at org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.doHandle(HttpServiceContext.java:293)
	at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:203)
	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:473)
	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1564)
	at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:201)
	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1219)
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:144)
	at org.ops4j.pax.web.service.jetty.internal.JettyServerHandlerCollection.handle(JettyServerHandlerCollection.java:80)
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
	at org.eclipse.jetty.server.Server.handle(Server.java:531)
	at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:352)
	at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:260)
	at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:281)
	at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:102)
	at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:118)
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:333)
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:310)
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:168)
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:126)
	at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:366)
	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:762)
	at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:680)
	at java.lang.Thread.run(Thread.java:748)
Powered by Jetty:// 9.4.11.v20180605

Same issue here as well. @Christoph_Zeh

Seems a common issue

Hope theres a resolution, I love this binding but its broken it all :frowning:

Any way we can send a command to simulate the alarm function ā€œAlexa, snoozeā€ I want to use a cheap Xiaomi button to trigger this command so I donā€™t have to yell at Alexa in the morning sleep in