Preview and Beta: Amazon Echo Control

https://janessa.me/esh/org.openhab.binding.amazonechocontrol-2.5.7-SNAPSHOT.jar

is a test jar to fix the “Too many requests” issue based on https://github.com/openhab/openhab-addons/pull/8090. I would especially like to hear from those that use the smartdevice features if we did break something or if it is still all running. Thanks.

1 Like

I’ve hit a mean error testing this but frankly I don’t know if it’s caused by the binding.
I haven’t been trying this binding for long but I had it working a couple of days ago.

Problem is the Amaz*n account thing is “offline - configuration pending” and when I try to log into the Alexa account via <openhabip>/amazonechocontrol, it’s not working, Amaz*n always keeps telling me

There was a problem
Enter a valid email or mobile number

although the binding log below suggests it has worked ?

2020-07-11 22:42:05.093 [DEBUG] [mazonechocontrol.internal.Connection] - Make request to https://www.amazon.com/ap/signin/146-999999-1056131
2020-07-11 22:42:05.098 [DEBUG] [mazonechocontrol.internal.Connection] - POST: openid.return_to=ape%3aR0cHM6Ly93d3cuYW1hem9uLmNvbS9hcC9tYXBsYW5kaW5n&prevRID=ape%3AUUUjc0UkRZQ0hDUTNJIR1E%3D&metadata1=ECdITeCs%3ALztbg5yFkI8f%2Fv8Y8701dIUljnvpd80faBgpywcKIJ0VThyF9olvkkoNfocDUD8qLFlslvD2Gfdx%2BLLNq7iKPES%2F4in6LqKoRDHuQKx1GEsvDqku1yjUebnRXvOaypKlxNzFB1Gca%2B2HsaiHuZxmlZuR3vD%2BbF4kw14LUBGLdCYGF8k6VCRDBLa9lJWmIpc8nMzeiQPFQSSX6va3xtVMJGa5esry0KW8DczMf7O9N0PAvF9ReuNMhs%2BN5MunsxiSn6d3dtcHEGwhWrVlsaTqEmJi97I5ZUAnkWZSwxWzLC7DzegvgGBSINtxzfmnqLkGz3mmW%2FDdEhCFc8yoyJzgaSxC0u%2B7EPYAEyjNWXfKZJRCguunWlLI0Nuwn%2FBqPf8Iz27EKrfSef%2FHuC7sWseKBT800zOyt7s7VnmXW6FpGdRiMntHgt2bYSkO8p2hyUISaVFs6Krz%2AkqXRxRIPAXsCLQV1DbIAaEsRQ5x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xCc9w7j8Jnc65rkUeQjl3Gk5bJ0zg5oihUfJ09o3SbIrXbEf4xVriltibjhwMtK3nLHWxKWPIXsSabBmKrsyD9rBSP7bGoLbkDEJPPe0bL83Th3vFnvYd48uuEKFTVGCcFusVGvIGQ45ed6XsPlsIQj1HDRlbRWd1xsqmtLJWVLUvZ9JpJOHpd02o0g7d0tfiLPssdZ8KsebTFzlj6bNvzTUJzbPOFqKGZs6zvFdWCgU2Nj8edA4Ddu%2Ba86nae9PffQkQysAl7eWgdbwipG20KJj7KBfS0Ma4qp3pijzfwhLksbAgAAAAAMAAAADAAAAAAAAAAAAAAAAJ5kACswTxd4VG5UP1uYABf%2F%2F%2F%2F%2FAAAAAQAAAAAAAAAAAAAAAQAAAAuXvTsWLBTvmZx61EeJ%2BY15kLgmAIjNMQDyb5M%3D&showPasswordChecked=false&email=john%40doe.org&encryptedPasswordExpected=
2020-07-11 22:42:06.265 [DEBUG] [amazonechocontrol.internal.Connection] - Call to https://www.amazon.com/ap/signin/146-999999-1056131 succeeded

Loggin’ in directly works meanwhile so it isn’t a principal issue with the account.
I also noticed the log output below, followed by a large dump of an Amaz*n web page with lots of JS

