Release Candidate and Support: Amazon Echo Control Binding

Hi, yes because the errors seems to occure in the url at position 8179, I would need the url. Sent it to me as private message and maybe you can give me more details in which step it occurs. Have you seen the login dialog already? Have you entered your credentials?

That is exactly which should happen. But of course this should be the only one! Now the refresh token received from the login is stored instead of the credentials.

1 Like

Yeah thanks Michi :slight_smile:

It seem you have a problem with the DNS lookups on your system. This is not related to the binding. Please check your IP configuration.

I think it may have been because I had 2 factor enabled with the authenticator app. I tried again this morning with my password+6 digit authenticator code instead of just my password and it worked fine. I’ll still PM you the full log in case it helps. The error was when I went to the http://openhab/amazonechocontrol/accountThing and tried to log in at the alexa login screen. After I put in my credentials and hit log in, it was taking a while and finally giving me that error.

Hey Michael,

Same situation for the Echo Dot’s 2nd Gen in the US; still doesn’t work . . . but the login process is different because it’s NOT asking me to key in the captcha anymore.

Here’s some info to go on in order to debug.

This message was the same as the past Beta version:

2018-10-29 11:57:24.013 [INFO ] [.eclipse.smarthome.model.script.Echo] - ** Start of Echo Routine on Jays
2018-10-29 11:57:24.234 [ERROR] [nal.common.AbstractInvocationHandler] - An error occurred while calling method 'ThingHandler.handleCommand()' on 'org.openhab.binding.amazonechocontrol.handler.EchoHandler@1c42a167': POST url 'https://alexa.amazon.com/api/behaviors/preview' failed: Bad Request
org.openhab.binding.amazonechocontrol.internal.HttpException: POST url 'https://alexa.amazon.com/api/behaviors/preview' failed: Bad Request
	at org.openhab.binding.amazonechocontrol.internal.Connection.makeRequest(Connection.java:477) [195:org.openhab.binding.amazonechocontrol:2.4.0.201810281942]
	at org.openhab.binding.amazonechocontrol.internal.Connection.executeSequenceNode(Connection.java:942) [195:org.openhab.binding.amazonechocontrol:2.4.0.201810281942]
	at org.openhab.binding.amazonechocontrol.internal.Connection.executeSequenceCommand(Connection.java:930) [195:org.openhab.binding.amazonechocontrol:2.4.0.201810281942]
	at org.openhab.binding.amazonechocontrol.handler.EchoHandler.handleCommand(EchoHandler.java:337) [195:org.openhab.binding.amazonechocontrol:2.4.0.201810281942]
	at sun.reflect.GeneratedMethodAccessor141.invoke(Unknown Source) ~[?:?]
	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) [99:org.eclipse.smarthome.core:0.10.0.201805151356]
	at org.eclipse.smarthome.core.internal.common.InvocationHandlerSync.invoke(InvocationHandlerSync.java:59) [99:org.eclipse.smarthome.core:0.10.0.201805151356]
	at com.sun.proxy.$Proxy196.handleCommand(Unknown Source) [195:org.openhab.binding.amazonechocontrol:2.4.0.201810281942]
	at org.eclipse.smarthome.core.thing.internal.profiles.ProfileCallbackImpl.handleCommand(ProfileCallbackImpl.java:75) [106:org.eclipse.smarthome.core.thing:0.10.0.201805151356]
	at org.eclipse.smarthome.core.thing.internal.profiles.SystemDefaultProfile.onCommandFromItem(SystemDefaultProfile.java:49) [106:org.eclipse.smarthome.core.thing:0.10.0.201805151356]
	at sun.reflect.GeneratedMethodAccessor140.invoke(Unknown Source) ~[?:?]
	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) [99:org.eclipse.smarthome.core:0.10.0.201805151356]
	at org.eclipse.smarthome.core.internal.common.Invocation.call(Invocation.java:53) [99:org.eclipse.smarthome.core:0.10.0.201805151356]
	at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:?]
	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-10-29 11:57:27.028 [INFO ] [marthome.model.script.Startup Script] - -----------------------------------------------------------------------------
