Preview and Beta: Amazon Echo Control

Hey Tom,

Great job in fixing the many minor issues in the binding. I’ve been running it for a 5 hours and everything is working great! From what I can tell you have reduced/eliminated the need for the thread::sleep after the TTS commands when there is a bunch of different TTS commands being executed back to back?

This below is something I always had to create thread:sleep between the paragraphs because of the length and timing of it and now I don’t. BUT there is a strange long pause between the 2 TTS’s commands which I’m assuming your binding is doing? I’m NOT asking you to fix it because this is a one off with such a long TTS command. Just wanted to give you a heads up on it.

BTW, I’m running OH 2.4 with this binding w/o any issues.

Once again, great job!

Inventory_tAlive = createTimer(now.plusSeconds(1), [ |
					logInfo("tAlive" , "Inventory_tAlive timer ran out -> cancelling timer.")
	
					var smarthome1 = new StringBuilder()
					smarthome1.append("Welcome to our smart home that was established in 2018, , it continues to expand functionality on a monthly basis.  Our smart home consists of three wireless technologies, which are eight zero two dot eleven, , Zigbee, and Z Wave.")	
					smarthome1.append(" The First Wireless technology is, eight zero two dot eleven devices, which there are seventy seven devices active, , which uses three Ubiquiti unified access points, , located on each floor of the house.")
					smarthome1.append(" The I P wireless devices, , consist of Alexa smart speakers, Sonos speakers, Nest Smoke and C O 2 Detectors, , Samsung TVs, Ecobee Thermostats, Onkyo Receivers, H P Printers, , Wall Mounted Android Tablets, Chamberlin My Q Garage, Belkin WeMo plugs, ,")			
					smarthome1.append(" and Belkin WeMo light switches, Hick Vision Cameras, , Bond Fan Control, Ring Doorbell, and a Roomba vacuum cleaner.  The second Wireless technology is, Zigbee, used by Phillips HUE, which there are thirty two active devices, which")					

					var smarthome2 = new StringBuilder()
					smarthome2.append(" consists of light strips, motion detectors, lamps, and HUE remote controls. The Third Wireless technology is, Z Wave, which is being used by the vendor Aeotec, which there are twenty devices, which consists of light level detectors, humidity sensors, , motion sensors, temperature sensors, , and tilt sensors.")	
					smarthome2.append(" All three of these Wireless technologies, are controlled centrally by a platform called open HAB, , which does not require any cloud services to work, , and it keeps our data privately with in our home,") 
					smarthome2.append(" and open HAB talks directly to the local devices, whenever possible.  open HAB uses an event rule engine, that controls all these different wireless products, , based on our defined events detected.  This eliminates having numerous interfaces, , for each vendor and event.")  
					smarthome2.append(" Once again, , thank you for visiting our Smart home.")
					
					TheRoom_TTS.sendCommand(smarthome1.toString())
					TheRoom_TTS.sendCommand(smarthome2.toString())
		
					logInfo("ECHO", "Smart Home Inventory was said on " + TheRoom_TTS)
					logInfo("ECHO", "-----------------------------------------------------------------------------")

					Inventory_tAlive.cancel()
						Thread::sleep(1500) 
					Inventory_tAlive = null
				])

Best, Jay

i can confirm it solved my issue.Echo devices status reporting correctly now.
Thank you

Hello, with 2.5.10 my Habpanel no longer works. The message from the Habpanel is “connection lost trying to reconnect”.

an addition: I deleted the binding, all echo devices and the Amazon account. Then I reinstalled Binding 2.5.10. Immediately afterwards I can no longer use Habpanel, the message “connection lost …”.

Can someone help me?

Hello,
My Amazon Echo Control “was running” for months. For a few days now I have had the problem that I can no longer log into Amazon. I’ve already uninstalled the AmazonEchocontrol binding, installed the 2.5.10 snapshot … jar, and added a new Amazon account. But it’s still the same when I log on to http: // openhab: 8080 / amazonechocontrol / Amazon, the login works itself, amazon then sends a security link to my mobile phone. Before I can execute this link on my cell phone, the login window closes after about 5 seconds and I am directed back to the login window. What can I do?

Best Martin

Martin
I followed the exact same steps as you, uninstalled the binding, placed the 2.5.10 jar file in my addons folder then I browsed to alexa page in an internet browser on my computer. It allowed me to log on using my password, then made me change my password. Once I was able to log on with a browser, I tried again logging on at http: // openhab: 8080 / amazonechocontrol / Amazon and it worked

Try to enable 2 Factor authentication at your amazon account and then try to reestablish this functionality.

2 Likes

Thanks a lot. That was it.

using the 2.5.10 snapshot in a docker setup on a raspi4, i have the following issue:

