Release Candidate and Support: Amazon Echo Control Binding

I waited these 11 hours, installed Beta 10 (thanks for the just-in-time release :wink: ), and it’s working again. Great work!

Hello there,
This binding is awesome,but i have a few problems, i installed beta 10 and i have Amazon accaont ONLINE but all echos are OFFLINE.

In alexa app, echos are online and function proberly,bu in Openhab echos are offline.Why is that?

This is the message in log viewer:

2018-03-10 04:17:23.274 [hingStatusInfoChangedEvent] - 'amazonechocontrol:echo:account1:G090LF1073360RD5' changed from UNINITIALIZED to INITIALIZING

==> /var/log/openhab2/openhab.log <==

2018-03-10 04:17:23.276 [INFO ] [mazonechocontrol.handler.EchoHandler] - Amazon Echo Control Binding initialized

==> /var/log/openhab2/events.log <==

2018-03-10 04:17:23.281 [hingStatusInfoChangedEvent] - 'amazonechocontrol:echo:account1:G090LF1073360RD5' changed from INITIALIZING to ONLINE

2018-03-10 04:17:23.291 [hingStatusInfoChangedEvent] - 'amazonechocontrol:echo:account1:G090LF1073360RD5' changed from ONLINE to OFFLINE

2018-03-10 04:17:25.852 [me.event.InboxRemovedEvent] - Discovery Result with UID 'amazonechocontrol:echo:account1:G090L910731301RD' has been removed.

2018-03-10 04:17:25.856 [hingStatusInfoChangedEvent] - 'amazonechocontrol:echo:account1:G090L910731301RD' changed from UNINITIALIZED to INITIALIZING

==> /var/log/openhab2/openhab.log <==

2018-03-10 04:17:25.856 [INFO ] [mazonechocontrol.handler.EchoHandler] - Amazon Echo Control Binding initialized

Anybody know about this problem?
thx, Sergiu

I have restarted several times, and I did a whole re-install of openhab(ian), as well. No effect.

I added this code as a .things file.
The Echo is recognized immediately, and the channels are working flawlessly.
The EchoShow does not show up at all. :exploding_head:

Bridge amazonechocontrol:account:account1 "[SMARTHOME] Amazon Account" @ "Accounts" [amazonSite="amazon.de", email="MyEMail", password="MyPassword", pollingIntervalInSeconds=60]
{
     Thing echoshow             echo1 "[ECHO] Living Room"   [serialNumber="MySerialNumber"]
     Thing echo                 echo2 "[ECHO] Kitchen"       [serialNumber="MyOtherSerialNumber"]
}

Log shows:

2018-03-10 11:48:45.054 [INFO ] [el.core.internal.ModelRepositoryImpl] - Refreshing model 'amazon.things'
2018-03-10 11:48:45.059 [WARN ] [el.core.internal.ModelRepositoryImpl] - Configuration model 'amazon.things' is either empty or cannot be parsed correctly!
2018-03-10 11:48:45.087 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'amazon.things'

Maybe the format has to be different for EchoShows?

Currently I have no idea, but you can create your show device as echo as well. In the moment there is no different functionality.

I still have the bridge ONLINE , but all echos device are OFFLINE

Do you know why?

I do the code like user micchi sowed to us earlier

  1. Do you have defined it in PaperUI or in a thing file?
  2. If it is in a thing file, post the configuration without your private information. If you have defined it in paperUI, have you used the discovery feature?
  3. Have you tried to restart openHAB?

Yes i restarted openhab
I used both method:

  1. Automatically add in Paper UI
    2.Put in alexa.things
Bridge amazonechocontrol:account:account1 "[SMARTHOME] Amazon Account" @ "Accounts" [amazonSite="amazon.de", email="MyEMail", password="MyPassword", pollingIntervalInSeconds=60]
{
     Thing echoshow             echo1 "[ECHO] Living Room"   [serialNumber="MySerialNumber"]
     Thing echo                 echo2 "[ECHO] Kitchen"       [serialNumber="MyOtherSerialNumber"]
}