2020-07-11 22:41:44.283 [DEBUG] [nechocontrol.internal.AccountServlet] - doGet /
2020-07-11 22:41:44.286 [DEBUG] [mazonechocontrol.internal.Connection] - Start Login to https://alexa.amazon.com
2020-07-11 22:41:44.290 [DEBUG] [mazonechocontrol.internal.Connection] - Make request to https://www.amazon.com/ap/signin?openid.return_to=https://www.amazon.com/ap/maplanding&openid.assoc_handle=amzn_dp_project_dee_ios&openid.identity=http://specs.openid.net/auth/2.0/identifier_select&pageId=amzn_dp_project_dee_ios&accountStatusPolicy=P1&openid.claimed_id=http://specs.openid.net/auth/2.0/identifier_select&openid.mode=checkid_setup&openid.ns.oa2=http://www.amazon.com/ap/ext/oauth/2&openid.oa2.client_id=device:486674855102726337530440445246810355650135167622600456254077041323413249564c5635564d32573831&openid.ns.pape=http://specs.openid.net/extensions/pape/1.0&openid.oa2.response_type=token&openid.ns=http://specs.openid.net/auth/2.0&openid.pape.max_auth_age=0&openid.oa2.scope=device_auth_access
2020-07-11 22:41:44.834 [DEBUG] [mazonechocontrol.internal.Connection] - Call to https://www.amazon.com/ap/signin?openid.return_to=https://www.amazon.com/ap/maplanding&openid.assoc_handle=amzn_dp_project_dee_ios&openid.identity=http://specs.openid.net/auth/2.0/identifier_select&pageId=amzn_dp_project_dee_ios&accountStatusPolicy=P1&openid.claimed_id=http://specs.openid.net/auth/2.0/identifier_select&openid.mode=checkid_setup&openid.ns.oa2=http://www.amazon.com/ap/ext/oauth/2&openid.oa2.client_id=device:486674855102726337530440445246810355650135167622600456254077041323413249564c5635564d32573831&openid.ns.pape=http://specs.openid.net/extensions/pape/1.0&openid.oa2.response_type=token&openid.ns=http://specs.openid.net/auth/2.0&openid.pape.max_auth_age=0&openid.oa2.scope=device_auth_access succeeded
2020-07-11 22:41:44.870 [DEBUG] [mazonechocontrol.internal.Connection] - Result of GET https://www.amazon.com/ap/signin?openid.return_to=https://www.amazon.com/ap/maplanding&openid.assoc_handle=amzn_dp_project_dee_ios&openid.identity=http://specs.openid.net/auth/2.0/identifier_select&pageId=amzn_dp_project_dee_ios&accountStatusPolicy=P1&openid.claimed_id=http://specs.openid.net/auth/2.0/identifier_select&openid.mode=checkid_setup&openid.ns.oa2=http://www.amazon.com/ap/ext/oauth/2&openid.oa2.client_id=device:486674510272633753044044524681050135167622600454077041323413249564c5635564d32573831&openid.ns.pape=http://specs.openid.net/extensions/pape/1.0&openid.oa2.response_type=token&openid.ns=http://specs.openid.net/auth/2.0&openid.pape.max_auth_age=0&openid.oa2.scope=device_auth_access:

That‘s not a problem of the recent changes. It‘s not working with the older one either.

It worked a couple of days ago. And doesn’t it need to work for the whole binding to work ?

@J-N-K

Thanks for the update. Just did a quick test in-flight (deleted previous jar. added new jar. restarted bundles). The prelim result is everything is looking good so far. I was able to add things from the inbox and the special features (alexa guard) are working.

This is in-flight, so previous authenticated session was untouched.

This is on latest OH snapshot 2.5.7

I will do a full restart later and monitor the logs and report back after it has some time to run.

I’m having troubles with this latest 2.5.7 SNAPSHOT version. My “LastVoiceCommand” items are very delayed to load. And TTS isn’t working half the time :frowning:

No errors in the log though…

Edit: It’s working but is very slow.

