[SOLVED] WeMo Reliability

Sorry forgot that bit.

The output from java -version in the docker iimage:

openjdk version “1.8.0_192”
OpenJDK Runtime Environment (Zulu 8.33.0.1-linux64) (build 1.8.0_192-b01)
OpenJDK 64-Bit Server VM (Zulu 8.33.0.1-linux64) (build 25.192-b01, mixed mode)

I’ve created a bounty to have the WeMo binding updated to dynamically follow port changes on it’s next version.

Best, Jay

1 Like

Sorry, will not be able to provide an update in short time. In the meantime, you could try the following:
When WeMo devices become unresponsive, trigger a scan for new WeMo devices in PaperUI.
This should update existing devices.
Please post here if this works, we then can create a workaround.
Best
Hans-Jörg

Rediscovery through Paper does not work.
As mentioned, the Wemo device occasionally decides to change its port. If you have a stable network it won’t change the port, but if your wifi drops out or is restarted, it may decide to change its port when it rejoins the nework. One way that I reliably reproduce the problem is to just restart the wifi network. The new (half-size) wemo switches, as opposed to the Insite seem to have the problem most. The binding (last time I looked at it) uses smarthome to do the discovery, and that’s what needs to trigger the rescan but I could never figure out to force that.

For the 1.x wemo binding, am I supposed to just download it from git? I don’t see it on the list in the paper ui to install, like the MQTT 1.x binding… Might be handy to just list the 1.x binding again in paper, since a lot of people have the problem.

The Wemo 1.x Binding will not solve the issue, but will create some more.
I have created a test version which should solve the problem, will publish it here later today.

As promised, please find a new testing version at github
https://github.com/hmerk/wemo/blob/master/org.openhab.binding.wemo-2.5.0-SNAPSHOT.jar

Please note that it has only been tested with openHAB-2.5.0-Snapshot#1620
You need to delete your things and have them rediscovered via the search function of openHABs inbox.
If you get a feature missing error for UPnP, please install it via Karaf console

feature:install openhab-transport-upnp

The device properties now include ip-address and port as shown below

First, I wanted to Thank you SO MUCH for addressing this issue!

I’m running OH 2.4 but I’m running 2.5m1 bindings using a KAR file.

I deleted the WeMo THINGS and re-found them but I do NOT have the HIDE PROPERTIES option so I can see the IP and Port. This may be a difference between OH 2.4 and OH 2.5?

My WeMo THINGS are all defined in the .thing file vs. using upnp.

It took a bit for OH to remove the binding --> Active │ 80 │ 0.11.0.oh250M1 │ org.eclipse.smarthome.binding.wemo but it did after a bit even though it was removed from the services.cfg before I started OH up and the cache/tmp directories where cleaned up also.

All 19 of my WeMo devices are online right now. I’ll keep everyone posted . . .

