Release Candidate and Support: Amazon Echo Control Binding

@michi Hi, i pulled your project, created a new ChannelHandlerMultiAnnouncement and added it to the AccountHandler to make it possible to send one “multiAnnouncement” to all devices connected to an account with only one request. (like the ChannelHandlerSendMessage) Ive seen the sendAnnouncement method was well prepared to handle multiple devices. It works fine, got a new channel called “Announcement” on the Amazon Account Thing. To the fact that this is the first time i worked on an openHAB Binding i don’t know if this is the right way to implement an announcement to the account. Maybe i could send you the project and you would check the changes? I also would implement “groupAnnouncement” like you suggested in a previous post - if you like - but i have to know if i do all the things the right way.

Regards,

Trinitus01

3 Likes

@michi Hi, i found a bug in the announcements sent to my fire tv cube. If i send the following string to the fire tv cube it show the message with the xml tags on the screen:

<speak><amazon:effect name="whispered">Dies ist ein Test</amazon:effect></speak>

Maybe its the same behavior on echos with a display like the echo show aso. I don’t own one of these devices, so i am not able to verify it. Can anyone else verify this?
I fixed it and now it only shows the string without the xml tags.

Today i also found the time to implement your idea with the stacked or grouped announcements. Now it waits 1 seconds if the binding receives more than one announcement with the same speak, text and title. If there are more than one, it sends them all with only one request. Tested for multiple commands and for groups and it works like a charm.
I only added it to the announcements, not to tts because i don’t wanted to convert a tts to an announcement. They act different on the devices so i still think its better to not mix them up.

Regards,

Trinitus01

1 Like

Hi,
I am getting this error in my log ver often, no matter to which of my Echos I talk. Can someone help me with it:

[WARN ] [trol.internal.handler.AccountHandler] - handling of websockets fails

    org.openhab.binding.amazonechocontrol.internal.HttpException: GET url 'https://alexa.amazon.de/api/activities?startTime=1580742806605&size=10&offset=1' failed: Bad Request

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

    	at org.openhab.binding.amazonechocontrol.internal.Connection.makeRequestAndReturnString(Connection.java:500) ~[bundleFile:?]

    	at org.openhab.binding.amazonechocontrol.internal.Connection.makeRequestAndReturnString(Connection.java:495) ~[bundleFile:?]

    	at org.openhab.binding.amazonechocontrol.internal.Connection.getActivities(Connection.java:945) ~[bundleFile:?]

    	at org.openhab.binding.amazonechocontrol.internal.handler.AccountHandler.handlePushActivity(AccountHandler.java:777) ~[bundleFile:?]

    	at org.openhab.binding.amazonechocontrol.internal.handler.AccountHandler.handleWebsocketCommand(AccountHandler.java:722) ~[bundleFile:?]

    	at org.openhab.binding.amazonechocontrol.internal.handler.AccountHandler.webSocketCommandReceived(AccountHandler.java:710) [bundleFile:?]

    	at org.openhab.binding.amazonechocontrol.internal.WebSocketConnection$Listener.onWebSocketBinary(WebSocketConnection.java:406) [bundleFile:?]

    	at org.eclipse.jetty.websocket.common.events.JettyListenerEventDriver.onBinaryMessage(JettyListenerEventDriver.java:103) [bundleFile:9.4.20.v20190813]

    	at org.eclipse.jetty.websocket.common.message.SimpleBinaryMessage.messageComplete(SimpleBinaryMessage.java:68) [bundleFile:9.4.20.v20190813]

    	at org.eclipse.jetty.websocket.common.events.AbstractEventDriver.appendMessage(AbstractEventDriver.java:65) [bundleFile:9.4.20.v20190813]

    	at org.eclipse.jetty.websocket.common.events.JettyListenerEventDriver.onBinaryFrame(JettyListenerEventDriver.java:74) [bundleFile:9.4.20.v20190813]

    	at org.eclipse.jetty.websocket.common.events.AbstractEventDriver.incomingFrame(AbstractEventDriver.java:145) [bundleFile:9.4.20.v20190813]

    	at org.eclipse.jetty.websocket.common.WebSocketSession.incomingFrame(WebSocketSession.java:321) [bundleFile:9.4.20.v20190813]

    	at org.eclipse.jetty.websocket.common.extensions.ExtensionStack.incomingFrame(ExtensionStack.java:202) [bundleFile:9.4.20.v20190813]

    	at org.eclipse.jetty.websocket.common.Parser.notifyFrame(Parser.java:226) [bundleFile:9.4.20.v20190813]

    	at org.eclipse.jetty.websocket.common.Parser.parseSingleFrame(Parser.java:262) [bundleFile:9.4.20.v20190813]

    	at org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection.readParse(AbstractWebSocketConnection.java:582) [bundleFile:9.4.20.v20190813]

    	at org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection.onFillable(AbstractWebSocketConnection.java:441) [bundleFile:9.4.20.v20190813]

    	at org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection.onFillable(AbstractWebSocketConnection.java:428) [bundleFile:9.4.20.v20190813]

    	at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311) [bundleFile:9.4.20.v20190813]

    	at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103) [bundleFile:9.4.20.v20190813]

    	at org.eclipse.jetty.io.ssl.SslConnection$DecryptedEndPoint.onFillable(SslConnection.java:426) [bundleFile:9.4.20.v20190813]

    	at org.eclipse.jetty.io.ssl.SslConnection.onFillable(SslConnection.java:320) [bundleFile:9.4.20.v20190813]

    	at org.eclipse.jetty.io.ssl.SslConnection$2.succeeded(SslConnection.java:158) [bundleFile:9.4.20.v20190813]

    	at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103) [bundleFile:9.4.20.v20190813]

    	at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:117) [bundleFile:9.4.20.v20190813]

    	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:336) [bundleFile:9.4.20.v20190813]

    	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:313) [bundleFile:9.4.20.v20190813]

    	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:171) [bundleFile:9.4.20.v20190813]

    	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:129) [bundleFile:9.4.20.v20190813]

    	at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:367) [bundleFile:9.4.20.v20190813]

    	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:782) [bundleFile:9.4.20.v20190813]

    	at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:918) [bundleFile:9.4.20.v20190813]

    	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_222]
