Thanks for you PR, looks quite good. Please address the comments made by @cpmeister.
Nevertheless, this will just solve the issue with respongin a wrong port, but might not solve not responding at all. That’s basically the issue mentioned the last couple of weeks.
I am running OH through the official Docker image (Docker). I am on “latest.” That means I’m running OH 2.5.5. java -version inside the container yields:
openjdk version "1.8.0_232"
OpenJDK Runtime Environment (Zulu 8.42.0.23-CA-linux64) (build 1.8.0_232-b18)
OpenJDK 64-Bit Server VM (Zulu 8.42.0.23-CA-linux64) (build 25.232-b18, mixed mode)
The Docker instance is running on OpenMediaVault 5.5.2, which is just a GUI built over Debian 10.
I’m happy to test any snapshots or try any other tweaks. But I don’t have any experience editing binding JARs.
I forgot where we left this. Maybe I’ll poke around and see if nobody has any other ides. It has been going on for a long time, mostly harmless but just annoying to see it toggle like that.
The reliability of my WeMo devices has gone way down. (I recently updated to WeMo Accounts) My openHAB frequently does not have/get correct status for WeMo Insight Smart Plugs and I will have to toggle the switch to get a WeMo Insight to respond. For instance to turn my dehumidifier on I will issue 3 of the .sendCommand() commands. First an ON, wait a few milliseconds, OFF, wait a few more milliseconds, and ON again. Boom, works every time now. The other thing is I’ve had to create “shadow” switches, switch items not associated with any things, which I switch on and off in parallel with the actual WeMo switch. I check the status of that item in rules which need to query the state of the WeMo item. I have had autoUpdate=false all through this from working correctly a few weeks ago to not working correctly now, although I have found that the above mentioned work-arounds get me by. I describe this also in my question on WeMo Accounts, openHAB 2.5 - Wemo Accounts compatability
ERROR:
2020-06-15 10:47:00.931 [ERROR] [ng.wemo.internal.handler.WemoHandler] - Failed to get actual state for device ‘wemo:insight:Insight-1_0-231707K1200D5C’: Invalid URI host: null (authority: 192.168.108.226:null)
This error indicates the device is not responding to the „port scan“.
Thanks to @billfor openHAB 2.5.6 will do different checks which hopefully solves this.
If not, there is not much we can do.
I have had autoupdate=“false” for a long time. It helped me get everything Wemo working pretty much 100% up until I got to Wemo Accounts. With no change besides the Wemo Accounts things have been becoming less reliable and requiring more workarounds.
There was a firmware upgrade slightly before I signed up for Accounts. I believe that firmware supported both old style and new Wemo Accounts control of Wemo devices.
That’s what I suspected. I’m sorry to say that Belkin has a history of firmware releases that improve some things in Wemo will breaking others. So, I’d be more inclined to think that’s why things have become unreliable.
It’s honestly amazing that they haven’t gotten their act together after all these years.
Copy the files from the folder 2.5.6/debian (3 files total, including a Dockerfile) to my server.
ssh into the server and cd to the location of the copied files.
docker build --tag openhab:2.5.6 . to create a new image.
Create a new container using the new image (I did this with a stack within Portainer, but you can use whatever you would normally use). You’ll likely need to shut down any running OH container first to avoid a port conflict. As soon as the container is fully loaded you can stop it again.
Navigate to the config folder for the new container and then to userdata\tmp\mvn\org\openhab\addons\bundles\org.openhab.binding.wemo\2.5.6-SNAPSHOT (this is Windows notation because I copied and pasted File Explorer via Samba).
Grab the 2.5.6 jar file from there (there were two, I used the one with the specific date instead of the generic “SNAPSHOT” filename, but it looks like they might be identical.
Start your real OH installation.
Disable your 2.5.5 Wemo binding (I did this in my addons.cfg file, but do it wherever you added the Wemo binding in the first place, e.g., PaperUI).
Place the 2.5.6 jar in the addons folder of your real OH installation.
It’s only been running for a couple minutes, so I’ll try to report back on whether the connection to my Wemo devices is more stable.
Good news: 36 hours after installing the 2.5.6 binding and I have not had any connection issues. thanks @hmerk. And that’ll teach me not to update my Wemo firmware.