2019-06-24 18:06:48.422 [INFO ] [g.discovery.internal.PersistentInbox] - Added new thing 'wemo:lightswitch:Lightswitch-1_0-221602K1301B7A' to inbox.
2019-06-24 18:06:48.448 [INFO ] [g.discovery.internal.PersistentInbox] - Added new thing 'wemo:insight:Insight-1_0-231707K1201DE8' to inbox.
2019-06-24 18:06:48.499 [INFO ] [g.discovery.internal.PersistentInbox] - Added new thing 'wemo:socket:Socket-1_0-221749K0102A74' to inbox.
2019-06-24 18:06:48.529 [INFO ] [g.discovery.internal.PersistentInbox] - Added new thing 'wemo:insight:Insight-1_0-231837K120048E' to inbox.
2019-06-24 18:06:48.547 [INFO ] [g.discovery.internal.PersistentInbox] - Added new thing 'wemo:socket:Socket-1_0-221739K0103039' to inbox.
2019-06-24 18:06:48.584 [INFO ] [g.discovery.internal.PersistentInbox] - Added new thing 'wemo:socket:Socket-1_0-221710K010228E' to inbox.
2019-06-24 18:06:48.597 [INFO ] [g.discovery.internal.PersistentInbox] - Added new thing 'wemo:lightswitch:Lightswitch-1_0-221622K130115C' to inbox.
2019-06-24 18:06:48.617 [INFO ] [g.discovery.internal.PersistentInbox] - Added new thing 'wemo:lightswitch:Lightswitch-1_0-221736K1300F5B' to inbox.
2019-06-24 18:06:48.664 [INFO ] [g.discovery.internal.PersistentInbox] - Added new thing 'wemo:socket:Socket-1_0-221749K01027A4' to inbox.
2019-06-24 18:06:48.678 [INFO ] [g.discovery.internal.PersistentInbox] - Added new thing 'wemo:socket:Socket-1_0-221609K0100F65' to inbox.
2019-06-24 18:06:48.692 [INFO ] [g.discovery.internal.PersistentInbox] - Added new thing 'wemo:socket:Socket-1_0-221612K0102B49' to inbox.
2019-06-24 18:06:48.706 [INFO ] [g.discovery.internal.PersistentInbox] - Added new thing 'wemo:lightswitch:Lightswitch-1_0-221838K1302422' to inbox.
2019-06-24 18:06:48.722 [INFO ] [g.discovery.internal.PersistentInbox] - Added new thing 'wemo:socket:Socket-1_0-221749K0102FCD' to inbox.
2019-06-24 18:06:48.769 [INFO ] [g.discovery.internal.PersistentInbox] - Added new thing 'wemo:lightswitch:Lightswitch-1_0-221736K1300F26' to inbox.
2019-06-24 18:06:48.809 [INFO ] [g.discovery.internal.PersistentInbox] - Added new thing 'wemo:socket:Socket-1_0-221620K01013B1' to inbox.
2019-06-24 18:06:48.849 [INFO ] [g.discovery.internal.PersistentInbox] - Added new thing 'wemo:socket:Socket-1_0-221749K0102E6D' to inbox.
2019-06-24 18:06:48.863 [INFO ] [g.discovery.internal.PersistentInbox] - Added new thing 'wemo:socket:Socket-1_0-22B8B1K01028F4' to inbox.
2019-06-24 18:06:48.879 [INFO ] [g.discovery.internal.PersistentInbox] - Added new thing 'wemo:socket:Socket-1_0-22C8B1K0108E93' to inbox.
2019-06-24 18:06:48.895 [INFO ] [g.discovery.internal.PersistentInbox] - Added new thing 'wemo:socket:Socket-1_0-221742K0118E30' to inbox.

Best, Jay

Sorry, you are still running the old binding.
Please uninstall the WeMo binding, clear the cache and after a restart, put the new version into your addons folder. bundle:list should then show you a snapshot version of the binding.

Best
Hans-Jörg

I actually did all those tasks from my original post; here’s my output.

openhab> list -s | grep wemo
191 │ Active    │  80 │ 2.5.0.201905310944     │ org.openhab.binding.wemo
openhab>

Best, Jay

Your last post showed the old binding running

Active │ 80 │ 0.11.0.oh250M1 │ org.eclipse.smarthome.binding.wemo

but now you have the correct version. Only difference is that you run openHAB 2.4, as I wrote, the new version is tested with openHAB 2.5-SNAPSHOT only.
Perhaps you could set up a test environment with a SNAPSHOT version.

Best
Hans-Jörg

Hey Hans,

I had to clear cache/tmp again because WeMo devices where failing BUT now I have the correct Paper interface for the binding showing the IP and Port. What I had to do is delete the THINGS first then shut down OH and clear cache/tmp. If I didn’t delete the THINGS before shutting down OH; OH would pull in the OLD binding back in.

I think I’m good now for testing.

Capture

I’ll keep you posted.

Best, Jay

:+1:

So far it’s working with 2.4 (I use the channel in the item definition and not the things). All I did was:

  • uninstall binding from paper
  • copy new binding to /usr/share/openhab2/addons
  • feature:install openhab-transport-upnp ,from karaf (openhab components will restart)

Gerat, let’s see if it will work reliable for a couple of days/weeks. If so, I will create a pull request to have this patch in the SNAPSHOTS.

Hey Hans,

Got an example of it failing.

Paper has the port as 49157 but it’s actually at 49154.

Capture

Port that Paper IS showing and does NOT respond to a ping:

C:\Users\root>paping 192.168.0.181 -p 49157 -c 4
paping v1.5.5 - Copyright (c) 2011 Mike Lovell