devices connected through amazon are listed in the paperui inbox, but their capabilities like *:powerstate are not added when adding them as a thing.

i do have a pihole in the network serving as a local dns server, however the address in question is resolved fine from both the pi@raspi4 user as well as from inside the docker container for openhab:

pi@pi4:~ $ docker exec -it openhab sh -c "/bin/bash"
root@pi4:/openhab# nslookup alexa.amazon.de
Server:         192.168.*.3
Address:        192.168.*.3#53

Non-authoritative answer:
alexa.amazon.de canonical name = layla.amazon.com.
layla.amazon.com        canonical name = tp.799c43337-frontier.amazon.com.
tp.799c43337-frontier.amazon.com        canonical name = d3rsqup3tcxj1a.cloudfront.net.
Name:   d3rsqup3tcxj1a.cloudfront.net
Address: 13.35.254.173

could it be an issue with an AAAA (i.e. ipv6) record? because the pihole returns a cname for ipv4 just fine but an empty response for ipv6 for alexa.amazon.de

any idea how to troubleshoot?

logs about the issue:

2020-10-26 12:43:57.418 [WARN ] [mazonechocontrol.internal.Connection] - Request to url 'https://alexa.amazon.de/api/phoenix/state' fails with unknown error
java.net.UnknownHostException: alexa.amazon.de
	at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:184) ~[?:1.8.0_265]
	at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) ~[?:1.8.0_265]
	at java.net.Socket.connect(Socket.java:607) ~[?:1.8.0_265]
	at sun.security.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:284) ~[?:1.8.0_265]
	at sun.security.ssl.BaseSSLSocketImpl.connect(BaseSSLSocketImpl.java:173) ~[?:1.8.0_265]
	at sun.net.NetworkClient.doConnect(NetworkClient.java:180) ~[?:1.8.0_265]
	at sun.net.www.http.HttpClient.openServer(HttpClient.java:463) ~[?:1.8.0_265]
	at sun.net.www.http.HttpClient.openServer(HttpClient.java:558) ~[?:1.8.0_265]
	at sun.net.www.protocol.https.HttpsClient.<init>(HttpsClient.java:264) ~[?:1.8.0_265]
	at sun.net.www.protocol.https.HttpsClient.New(HttpsClient.java:367) ~[?:1.8.0_265]
	at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(AbstractDelegateHttpsURLConnection.java:191) ~[?:1.8.0_265]
	at sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1165) ~[?:1.8.0_265]
	at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1059) ~[?:1.8.0_265]
	at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:177) ~[?:1.8.0_265]
	at sun.net.www.protocol.http.HttpURLConnection.getOutputStream0(HttpURLConnection.java:1343) ~[?:1.8.0_265]
	at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:1318) ~[?:1.8.0_265]
	at sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream(HttpsURLConnectionImpl.java:264) ~[?:1.8.0_265]
	at org.openhab.binding.amazonechocontrol.internal.Connection.makeRequest(Connection.java:634) ~[?:?]
	at org.openhab.binding.amazonechocontrol.internal.Connection.makeRequestAndReturnString(Connection.java:555) ~[?:?]
	at org.openhab.binding.amazonechocontrol.internal.Connection.getSmartHomeDeviceStatesJson(Connection.java:1064) ~[?:?]
	at org.openhab.binding.amazonechocontrol.internal.handler.AccountHandler.updateSmartHomeState(AccountHandler.java:971) ~[?:?]
	at org.openhab.binding.amazonechocontrol.internal.handler.AccountHandler.lambda$2(AccountHandler.java:169) ~[?:?]
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_265]
	at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) [?:1.8.0_265]
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) [?:1.8.0_265]
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) [?:1.8.0_265]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_265]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_265]
	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_265]
