Release Candidate and Support: Amazon Echo Control Binding

Hey hey, this binding is a amazing idea! Thanks @michi, awesome work!

Short question, may be somebody else has the same problem.

I installed the actual version from yesterday and the account goes online after adding that.

But the devices will not go online after adding them.

I added the serial number like in the app and all the Echos have the same issue: UNKNOWN

May be somebody has an Idea about that how to get the devices online?

Thanks a lit

Jan

There are two possibilities, you are using the wrong amazon domain or the serial number was not correct. Maybe you try to use the autodiscovery feature of the paperUI, than you could copy the serial from the discovered devices.

Hey Michi,

this was also something what I thought.

The Autodiscover didn´t worked, so may be the account is wrong. But all my devices are linked in the german account, I can see all my devices there and I also use this account in the settings.

Just an example:


I think usually it should work.

Pretty strange

It seems that there is still a Login Issue:
I have created a Things file on my Openhab Server. I set up some Items and a Rule for testing. No Logical errors in openhab. I Got some errors like that:

2018-04-02 22:37:40.946 [INFO ] [mazonechocontrol.handler.EchoHandler] - handleCommand fails: {}
org.openhab.binding.amazonechocontrol.internal.HttpException: PUT url 'https://alexa.amazon.de/api/notifications/createReminder' failed: Method Not Allowed
        at org.openhab.binding.amazonechocontrol.internal.Connection.makeRequest(Connection.java:351) [231:org.openhab.binding.amazonechocontrol:2.3.0.201803262113]
        at org.openhab.binding.amazonechocontrol.internal.Connection.makeRequestAndReturnString(Connection.java:476) [231:org.openhab.binding.amazonechocontrol:2.3.0.201803262113]
        at org.openhab.binding.amazonechocontrol.internal.Connection.notification(Connection.java:743) [231:org.openhab.binding.amazonechocontrol:2.3.0.201803262113]
        at org.openhab.binding.amazonechocontrol.handler.EchoHandler.handleCommand(EchoHandler.java:338) [231:org.openhab.binding.amazonechocontrol:2.3.0.201803262113]
        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) [109:org.eclipse.smarthome.core:0.10.0.b1]
        at org.eclipse.smarthome.core.internal.common.InvocationHandlerSync.invoke(InvocationHandlerSync.java:59) [109:org.eclipse.smarthome.core:0.10.0.b1]
        at com.sun.proxy.$Proxy132.handleCommand(Unknown Source) [231:org.openhab.binding.amazonechocontrol:2.3.0.201803262113]
        at org.eclipse.smarthome.core.thing.internal.profiles.ProfileCallbackImpl.handleCommand(ProfileCallbackImpl.java:72) [116:org.eclipse.smarthome.core.thing:0.10.0.b1]
        at org.eclipse.smarthome.core.thing.internal.profiles.SystemDefaultProfile.onCommandFromItem(SystemDefaultProfile.java:49) [116:org.eclipse.smarthome.core.thing:0.10.0.b1]
        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) [109:org.eclipse.smarthome.core:0.10.0.b1]
        at org.eclipse.smarthome.core.internal.common.Invocation.call(Invocation.java:53) [109:org.eclipse.smarthome.core:0.10.0.b1]
        at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:?]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?:?]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:?]
        at java.lang.Thread.run(Thread.java:748) [?:?]

I though it could have something to do with login errors, so i decided to call the URL mentioned in #1 to login via the addon. The Addon said, that the Login was possible and for a Minute the status was ONLINE. After that i received Login errors. Before performing the Login via Email the status was constantly ONLINE. After performing the Login i got some explicit Login Errors in Log:

2018-04-02 23:01:08.142 [INFO ] [mazonechocontrol.internal.Connection] - Login failed:{}
org.openhab.binding.amazonechocontrol.internal.ConnectionException: Login fails.
        at org.openhab.binding.amazonechocontrol.internal.Connection.makeLogin(Connection.java:422) ~[?:?]
        at org.openhab.binding.amazonechocontrol.handler.AccountHandler.checkLogin(AccountHandler.java:340) ~[?:?]
        at org.openhab.binding.amazonechocontrol.handler.AccountHandler.lambda$0(AccountHandler.java:286) ~[?:?]
        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:1142) [?:?]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:?]
        at java.lang.Thread.run(Thread.java:748) [?:?]

Let me know, if there is something i can try :slight_smile:

Hi stolly,
Thats interesting. I have not heard about such an issue yet, except one user which have used the wrong domain. The devices are listed as online in the settings-webpage?
Maybe your turn on the tracing for debug level, than it is possible to check the server answer for getting the device list.
Regards, Michael

Hi Dennis,
Method not allowed ist not a login issue. If other function works and only reminder and alarm sound does not work, your system time is maybe wrong. Because than the reminder will be created for a past time, and this fails.

Unfortunately, your try to login manually seem to rise a login problem (I will disallow this in a future version if a connection is still valid, so that other users did not run in the same problem). Have you seen the message “Login succeeded” in the last step of the manually login?

