Release Candidate and Support: Amazon Echo Control Binding

Hi Mike,
it should not be necessary to do something to reload the binding after reboot. I have tried a reboot in my installation and it works fine. So far as I know, only an openHAB upgrade forces a new installation of market place integration.
Which version of openHAB are you using?
Best Regards,
Michael

Hi jeshab,
I do not know the exact time, but at least after 14 days the binding fails without refreshing the session. Because I create the new session in the background and I keep running the old one while the new one does not work, I have enough time if amazon start showing the captcha.
I’am not sure what causes the showing of captcha and what does it stop. I know already that it will be also shown if there are to many login regardless if the fails or succeeded. This happens while my development because I restart openHAB for debugging reason very often, and so I started to persist the cookie. On the other side, users reported to me, that the login start working after several hours without any manual interaction. Maybe the internet provider changes the IP-Address (which happens in Austria typical every 24 hours for private internet accounts) and this causes the fix.
And it seems, that after the first login was succeeded, the captcha does not appear again for the session refresh every 5 days, but I’am not sure.
Currently I’am working on a feature, that the binding forwards the login dialog, so that the first login can be done with the original dialog, where the request to amazon will be started from the openHAB machine, so that it can be fixed if there is no NAT working and when the openHAB is working on an embedded system like a raspberry PI.
If you have any ideas what can help to make the login better, it would be nice. Maybe anyone could check if there is an special session refresh call in the browser without require enter the credentials.
Regards, Michael

1 Like

Is posible to send a notification command to alexa , I mean if i have the concept rules like that?

rule “test”
if myitem is “value_item”
then send reminder command ("Value is ‘value_item’ ")

How can we acheive that to insert a system value , like temperature for example in remainder message like this ( "Hey, the temperature is “value from openhab thermostat readings” )

My mistake. I rebooted and the binding still loaded. Thanks!

Many thanks for your effort and work, happy to have your binding working.

1 Like

Yes, something like this:

String Echo1remind { channel="amazonechocontrol:echo:account1:xxxxxxxxxxxx:remind"}
rule "test"
......
then

Echo1remind.sendCommand("Hey, the temperature is " + temperatureItem.state.toString + " degrees" )

Nice.I will try and come back here with news, thank you very much

Hi @michi, i have the same problem as @Ulrich_Giegerich. I have one Echo 1. Gen, and two Echo show. The “normal” Echo is online and works fine but the shows are getting an Error 409. I restarted several times but it does’nt work. I also got the same Error Message like Ulrich.
[WARN ] [g.discovery.internal.PersistentInbox] - Cannot create thing. No binding found that supports creating a thing of type amazonechocontrol:echoshow.

Uninstalled the binding yesterday and reinstalled ist after more than 12 hours. Added the account with the right credentials, getting now this error:

2018-03-14 15:20:02.792 [WARN ] [mazonechocontrol.internal.Connection] - Request to url ‘Amazon.de’ fails with unkown error: {}

java.net.MalformedURLException: no protocol: /ap/cvf/request?arb=7fa075d8-ea5e-4b93-b40b-ea4e91af806f

at java.net.URL.(URL.java:593) ~[?:?]

at java.net.URL.(URL.java:490) ~[?:?]

at java.net.URL.(URL.java:439) ~[?:?]

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

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

at org.openhab.binding.amazonechocontrol.internal.Connection.makeLogin(Connection.java:405) ~[?:?]

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) [?:?]

2018-03-14 15:20:02.827 [INFO ] [mazonechocontrol.internal.Connection] - Login failed:{}

java.net.MalformedURLException: no protocol: /ap/cvf/request?arb=7fa075d8-ea5e-4b93-b40b-ea4e91af806f

at java.net.URL.(URL.java:593) ~[?:?]

at java.net.URL.(URL.java:490) ~[?:?]

at java.net.URL.(URL.java:439) ~[?:?]

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

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

at org.openhab.binding.amazonechocontrol.internal.Connection.makeLogin(Connection.java:405) ~[?:?]

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) [?:?]

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

2018-03-14 15:20:02.874 [hingStatusInfoChangedEvent] - ‘amazonechocontrol:account:f4d1ba47’ changed from OFFLINE (COMMUNICATION_ERROR): no protocol: /ap/cvf/request?arb=f6236e27-1bb5-4076-8746-8c8774528142 to OFFLINE (COMMUNICATION_ERROR): no protocol: /ap/cvf/request?arb=7fa075d8-ea5e-4b93-b40b-ea4e91af806f