Wtih my serials and my credential of course have the same result: echos are offline

Both methodes echos are offline acount are online
My openhab version is openHAB 2.2.0 Release Build


Waited 20 hours, still getting the issue.

@michi Should I remove the Amazon Account thing for now and wait a few more hours ?

You can try. Another thing what I have heard from users:
Stop openHAB
Login with a webbrowser to the Alexa website.
Close your browser
Start openHAB

The best way would be to use a webbrowser on the same machine. If this is not possible, you can try that you shutdown the computer with the openHAB and start another machine from the same IP Address. But I don’t know if any of them work.

You can also try to configure the tracing for debug level, than we get a message with the amazon response, so that we can se what’s going wrong.

Regards,
Michael

Do you use the same amazon account which is used in the Alexa app?

You can also try this build: https://www.dropbox.com/s/s1375m1y4fcuzi1/org.openhab.binding.amazonechocontrol_2.3.0.201803101932.jar?dl=0
I have changed the state handling a little bit.

Question to english speaking PaperUI users, are you see english or german label for the echo things channels?

Everything is in English

Thank you for the confirmation!

LATER EDIT, i resolve this
was amazon.com account
 So sorry to bother you

@michi Thanks for your work on this great OH binding!

I was able to authenticate successfully while having using two-factor enabled on my Amazon account. I used the guidelines listed on this page to get it to work. I was concerned that it wouldn’t work after a server restart but I can confirm that it is still able to connect after a full restart.

Related to the startRoutine channel, based on your description, I assumed that you could send anything that you would say to Alexa, and therefore interact with any skills, but it looks like it is only working for Alexa routines that you have setup on your account. So it looks like you are limited to what the routine functionality has to offer. Is my understanding of this channel correct?

On a side note, do you any plan on adding a channel to interact with timers? The ability to track timers and possibility create timers across other echo devices would be amazing.

Hallo jeshab,
Thank you for your investigation and this hint. But I’am afraid, that it will fail after 5 days. I don not make a new login when open hab is restarted. I store the login cookie in the files system under the user data folder. After 5 days, I have to do the login again to refresh the cookie. Do you know if the additional code will be required for every login? Or only the first time? Please let me know if the binding still works after five days. (You can check if the new login was done by looking in the amazonechocontrol subfolder under userdata. There is an text file for the account device with a timestamp)

No :frowning_face: I can only trigger the preview function of routines.

Unfortunately yes.

Kind Regards, Michael

Thank you for the feedback!

The binding is now also available from the openHAB marketplace integration!

IF YOU HAVE PREVIOUSLY INSTALLED THE BINDING MANUAL, remove first the binding from the AddOn directory and reboot openHAB. (WARNING: I currently not know what happens with things defined in PaperUI, things defined in files appear again after the binding installation)

Configure the markplace in openHAB to “Maturity Level” Alpha or Beta and switch on the “Include Bindings” flags to see the binding.

After this configuration you can simple install the binding in the PaperUI by pressing install:

1 Like

Michael,
I followed your directions to use the marketplace binding. Everything worked great. Do you know how I would list that in my addons.cfg file to get it to automatically load after a reboot?

Thanks for the clarification. So I removed the properties file with the cookie information and as you expected, it is no longer able to connect. Moreover, because it keeps on trying after that failure, I wasn’t able to get it to work using the guidelines.

This was because the Amazon captcha showed up after the binding failed to login after a number of times. An easy way to confirm/clear it is to open a private browser session and try to log in into that account and enter the captcha code. Once I did this, the binding was able to log in again using the same authentication guidelines.

So as long as the cookie is being used, we should be fine. Is there a reason for refreshing it every 5 days especially if the session is still valid? To compare to a browser experience, I don’t think Amazon re-prompts for a password authentication after the initial login and I would assume the browser uses the cookie session information for quite a while.