2018-10-29 11:57:27.034 [INFO ] [marthome.model.script.Startup Script] -  Startup Script Done with - Echo Speaks if Jay is home
2018-10-29 11:57:27.035 [INFO ] [marthome.model.script.Startup Script] - -----------------------------------------------------------------------------
2018-10-29 11:57:27.179 [ERROR] [nal.common.AbstractInvocationHandler] - An error occurred while calling method 'ThingHandler.handleCommand()' on 'org.openhab.binding.amazonechocontrol.handler.EchoHandler@1c42a167': POST url 'https://alexa.amazon.com/api/behaviors/preview' failed: Bad Request
org.openhab.binding.amazonechocontrol.internal.HttpException: POST url 'https://alexa.amazon.com/api/behaviors/preview' failed: Bad Request
	at org.openhab.binding.amazonechocontrol.internal.Connection.makeRequest(Connection.java:477) [195:org.openhab.binding.amazonechocontrol:2.4.0.201810281942]
	at org.openhab.binding.amazonechocontrol.internal.Connection.executeSequenceNode(Connection.java:942) [195:org.openhab.binding.amazonechocontrol:2.4.0.201810281942]
	at org.openhab.binding.amazonechocontrol.internal.Connection.executeSequenceCommand(Connection.java:930) [195:org.openhab.binding.amazonechocontrol:2.4.0.201810281942]
	at org.openhab.binding.amazonechocontrol.internal.Connection.textToSpeech(Connection.java:921) [195:org.openhab.binding.amazonechocontrol:2.4.0.201810281942]
	at org.openhab.binding.amazonechocontrol.handler.EchoHandler.startTextToSpeech(EchoHandler.java:640) [195:org.openhab.binding.amazonechocontrol:2.4.0.201810281942]
	at org.openhab.binding.amazonechocontrol.handler.EchoHandler.handleCommand(EchoHandler.java:527) [195:org.openhab.binding.amazonechocontrol:2.4.0.201810281942]
	at sun.reflect.GeneratedMethodAccessor141.invoke(Unknown Source) ~[?:?]
	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) [99:org.eclipse.smarthome.core:0.10.0.201805151356]
	at org.eclipse.smarthome.core.internal.common.InvocationHandlerSync.invoke(InvocationHandlerSync.java:59) [99:org.eclipse.smarthome.core:0.10.0.201805151356]
	at com.sun.proxy.$Proxy196.handleCommand(Unknown Source) [195:org.openhab.binding.amazonechocontrol:2.4.0.201810281942]
	at org.eclipse.smarthome.core.thing.internal.profiles.ProfileCallbackImpl.handleCommand(ProfileCallbackImpl.java:75) [106:org.eclipse.smarthome.core.thing:0.10.0.201805151356]
	at org.eclipse.smarthome.core.thing.internal.profiles.SystemDefaultProfile.onCommandFromItem(SystemDefaultProfile.java:49) [106:org.eclipse.smarthome.core.thing:0.10.0.201805151356]
	at sun.reflect.GeneratedMethodAccessor140.invoke(Unknown Source) ~[?:?]
	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) [99:org.eclipse.smarthome.core:0.10.0.201805151356]
	at org.eclipse.smarthome.core.internal.common.Invocation.call(Invocation.java:53) [99:org.eclipse.smarthome.core:0.10.0.201805151356]
	at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:?]
	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) [?:?]

Here’s your Amazon account login screen results. As you can see the Echo’s share the same family ID and so does the Echo Dots.

Device		Serial Number	State	Thing	Type	Family
Ryan Room	G090LF107xxx	Online	Alexa	ECHO	A3S5BH2HU6Vxxx	
Loft		        G090LF107xxx	Online	Alexa	ECHO	A3S5BH2HU6Vxxx	
Parker Room	G090LF107xxx	Online	Alexa	ECHO	A3S5BH2HU6Vxxx	
Garage		G090LF117xxx	Online	Alexa	ECHO	A3S5BH2HU6Vxxx	
Gym Echo	G090LF107xxx	Online	Alexa	ECHO	A3S5BH2HU6Vxxx	
Tricias Office   G090LF107xxx	Online	Alexa	ECHO	A3S5BH2HU6Vxxx	
Guest Bd	        G090LF097xxx	Online	Alexa	ECHO	A3S5BH2HU6Vxxx	
Jays Office	G090LF107xxx	Online	Alexa	ECHO	A3S5BH2HU6Vxxx	
Kitchen		B0F007125xxx	Online	Alexa	ECHO	AB72C64C86xxx	<-- Regular Echo
Jays Work	G090LF107xxx	Online	Alexa	ECHO	A3S5BH2HU6Vxxx	
Basement	G090LF10xxxx	Online	Alexa	ECHO	A3S5BH2HU6Vxxx	
Bedroom		90F00718xxxx	        Online	Alexa	ECHO	AB72C64C86xxx	<-- Regular Echo

All the rest of them above are Echo Dot''s 2nd Generation