NEW BETA 12
Thank you for all of you which reports the bugs.

The new beta version should fixe the problem with the echoshow (I does not own a echo show device, so I can not test it. Please give me a feedback here!)

And I provide a new possibility for the login problem where a captcha (Entering some charaters whichs are shown to protect your account) was required. You can open the webbrowser to your openHAB installation and enter as URL /amazonechocontrol/YOUR_ACCOUNT_THING_ID (e.g. http://openhab:8080/amazonechocontrol/account). You will see a forwarded login dialog. There you can make your login through the binding and you can enter the captcha. After this login was succeed, your account thing should go online.

I do not know what happens after 5 days when the binding tries to refresh the login. I hope this does not require the captcha. Anyway, if the Account thing goes offline, you can repeat the login with the steps above.

This seems to be another error, you get redirect to a relative url while the login process. I have never seen this before but I tried to fix it. I don’t know if it works but please try it.

Happy testing everyone,
Michael

1 Like

Nice! It works! Have 2 Echo show now in my controll. Everything works fine.

1 Like

Hey Michael,
do you need anything? Some more detailed logs or something?

Tested around with the last build. Captcha thing seems to work. But running into the same problem with the relative path. thumbs up anyway for the captcha thing

Until it works, is there the possibility to get the Beta 9 link? It was the last version that worked for me.

Hi Michael,
I added 2 FireTV devices as type “unknown”.
These two devices are not working properly.
They will always be shown to me as OFFLINE.

Is there something to be aware of with the type “unknown”?

The Echo devices work great.

Greetings Thomas

Another log snippet. What version of openhab2 do you use Michael?

org.osgi.framework.BundleException: Could not resolve module: org.openhab.binding.amazonechocontrol [240]

Another singleton bundle selected: osgi.identity; type=“osgi.bundle”; version:Version=“2.3.0.201803142003”; osgi.identity=“org.openhab.binding.amazonechocontrol”; singleton:=“true”

at org.eclipse.osgi.container.Module.start(Module.java:444) [?:?]

at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1620) [?:?]

at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1599) [?:?]

at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1571) [?:?]

at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1514) [?:?]

at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1) [?:?]

at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230) [?:?]

at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340) [?:?]

Hi, sorry for the late answer, I was in holiday for the weekend. I use OH 2.2.

I have older builds, but I do not know which of them was beta 9. Anyway I think we should find the problem. Have you tried the new login method with the web-browser through the binding already?

This log look like, that the OH does not find the amazonechocontrol bundle itself. Have you installed it through the markt place or manually?

Regards,
Michael

Are the fireTV sticks listed in the alexa web app as online? What can you do with this devices in the alexa app? Are the found with the autodiscovery feature in the paperUI? If you have created them manually, you can try to create them as echo devices, technically there is currently no difference between these types, it’s planned for the future if I implement a channel for types which are not available in normal echo devices.

Kind regards,
Michael

Yep tried login through the new login method. but at the and i get an “not found” error similar to the other one.

Tried both installations, with uninstall after that. Perhaps there is a problem with the uninstall routine from the marketplace? Will look after remaining of old installations later.

Hi Michael,
I created the Fire TV devices in the Things.
I have both variants “echo” and “unknown”, unfortunately, both have the same effect. Autodiscover finds the two devices and lists them as “unknown”.

Both devices are also visible in the Alexa app.

Kind regards,
Thomas

Hello community,

Are there any other user with fireTV sticks?
Would be nice to here if you have the same experience

Best Regards, Michael

You can try to create it with the autodiscover feature, if this works you should check the serial number.

Are the fireTV sticks listed in the alexa web app as online?
What can you do with this devices in the alexa app?

Regards,
Michael

I’ve installed the binding from the marketplace.
Unfortunately I’m not able to login in the Amzon account thing.

The login on alexa.amazon.de does work - no special chars in username/pwd

This login:
http://openhabianpi:8080/amazonechocontrol/account
results in an error -->
HTTP ERROR 404
Problem accessing /amazonechocontrol/account. Reason: Not Found

restarting openhab delivers the error messages:

2018-03-22 20:52:52.170 [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) [?:?]

.....