Preview and Beta: Amazon Echo Control

Thanks so much to @J-N-K for rebuilding this. I’ve been on the September 2019 version on OH 2.5 for a long while until the recent problems.

I tried this updated JAR last night but couldn’t get it working. After clearing cache and tmp, the binding still errored out saying no account thing existed. I didn’t get to focus on troubleshooting the logs yet, so I’ll try again soon.

For reference, when I updated to the JAR from the mainline thread, it worked ok as a drop in replacement.

Does the just released version in 2.5.6 have the issue fixed ? The release notes at least indicate this.

The websocket issue yes (at least in part), the beta changes are not included.

So it should at least be usable without the memleak ?

Yes. There is still the „too many requests“ issue that was present in the past, but the websocket connection should reconnect and not leak memory.

1 Like

Just wanted to make sure you saw the error log data I posted above - does it seem like I pulled the right log details to troubleshoot what is causing the issue(s)?

For the memory leak, it’s suggesting I "set the OkHttpClient logger level to FIN
E: Logger.getLogger(OkHttpClient.class.getName()).setLevel(Level.FINE);" but I’m not entirely certain how one does that - do I perhaps modify a .config file somewhere?

Also, it looks like @Andrew_Rowe already helped to find a solution for this very same problem about a month ago, so I am going to try the solution in this post and see if that helps.

I do remember a while back when many of us suddenly started having rate limit issues because of too many requests for TTS in a short amount of time. I have no clue what I’m talking about, but I guess this is too many requests to retrieve the device statuses and LastVoiceCommand data from the Amazon servers? Can we slightly slow down the rate at which the system is requesting this data? Or is the issue with authentication or something like that perhaps?

One last question (sorry!) but I never really know which option to select here when setting up the Amazon Account Thing for the binding - could these settings possibly have any impact on our error?

1 Like

@richaardvark - just trying to work out where you are at with this - have you installed the new jar, AND have your smartdevices discovered, added and controllable with known types?

I can discover them but getting a conflict when trying to add and all are showing as unknown

I discussed the „Too many requests“ issue with @Trinitus0, who had a closer look in that in the past. It seems that is caused by the way some commands are sent. If I understood him correctly, this can be solved but behavior of some features will change. That‘s why I‘m not 100% sure it should be merged to 2.5.x. Depends on the number of Affected users in both cases.

You need to provide logs otherwise I can’t help you.

Sorry @J-N-K was just seeing if everythign was actually working without diving in.

basic logs - I can up the level if you need more?

2020-06-22 15:02:41.970 [ERROR] [home.core.thing.binding.ThingFactory] - Thing factory (class org.openhab.binding.amazonechocontrol.internal.AmazonEchoControlHandlerFactory) returned null on create thing when it reports to support the thing type (amazonechocontrol:smartHomeDevice).

2020-06-22 15:02:41.971 [WARN ] [g.discovery.internal.PersistentInbox] - Cannot create thing. No binding found that supports creating a thing of type amazonechocontrol:smartHomeDevice.

Is that the latest version? There seems to be something really wrong.

320 │ Active │ 80 │ │ openHAB Add-ons :: Bundles :: Amazon Echo Control Binding

Im sorry I am not sure how to tell - I have put the JAR ending in f1 in the addons folder and restarted the service

upping logging to Debug only shows this regularly

2020-06-22 15:31:09.384 [DEBUG] [trol.internal.handler.AccountHandler] - updateSmartHomeState started

The previous errors were when an unknown discovered smart home thing attempts to be added from the inbox in paperUI - results in an Error 409 - Conflict message

That seems to be the correct bundle. I’ll check later today what might have happened, but I think the handler factory should support creating those things.

1 Like

Please try <link removed, see below>, I have simplified the bundle activation, maybe it was a lifecycle issue.

Hello! Just waking up over here in the US. I’ll try the updated jar right now and will report back!

@Andrew_Pawelski, yesterday I did have the SmartHomeDevices working briefly but then after a Linux system update and then a reboot it was no longer working and there were suddenly memory leak problems.

@J-N-K, I think I am having problems with one other thing here that is impacting all of this. I remember that yesterday when I updated my addons folder with your “f1” version of the binding, after cleaning cache and restarting everything a number of times, when I went to the “http://localhost:8080/amazonechocontrol/” link, I remember seeing that it still said “Amazon Echo Control 2019-10-23” at the top of the page in the big black title on top. And even now when I pulled up openHAB for the first time today (though it has been running all night) when I login to that page it says “No Account Thing Created” even though there is an Account thing for Amazon Echo Control in my PaperUI. I seem to have difficulty getting the system to reissue/recheck the Amazon credentials. I think it’s probably caused by my specific web browser and page cache issues. I have tried looking at this issue with multiple browsers (Chrome, Firefox, Opera - which I think is basically Chrome) and have noticed slightly different behaviors in each but none are working as they should. Right now, If I look at the Amazon Account Thing which was setup and logged in to my Amazon account for the “f1” jar version, it is currently black and not online and says “not initialized,” but I know my Amazon account is still logged in. I have no way to log out from it though. Often, when I drop the new jar in, the “/amazonecholcontrol” page will load, and will show my devices, but then won’t recognize my “amazonechocontrol.things” file and lists all of my Echo devices but shows there are no openHAB items created for each device which is not the case. Every time I update the binding, I first stop the system, then clean the cache and update the binding jar file, then restart openHAB usually three times, then reboot the machine once. Should I be doing something differently when I update the binding? I may try using a browser in “incognito” mode to see if that helps. Also, I may try deleting the Amazon Account Thing and adding it back with a new ID instead of pasting in my previous ID. I then will have to use “Find and Replace” in Visual Studio Code to update that ID in my .things and .items files but it is easy enough to do.

I will update the binding now and report back after I’ve restarted/rebooted - be right back!

Edit: Oh… one last question about file permissions and ownership for the jar files in the addons folder - I noticed that when I dropped my new jar in last time that the amazonechocontrol jar binding was showing as being owned by “root” with read-only permission for everyone. Should all jar files be owned by the “openhab” user, and should they all be read/write permitted for everyone? Thanks!

Edit: Here is a picture of my /amazonechocontrol page showing where it is not recognizing my amazonechocontrol.things file properly and says each item is “Not Defined” when in fact they are. I think it’s because browser cache isn’t letting the page properly reset itself…

@J-N-K that binding has a heap more metadata from my amazon account in the log and allows me to add different alexa device types but smart devices arent one of them - they no longer appear at all?

@richaardvark all i do is take the jar out of the add on folder, then copy the new one in and a service restart which im not sure is even necessary based on the logs

1 Like

Thanks Andrew! Can you check what the file permissions are for your .jar file? I’ve noticed when I drop the new file into the addons folder, my system tends to set the ownership to “root” and the permission for everyone as “read-only” when I’m thinking it needs to be owned by the “openhab” user. Also, in your “Amazon Account Thing” for the add-on, which settings do you typically select here? I’m not sure which I should be choosing…

my perms are 0644 with openhab as owner - read everyone but i not sure my file perms are a good baseline i think i did a propogate a while ago to try and fix something else.
I just choose direct but what you have it probably the “least restrictive” Ive also tried the slider below but not getting anything discovered with f2 - are you?

Will check if I messed up the thing-Type XML. This is not necessary for managed things that existed before but is essential for unmanaged things and discovery.