2020-10-26 12:43:57.425 [WARN ] [trol.internal.handler.AccountHandler] - updateSmartHomeState fails with unexpected error
java.net.UnknownHostException: alexa.amazon.de
	at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:184) ~[?:1.8.0_265]
	at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) ~[?:1.8.0_265]
	at java.net.Socket.connect(Socket.java:607) ~[?:1.8.0_265]
	at sun.security.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:284) ~[?:1.8.0_265]
	at sun.security.ssl.BaseSSLSocketImpl.connect(BaseSSLSocketImpl.java:173) ~[?:1.8.0_265]
	at sun.net.NetworkClient.doConnect(NetworkClient.java:180) ~[?:1.8.0_265]
	at sun.net.www.http.HttpClient.openServer(HttpClient.java:463) ~[?:1.8.0_265]
	at sun.net.www.http.HttpClient.openServer(HttpClient.java:558) ~[?:1.8.0_265]
	at sun.net.www.protocol.https.HttpsClient.<init>(HttpsClient.java:264) ~[?:1.8.0_265]
	at sun.net.www.protocol.https.HttpsClient.New(HttpsClient.java:367) ~[?:1.8.0_265]
	at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(AbstractDelegateHttpsURLConnection.java:191) ~[?:1.8.0_265]
	at sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1165) ~[?:1.8.0_265]
	at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1059) ~[?:1.8.0_265]
	at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:177) ~[?:1.8.0_265]
	at sun.net.www.protocol.http.HttpURLConnection.getOutputStream0(HttpURLConnection.java:1343) ~[?:1.8.0_265]
	at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:1318) ~[?:1.8.0_265]
	at sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream(HttpsURLConnectionImpl.java:264) ~[?:1.8.0_265]
	at org.openhab.binding.amazonechocontrol.internal.Connection.makeRequest(Connection.java:634) ~[?:?]
	at org.openhab.binding.amazonechocontrol.internal.Connection.makeRequestAndReturnString(Connection.java:555) ~[?:?]
	at org.openhab.binding.amazonechocontrol.internal.Connection.getSmartHomeDeviceStatesJson(Connection.java:1064) ~[?:?]
	at org.openhab.binding.amazonechocontrol.internal.handler.AccountHandler.updateSmartHomeState(AccountHandler.java:971) ~[?:?]
	at org.openhab.binding.amazonechocontrol.internal.handler.AccountHandler.lambda$2(AccountHandler.java:169) ~[?:?]
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_265]
	at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) [?:1.8.0_265]
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) [?:1.8.0_265]
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) [?:1.8.0_265]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_265]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_265]
	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_265]

I am on OH3. Having the same issue that Amazon Skill devices are not updating the status on OH side. The debug log shows that polling is happing and results are accurate.

I want to ask if there is an equivalent version for OH3? i mean the snapshot versions? pls help

Hello, any feedback if there is a version for OH3?

The current version runs fine on OH3.

Hi @J-N-K, I am trying to see if the version linked by @Trinitus01 solves the issue of alexa smart home device states not being updated on OH side.

The linked version doesn’t seem to work for me on OH3. It seems to be installed but there are unmet dependencies (from OH2.x)

openhab> bundle:list 235
START LEVEL 100 , List Threshold: 50
 ID │ State     │ Lvl │ Version             │ Name
────┼───────────┼─────┼─────────────────────┼──────────────────────────────────────────────────
235 │ Installed │  80 │ 2.5.10.202009251451 │ openHAB Add-ons :: Bundles :: Amazon Echo Contro
openhab> bundle:start 235
Error executing command: Error executing command on bundles:
        Error starting bundle 235: Could not resolve module: org.openhab.binding.amazonechocontrol [235]
  Unresolved requirement: Import-Package: org.eclipse.smarthome.config.core

Any suggestions?

Hi @candiesdoodle, ho do I install the update?
thanks!

On 2.5.X?
Just follow the instructions in OP

Without changing the code, this will not work. I’ll check with @Trinitus01.

Thank you. looking forward to it

Hi folks, @J-N-K @Trinitus01, just circling back on this, any chance of releasing a OH3 version of the snapshot binding?

It looks like the Windows 10 Alexa app now supports Communications, so you can send a TTS using the Speak channel!

However… I don’t think this device type appears in the Discovery Inbox.

According to the /amazonechocontrol page, its device family is REAVER

If this could be added, that’d be fantastic! :smiley:

Thanks for the awesome work you’ve done on this binding - I use it daily to announce throughout the house when there’s 5 minutes until dinner, another when it’s being dished up, and if everyone still isn’t at the table, that dinner is on the table! It does help get both the small child and the aging in-laws moving towards the table so that there’s a chance their food will still be hot! :laughing:

Hello. Don’t mean to bother but if you could look into the state not updating issue for OH3, that will be helpful!

Hi there! TTS (and LastVoiceCommand) has worked for some time now for Alexa in the Alexa Windows 10 App. I don’t think we’re going to get a device family for “REAVER,” which seems to be a non-standard device type/is the same device type that appears when you login to your account via the Alexa Web App interface.

I discovered this functionality a while back and wrote a brief “how to”/summarized other findings about this for anyone else who was interested. The easiest thing to do is just add your Alexa Windows App “device” as an Echo Dot. A number of the features will work, but not all of course. I didn’t find it any more beneficial to add the Alexa Windows App device as an Echo Show over a Dot. There are other non-standard Alexa devices that can also be connected and setup this way, such as Fire HD tablets for example - you can capture "LastVoiceCommand"s and send TTS commands to these tablets as well. Also works for Fire TV devices.

More info here:

https://community.openhab.org/t/release-candidate-and-support-amazon-echo-control-binding/37844/1672?u=richaardvark

And here:

https://community.openhab.org/t/release-candidate-and-support-amazon-echo-control-binding/37844/1673?u=richaardvark