Can you explain a little bit more what exactly is „very slow“?

TTS isn’t working for me either. No errors in the log that I can see.

Here’s one example where a rule triggers a TTS Opening Garage. Event shows, but nothing happens (no activity on alexa).

events.log

2020-07-11 23:43:25.101 [ome.event.ItemCommandEvent] - Item 'Echo_Kitchen_TTS' received command <speak>Opening Garage</speak>

openhab.log

2020-07-11 23:43:26.175 [DEBUG] [control.internal.handler.EchoHandler] - Handle updateState amazonechocontrol:echo:account1:echo2
2020-07-11 23:43:26.179 [DEBUG] [mazonechocontrol.internal.Connection] - Make request to https://alexa.amazon.com/api/np/player?deviceSerialNumber=xxxxxxxxxxxxxxxxxxxxx&deviceType=A7WXQPH584YP&screenWidth=1440
2020-07-11 23:43:34.661 [DEBUG] [trol.internal.handler.AccountHandler] - updateSmartHomeState started
2020-07-11 23:43:44.664 [DEBUG] [trol.internal.handler.AccountHandler] - updateSmartHomeState started
2020-07-11 23:43:54.669 [DEBUG] [trol.internal.handler.AccountHandler] - updateSmartHomeState started
2020-07-11 23:43:54.679 [DEBUG] [mazonechocontrol.internal.Connection] - Make request to https://alexa.amazon.com/api/phoenix/state
2020-07-11 23:43:54.690 [DEBUG] [mazonechocontrol.internal.Connection] - POST: {"stateRequests":[{"entityId":"AAA_OnGuardSmartHomeBridgeService_ec973aae-01de-3a52-a464-e1f13007ada1","entityType":"APPLIANCE"}]}
2020-07-11 23:43:55.041 [DEBUG] [mazonechocontrol.internal.Connection] - Call to https://alexa.amazon.com/api/phoenix/state succeeded
2020-07-11 23:43:55.048 [DEBUG] [mazonechocontrol.internal.Connection] - Result of POST https://alexa.amazon.com/api/phoenix/state:{"deviceStates":[{"entity":{"entityId":"AAA_OnGuardSmartHomeBridgeService_ec973aae-01de-3a52-a464-e1f13007ada1","entityType":""},"capabilityStates":["{\"namespace\":\"Alexa.SecurityPanelController\",\"name\":\"armState\",\"value\":\"DISARMED\",\"timeOfSample\":\"2020-07-12T06:43:54.999Z\",\"uncertaintyInMilliseconds\":0,\"deepQuery\":true,\"timeOfStateChange\":\"\"}"],"error":null}],"errors":[]}
2020-07-11 23:43:55.053 [DEBUG] [trol.internal.handler.AccountHandler] - updateSmartHomeState finished
2020-07-11 23:44:05.058 [DEBUG] [trol.internal.handler.AccountHandler] - updateSmartHomeState started
2020-07-11 23:44:13.989 [DEBUG] [trol.internal.handler.AccountHandler] - check login amazonechocontrol:account:account1
2020-07-11 23:44:13.995 [DEBUG] [trol.internal.handler.AccountHandler] - checkData amazonechocontrol:account:account1 finished
2020-07-11 23:44:15.069 [DEBUG] [trol.internal.handler.AccountHandler] - updateSmartHomeState started
2020-07-11 23:44:25.079 [DEBUG] [trol.internal.handler.AccountHandler] - updateSmartHomeState started
2020-07-11 23:44:25.086 [DEBUG] [mazonechocontrol.internal.Connection] - Make request to https://alexa.amazon.com/api/phoenix/state
2020-07-11 23:44:25.093 [DEBUG] [mazonechocontrol.internal.Connection] - POST: {"stateRequests":[{"entityId":"AAA_OnGuardSmartHomeBridgeService_ec973aae-01de-3a52-a464-e1f13007ada1","entityType":"APPLIANCE"}]}
2020-07-11 23:44:25.442 [DEBUG] [mazonechocontrol.internal.Connection] - Call to https://alexa.amazon.com/api/phoenix/state succeeded
2020-07-11 23:44:25.448 [DEBUG] [mazonechocontrol.internal.Connection] - Result of POST https://alexa.amazon.com/api/phoenix/state:{"deviceStates":[{"entity":{"entityId":"AAA_OnGuardSmartHomeBridgeService_ec973aae-01de-3a52-a464-e1f13007ada1","entityType":""},"capabilityStates":["{\"namespace\":\"Alexa.SecurityPanelController\",\"name\":\"armState\",\"value\":\"DISARMED\",\"timeOfSample\":\"2020-07-12T06:44:25.402Z\",\"uncertaintyInMilliseconds\":0,\"deepQuery\":true,\"timeOfStateChange\":\"\"}"],"error":null}],"errors":[]}
2020-07-11 23:44:25.453 [DEBUG] [trol.internal.handler.AccountHandler] - updateSmartHomeState finished
2020-07-11 23:44:35.456 [DEBUG] [trol.internal.handler.AccountHandler] - updateSmartHomeState started
2020-07-11 23:44:45.465 [DEBUG] [trol.internal.handler.AccountHandler] - updateSmartHomeState started
2020-07-11 23:44:46.859 [DEBUG] [control.internal.handler.EchoHandler] - Handle updateState amazonechocontrol:echo:account1:echo2
2020-07-11 23:44:46.862 [DEBUG] [mazonechocontrol.internal.Connection] - Make request to https://alexa.amazon.com/api/np/player?deviceSerialNumber=xxxxxxxxxxxxxxxxxxxxx&deviceType=A7WXQPH584YP&screenWidth=1440