Regards,
Michael

Hi Michael,
thanks for your informative reply.
The System time is definitely correct. Another indicator for correct systemtime is, that for a short period i was able to send commands to my echo. Maybe the problem is that the time for the reminder really is in the past. But this would mean, that the command that is issued from my server has an older date than the echo, that received this command. hard to describe, but i mean the timestamp of issued command and received command. Could this be, when there is a hard delay at Alexa Service?
Current Systemtime:

openhab@NAS:~$ date
Tue Apr  3 21:11:33 CEST 2018

Okay, i will definitely try again without relogging in via your service :).

best regards

Until today everything worked perfect.
Login was done via thing-definition.
Today this startet:

2018-04-04 16:28:26.634 [INFO ] [mazonechocontrol.internal.Connection] - Login failed:{} 
org.openhab.binding.amazonechocontrol.internal.ConnectionException: Login fails.
	at org.openhab.binding.amazonechocontrol.internal.Connection.makeLogin(Connection.java:422) ~[?:?]
	at org.openhab.binding.amazonechocontrol.handler.AccountHandler.checkLogin(AccountHandler.java:340) ~[?:?]
	at org.openhab.binding.amazonechocontrol.handler.AccountHandler.lambda$0(AccountHandler.java:286) ~[?:?]
	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) [?:?]

Edit:
Interresting - it´s working again.
It was offline from13:45 until 17:28?!

1 Like

Hi stolly82,
I have added an diagnostic page now in beta 14. Open:
http://youropenhab:yourport/amazonechoncontrol//devices and send me the result in a private message.
Regards,
Michael

1 Like

Hi Dennis,

If the automatic login fails, you can try now again to use the proxy. I have fixed the problem, where the account goes offline after 1 minute. And I have added a message if the login is not necessary because the connection is already logged in.

Regards,
Michael

@michi

One thing what I noticed.

Everytime when you restart openhab and the bindings are starting, the binding tries to connect to amazon via api. In this moment I get direct 3 SMS with the secure code.
It looks like the session or browserid isn`t saved or is changed after restart.

I think for a stable version this could be bad cause you have to allow always the connection from amazons site.

Thanks by the way for that really good work!

Moment,… or may be this was also a issue last time,…
When I changed the thing file there was also the case that I got 3 SMS. Now it´s also gone.

Yes, the session will be stored. So restarts should not be a problem. But after 5 days I have to renew the session, I fear this will also trigger the SMS. Please inform me if this is true or not.

Regards,
Michael

After struggling a while

I can confirm that it is crucial to have the right order at the first login after the installation of the binding:

1.) install the binding
2.) enter the login info
3.) login will show an error
4.) open the login page on your openhab system - described in the account thing:
(http://openhabianpi:8080/amazonechocontrol/account1/)
5.) enter captcha
6.) enter security code - got via SMS etc.
7.) get the success message.

Thanks Udo for your instructions!

I recommend only a change in step 3:

1.) install the binding
2.) enter the login info in the Account thing configuration
3.) check if the Account thing is online,
if so, be happy :grinning: your are finished
if not :frowning_face: and a login fails is reported follow the steps below:
4.) open the login page on your openhab system - described in the account thing:
(e.g. http://openhabianpi:8080/amazonechocontrol/account1/)
5.) enter captcha
6.) enter security code - got via SMS etc.
7.) get the success message. (I hope so :wink:)

Regards,
Michael

1 Like

Does the setup work? Yes
Which amazon site does you use for the login? .de
Does all the channels works? not yet testeted all
Do you have wishes for new channels (All functions which are readable from the alexa web site should be possible to provide)? no
Do you understand german (because than we can communicate in the german)? yes

My Problem
If I discover for things,there is found one Amazon.Account and one Amazon.Konto What is going wrong? Also I have two flashbriefing things

Maybe i have the answer: Could it be my aws account?

Hello Christian,

I assume there is a bug with the localization in my binding. Just use one of them and ignore or remove the other one. There is no real discover for the account thing, I only create one hardcoded so that the user have a better experience because the binding is useless without an account thing.

Normally I create initial one flashbriefing, another will be detected if the flashbriefing configuration will be changed from the alexa app.

But anyway, this is not a problem. Only create as many as necessary. You can also create flashbriefing configurations manually for late use.

No

Kind regads,
Michael

New Feature is coming:

I hope that you could target specific devices with the announcements. Could be the long awaited TTS feature and even without repeating it twice and with “this is a reminder” ;D

If I’m not mistaken, this new feature takes your voice as input in order to broadcast the message (i.e. a recording), I don’t think there are TTS capabilities related to this.

Atleast here https://www.express.co.uk/life-style/science-technology/942708/Alexa-Announcements-Update-Amazon-Echo i read that you can use alexas voice

Those who don’t like the sound of their voice can choose to say, “Alexa, announce that dinner is ready,” and the smart assistant itself will repeat, “Dinner is ready” to connected speakers.

Just tried it, it uses a recording of my own voice…