Here’s my rule triggering the TTS -Living Room works (Echo Device) - Jays Office doesn’t (Echo Dot). I have also insured it’s not just tied to my Echo Dot unit in my office to rule that out.

	    	logInfo("Echo", "** Start of Echo Routine on Living Room")
	    	Echo_Living_Room_Volume.sendCommand('30')
			Thread::sleep(3000)  // 3 second wait
	    	Echo_Living_Room_TTS.sendCommand("Excuse me folks, Open HAB has started back up.")

    		logInfo("Echo", "** Start of Echo Routine on Jays")
 	    	Echo_Jay_Volume.sendCommand('50')
			Thread::sleep(3000)  // 3 second wait
 	    	Echo_Jay_TTS.sendCommand("   Excuse me folks, Open HAB has started back up.")

I’m still using your original THING definition which has the user/pass in it. You may want to update your docs to let us know what we should change the format to since your latest version doesn’t require it in the THING file anymore.

Let me know if you need anything else from me?

Best, Jay

Hi Mr. Wiseman,
that is really bad, because I can’t help for this issue. The problem is, that the request itself is correct, but it seems that amazon have changed the api for this. But I do not know how it is changed, this can only be resolved by getting the network traffic from the alexa app, and this is a complicated task.

But let us verify if the problem is only a problem in the binding. Please create a routine in your alexa app which speak some text and start the preview function.

If this work, it could be fixed with help from other users. Otherwise we have to wait for a fix from amazon.

Best regards,
Michael

Could you please provide some details on the issue(s) you’re having supporting the recent snapshots? In my testing so far, everything looks to be working correctly with snapshot 1390 (thank you!) using gen 2 Dots in the US.

I started with brand new Things, and followed the steps in the first post. Previous versions of this binding were not working for me due to auth issues.

I had the same issue as I also have 2 factor authentication enabled on my Amazon account. Adding the authentication code to my password did the trick. I am connecting to the US server.

@michi Thanks for all the work you have done on this binding. I was just wondering if this is how you intended for 2 factor authentication to be support with the latest beta release?

Hi Scott,
I have not tested it yet and it could happen the changes in the core requires recompilation of the binding. It’s good to know that it is working! Anyway, I will provide a tested and compiled against the daily snapshot version jar in some days.
Best regards,
Michael

1 Like

This should not make any difference, the configuration data will be ignored from the binding.

No, it’s not, I think I have to check was going on. But thanks for the information of the workaround by using the authentication code in the password for 2 factor authentication users!

Hi Michael,

I’m not seeing the Preview option in the App after creating a new routine. All I have is Alexa Says, Audio Control, Calendar, Messaging, Music, News, Smart Home, Traffic and Weather.

I Google’d the “alexa preview functions” and this came up; not sure if your aware of it or not?

Best, Jay

Hi Mr. Wiseman,
sorry for my not matching instructions.

  1. Create a routine (e.g. Alexa Says, select any text or enter your own)
  2. Click on the 3 dots
  3. Click on ‘Play routine’
  4. Select your device

Thank you for testing!

Best regards,
Michael

Confirmed DNS issue - sorry for the red herring

Hey Michael,

It worked . . .

Created a routine “Alexa, test routine” which Alexa will “Tell you something New” and then I followed your instructions and it played on the Echo Dot w/o any issues.

What else can I do to help you debug this issue with Echo Dots? I’m aware from the other posts on this thread that Echo Dot’s v2 and v3 in the US aren’t working right now. Gotta be tied to a different API interface for them than the normal Echo’s use.

I wish I could ship you one of my Echo Dot’s :wink:

Best, Jay

I have been using the binding for a while for TTS, however recently I got a fire cube aswell. I also have some firestick laying around. Will it be possible to use these? Can we send webpage/video to these devices?

Is it possible to play TTS on groups? I can not seem to find the serial numbers for groups in the alexa app.

No, but it can be used for testing. I will send you a private message.

I don’t know what can be done with these devices because I don’t own them.
Is there something what you can do from the alexa app? Maybe control of volume?
The you can define them as echo. If you give me feedback which channels are working, I could provide a nativ thing type for them.

Same question as above. Can this be done from the alexa app? If yes, it would be possible to support it.

There is no direct API to do this. Currently you can do this by sending the TTS to each device of the group. Maybe I will support this in the future by doing the sending to the devices from the binding.

You can use the autodiscover feature of the PaperUI to create things. Another possibility is using the proxy server. There is a page with the devices and serials. Take a look in the readme in the first topic.

Best regards,
Michael

Hi,
I have added a link for 2.4 snapshot users in the top most posting for the current beta.
Best regards,
Michael

2 Likes