1 Like

Try giving OH a restart or reboot.

1 Like

Did reboot and restart several times, but I think the error occurs when there are too many “Alexa calls” in a short period of time.
It seems to be a problem from the Amamzon server side.

Yes that can be a problem and is mentioned several times in this topic. You can move to the beta version, I think it supports multi messages just not multi TTS messages.

1 Like

Thanks for the help.
For now I disabled the logging of WARN for the binding, should do the trick for me, as everything works smooth.

1 Like

@michi

  • added stacked or grouped textToSpeech via sequences
  • added set ttsvolume in stacked or grouped announcements & textToSpeech via sequence
  • fixed update or refresh volume immediately after a command (before updated on second command and broke ttsvolume, command, volume sequence)
  • fixed update or refresh volume immediately after manual echo button press (before did not update or refresh anyway)

Regards,

Trinitus01

1 Like

Where can this update be downloaded?

Hi,

thank you very much for your interest in the update.
I would really like to publish the modified version,
but there is still no response from the initial contributor @michi.
He has to revise the code first and maybe merge the changes into the official version or else it could happen that two different versions exists.
Otherwise if he agrees I could send the modified version to designated people for testing.
Until i receive feedback from @michi we have to remain patient.

Regards,

Trinitus01

4 Likes

I too am getting Bad Request errors.
It is getting difficult to know in which thread to report such issues.

Regards
Paul

Great to see that you fixed these bad requests!

I’m almost have the same problem. I’ve 2 echo at home both of them work with TTS or startCommand but no sound at all when i try to trigger an alarm. (by rules, by paper ui control, or sitemap). I’m using 2.5.2

It is still not working, but I haven’t tried to fix it because I am using the announcement channel instead.

Hi,
i have some problems to use announcement with my echoshow. Here my thing configuration:

Thing echoshow echoKitchen "Alexa" @ "Kueche" [serialNumber="G000XXXXXXXXXXXX"]

and my item:

String Echo_Kitchen_Announcement "Announcement" (Kueche) {channel="amazonechocontrol:echo:account1:echoKitchen:announcement"}

If i call:

Echo_Kitchen_Announcement 'door opened'

nothing happends, if i change the thing from echoshow to echo:

Thing **echo** echoKitchen "Alexa" @ "Kueche" [serialNumber="G000XXXXXXXXXXXX"]

everthing works fine. Do you know this problem?

Regards
Ralph

Have you activated the announcement feature at the echoshow device via alexa app?

Yes i have activated the announcement feature.

Hi @michi I am brand new to OpenHab and have got things setup and the account is showing my devices etc. One thing I am unsure of is if and how I can send a command to alexa in general from a rule. What I am trying to do is when i start playing a movie on Plex it sends a command to Alexa to turn off the living room lights then when the movie is paused or stopped, turn on the lights. I was attempting to use the SendMessage channel on the account but nothing happens when the command fires. Is there an example of how I can achieve the above?

Question / Answer Rule?

Has anybody figured out how to TTS a question then have Alexa wait for the response from you in order to interact with your rules based on your response?

Best, Jay

Hi,
I´m using the binding for 3 echos. Is there way to find out, which echos receives the call?
I need this information to give an answer back only at this device (echo).

Thanks in advance
Benno