Connecting to 192.168.0.181 on TCP 49157:

Connection timed out
Connection timed out
Connection timed out
Connection timed out

Connection statistics:
        Attempted = 4, Connected = 0, Failed = 4 (100.00%)
Approximate connection times:
        Minimum = 0.00ms, Maximum = 0.00ms, Average = 0.00ms

Port that Paper is NOT showing and responds to a PING

C:\Users\root>paping 192.168.0.181 -p 49154 -c 4
paping v1.5.5 - Copyright (c) 2011 Mike Lovell

Connecting to 192.168.0.181 on TCP 49154:

Connected to 192.168.0.181: time=31.43ms protocol=TCP port=49154
Connected to 192.168.0.181: time=0.00ms protocol=TCP port=49154
Connected to 192.168.0.181: time=2.82ms protocol=TCP port=49154
Connected to 192.168.0.181: time=0.00ms protocol=TCP port=49154

Connection statistics:
        Attempted = 4, Connected = 4, Failed = 0 (0.00%)
Approximate connection times:
        Minimum = 0.00ms, Maximum = 31.43ms, Average = 8.56ms

I actually have all my WeMo plugs try twice.

			Wallplug_Jays_Office_Light.sendCommand(ON)
				Thread::sleep(5000)  // 5 second wait
			Wallplug_Jays_Office_Light.sendCommand(ON)
				Thread::sleep(5000)  // 5 second wait

This device is one of the ones that seem to always be changing. I got out of Paper a few times and back in and the port never changed; it stayed the same.

I did a search for new WeMo’s via Paper and looked again at the port but it stayed the same.

It did eventually turn on which I don’t understand why it did? Are you going up the ports to turn them on/off or using the paper port shown for a specific device.

Best, Jay

Another example happened; seems to be a trend with these 2 examples tied to 49157 in paper

Paper shows it as port 49157

Capture

This time the device responds to port 49157 but the switch does NOT turn on.

C:\Users\root>paping 192.168.0.192  -p 49157 -c 4
paping v1.5.5 - Copyright (c) 2011 Mike Lovell

Connecting to 192.168.0.192 on TCP 49157:

Connected to 192.168.0.192: time=3.00ms protocol=TCP port=49157
Connected to 192.168.0.192: time=2.21ms protocol=TCP port=49157
Connected to 192.168.0.192: time=2.98ms protocol=TCP port=49157
Connected to 192.168.0.192: time=0.00ms protocol=TCP port=49157

Connection statistics:
        Attempted = 4, Connected = 4, Failed = 0 (0.00%)
Approximate connection times:
        Minimum = 0.00ms, Maximum = 3.00ms, Average = 2.05ms

and its responding to 49153 also which I have never seen WeMo switches respond to both ports

C:\Users\root>paping 192.168.0.192  -p 49153 -c 4
paping v1.5.5 - Copyright (c) 2011 Mike Lovell

Connecting to 192.168.0.192 on TCP 49153:

Connected to 192.168.0.192: time=0.00ms protocol=TCP port=49153
Connected to 192.168.0.192: time=15.79ms protocol=TCP port=49153
Connected to 192.168.0.192: time=3.99ms protocol=TCP port=49153
Connected to 192.168.0.192: time=0.00ms protocol=TCP port=49153

Connection statistics:
        Attempted = 4, Connected = 4, Failed = 0 (0.00%)
Approximate connection times:
        Minimum = 0.00ms, Maximum = 15.79ms, Average = 4.94ms

Best, Jay

Hm, so this WeMo firmware bug makes it not easy to solve it in a proper way, instead we need to cycle through all ports. Really ugly, but I will think of a way to solve it.

For the case where both ports are active, what does the upnp discovery say it is?

Noticing that this is lost after doing a full restart of openhab 2.4, and I have to go back in to karaf and do it again. Should this go in the addons.cfg (for 2.4)?
Thanks.

Not sure it will work in addons.cfg? I just dropped in these JAR’s into my addon directory and I’m running OH 2.4 also.

org.eclipse.smarthome.io.transport.upnp-0.11.0.oh250M1.jar
org.eclipse.smarthome.config.discovery.upnp-0.11.0.oh250M1.jar

Best, Jay