Release Candidate and Support: Amazon Echo Control Binding

I use “Stoßlüften fertig, bitte Fenster schließen”, all fine.
Michi, fine binding, big thank for your job.

1 Like

Give a try for beta 9. Seems reminder have some issue.
Thing, item and rules setting look well.
Echo_Living_Room_Remind.sendCommand(“let’s gogogogogo”)

The first trigger of the rule had no problem. it spoked twice as expected. But when second trigger It only have alarm sound, no text was speaking. The reminder listed in alexa web app correctly. After i marked it as completed through alexa web app then triggered third one, it is normal as expected again. But fourth trigger was only alarm sound again.

Thank you for the binding! Much appreciated.

For the Reminder function, can the contents of a string be sent and spoken rather than a set of words in quotation marks?

I tried but it didn’t work.

Thanks.

I guess it has to do within the thingsfile, tonight I will try to remove the thingsfile and let OH discover the things himself…

I get this error. At fisrt time it works, then i try to create the thing and the items in the thing.file and the item.file. After that i have the error, but the password i set is the right one. I tried to delete the config in the karaf.console, but i dont find the binding inside this.

the error in the openhab.log:

2018-01-29 17:43:50.642 [INFO ] [mazonechocontrol.internal.Connection] - Login failed:{}
org.openhab.binding.amazonechocontrol.internal.ConnectionException: Login fails.
at org.openhab.binding.amazonechocontrol.internal.Connection.makeLogin(Connection.java:420) ~[?:?]
at org.openhab.binding.amazonechocontrol.handler.AccountHandler.checkLogin(AccountHandler.java:248) ~[?:?]
at org.openhab.binding.amazonechocontrol.handler.AccountHandler.lambda$0(AccountHandler.java:197) ~[?:?]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:?]
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) [?:?]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) [?:?]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) [?:?]
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) [?:?]

Hi Michael,

  1. Prime Playlist
    This my own playlist within Amazon Prime Music. I can see the playlist in the drop down in paperUI.
    The list is set through a selection and rule.
rule Aleax_OG_Playlist
when
    Item Echo_OG_AmazonMusicPlayListId received update
then
    if(Echo_OG_AmazonMusicPlayListId != "") {
        Echo_OG_Player.sendCommand(PLAY)
        Echo_OG_Shuffle.sendCommand(ON)
    }
    else {
        Echo_OG_AmazonMusic.sendCommand(OFF)
    }
end

I tried it also with just setting the ID. But then the system does not start the playlist. Exception is the same.

  1. Radio ON / OFF
    OK this was triggered by a rule. I fixed it as I don’t need it at all as it is enough to set the Station ID only.

Hi Timmi,
it’s enough to set the the playlist list as command. Does the playlist start playing if you select it from the paperUI? If so, it should be possible to do it with a rule

sendCommand(Echo_OG_AmazonMusicPlayListId, "yourplaylistid")

There is no extra play command needed.
Regards,
Michael

Hi Marcus,
This will not help, I’am sure that it have nothing to do with the thingsfile, the logs shows that the call is initiated by the binding, only the server reports an error. Please check the system clock of the computer which runs openHAB. If the reminder is in the past, the server reports an error and so I add 5 seconds to the current time to set the reminder. But if the time of the computer is too wrong, this will be to less.
Regards,
Michael

Yes of course, this is a feature of the openHAB runtime and have nothing do to with the binding. Small sample which speaks “Reminder: Temperatur 5.3”. The temperature itself come from the Garden_Temperatur item

 var myText = "Temperature " + Garden_Temperatur.state;
 Alexa_Remind.sendCommand(myText)

Regards,
Michael

I don’t know why the login fails for some users.

Possibilities to try:

  1. Check if 2 factor authentication is turned off
  2. reboot openhab
  3. try to remove the Account Thing, wait 12 hours, create it, sometimes this helps because in some situations seems that amazon lock the login for a while.

If this does not help, you can try to turn on the tracing for debug level. Then you will find a text starting with "Received content after login ". Then there will be a lot of text (the html-response of the server). DO NOT POST THIS HERE, IT COULD CONTAIN PRIVATE INFORMATIONS. Search for ‘auth-error-message-box’, maybe you find an hint why the login fails somewhere in the near of this text.

I hope this help…
Regards, Michael

This is a problem of the amazon server software or the alexa software. Sometimes this happens, but I have not yet found a rule. My first idea was, that it happens if the text is very long, because I tried it with a long text and no message was spoken. But if you provide always the same text, it must have another reason. But in any way, the alexa app shows the correct message, also the notification to the app will be sent with the correct text, so it is not a bug of the binding. Maybe you find a rule when this happen, maybe you trie the same by setting the reminder from the alexa web page. I expect the same result.

Regards,
Michael

Michael,

Thanks. It works now.
Not sure why it didn’t work before but instead of reading out the contents of the string, it read out the attributes of the string item type.
(Unfortunately, I didn’t keep a copy of what I had written so I don’t know where I went wrong!)

I tried with short text “The Door is open” it spoke twice as well. then i change the string to “The Door is closed” then it won’t speak. I simulated same scenario in Alexa App, it running without any problem. I agree not the bug in the binding. I guess the problem on CURL fire mechanism in the binding.

I think i found something. I puted log-level to debug.
I found this in the logging:

" Zum besseren Schutz Ihres Kontos geben Sie bitte nochmals Ihr Passwort ein, und geben Sie dann die Zeichen ein, die in der Abbildung unten gezeigt werden"

I think this is the problem. If i login manualy i must put in my password again and a captcha code.

I have no idea why, maybe because of triing sometimes with wrong password.

Correct, there was a time difference. Using timedatectl I moved time 1 min into future and voila speach arrived, even within the long german text.

Hi Michael

first of all. Thank you for this great binding! It offers so many new opportunities! :slight_smile:
I could test the binding with several amazon echo devices. Only my echo (1st generation) does not work as expected.
I get the same error message as Rene:

“Zum besseren Schutz Ihres Kontos geben Sie bitte nochmals Ihr Passwort ein, und geben Sie dann die Zeichen ein, die in der Abbildung unten gezeigt werden.”

I’m not using two factor authentication. Let me know If I can contribute more information to analyze this problem.

Regards

Marco

Hi Michael,

thanks for this great binding. One question that I wasn’t able to fiddle out yet in this thread: is it possible to send “spoken”-like commands to Echo in, e.g., rules? I would like to have a rule that sends a “Play songs by Queen on Everywhere group” to the Echo. So far I only see that one can provide ids but not the plain text that one would say to Alexa.

In the blog you mentioned in your first post, though, that seems possible:

alexa_remote_control.sh -d Wohnzimmer -r “radioeins vom rbb”

So I wonder whether this binding can do the same.

Thanks and keep the great work going!

How can i use the remind function?

I try to set it by reminderitem.postUpdate(“Testreminder an Echo”)

but nothing happens.

How can i use the PlayAlarmSound item? I have no dropdown in the paperui to select an sound, its only an string-item in paperui.

Hi,

That’s really bad because there is currently no solution for this (because there is currently no official way for the login) and I only simulate a webbrowser. But maybe it works if remove the account device (so no more login tries will be made), than you login manually from the web-browser and enter the characters. Close the browser after a while and recreate the Account device. It seems that this help sometimes.

Regards,
Michael

Use sendCommand instead of postUpdate and it should work:

reminderitem.sendCommand(“Testreminder an Echo”)

Regards,
Michael