Hi @richaardvark,

thanks for the feedback.
Can you please provide the part of the rule where you send the TTS, the timespan between the item changed and the output was done in the previous version and the timespan in the new test version? To prevent the “too many requests”-issue it is necessary to queue the requests, else requests will interrupt each other or ends in “too many requests”. So it depends on how many requests are in the queue until the one you waiting for is processed. This can produce a delay. Maybe it is possible to reduce the delay if we know the delay before and after the update of the new test version.

1 Like

@mstormi: Agreed, the login problem needs a solution. But it is not related to the last update. It happened with 2.5.5 and 2.5.6, so there is some other issue. The interesting thing is, that it succeeded for me a couple of minutes ago from 2.5.7-SNAPSHOT running on Windows 10. Maybe it’s browser related?

@roy_liao: I just tried sending <speak>Test</speak> to the textToSpeech channel and the output was immediately coming from my Echo Dot.

I was able to reproduce the issue. After a restart of openHAB it worked again. So there is something which stop the tts process. We will take a look as soon as possible.

To the login problem, Amaz*on changed something on the server side, again.

Sound like unblocking is not working in all cases.

@J-N-K
have you seen this question ?

No. And frankly, I don‘t know why it failed for me on 2.5.6 some days ago and succeeded on 2.5.7 today. There were no code changes. I believe it has nothing to do with our code.

Tested lastVoiceCommand and the timespan was less than 1 or maybe 2 seconds.

No as it works from the same browser to directly log into alexa.amazon.de[com]
I used Firefox and new MS Edge, SSL or without, NGINX inbetween or not - no difference.
So it likely has to do with HTTP headers (or maybe there’s some JavaScript execution )? or the like but it ain’t browser specific.
TTS doesn’t work for me either (but I expect the login needs to work first anyway for that as I don’t have any authenticated session “left”).

You can login to alexa.amazon.com from your browser? For me that fails and I am redirected to alexa.amazon.de and then it works.

Maybe that is our problem: we always try to sign-in on amazon.com. Maybe they made login depending on the site where you originally registered?

Edit: using Firefox/Win

Err no I always use .de as well.

Possibly so, or as … .de and … .com are completely different systems, it could be an unintended side effect. Either way that’s a proper explanation.
You should make the URL OH logs into via binding a configuration option.

If TTS doesn’t work, can you please set the ttsvolume for the device and try again? That would be very helpful.