WeMo Mini Smart Plug Support With WeMo Binding?

Hi All,

I’m have a Wemo Mini Smart Plug that I am trying out in openHAB. The documentation only explicitly lists support for “Socket, Insight, Lightswitch, Motion and Maker devices” but I figured since it is part of “the Belkin WeMo Family” it might still work.

Paper UI automatically detected the plug as a Thing so that was promising. I made a Switch Item based on the Thing but it doesn’t seem to be interacting with the physical device; I have a light plugged into the outlet and it doesn’t turn off/on when I flip the Switch in Basic UI, and the Switch state on the UI doesn’t change when I manually turn the outlet off/on with the button. I also tried creating a Thing manually with the UUID from the auto-configuration but its state doesn’t ever change from “Initializing.”

At this point I was hoping someone could confirm that my Thing/Item/Sitemap configurations are correct so that I know it is likely that the Mini Smart Plug just isn’t compatible with the binding. Also if anyone else has had first-hand experience in working with the Mini Smart Plug, I’d love to get confirmation that it either does or does not work with the WeMo binding.

Thing
OpenHAB auto configured it but here is the only channel that shows up for it:

wemo:socket:Socket-1_0-221710K0101CDC:state

Item

Switch wallLight { channel="wemo:socket:Socket-1_0-221710K0101CDC:state" }

Sitemap

sitemap rocko label="Rocko's Realm"
{

        Frame label="Lights"
        {
                Switch item=wallLight label="Wall Light"
        }
}

If it is autodiscovered as a “socket” it should work.
Please set the WeMo binding loglevel to trace and post the output.

Hmm… I think I set the log level right but am not seeing any WeMo binding info come up in the log.

Here’s what I did to set the log level:

log:set TRACE org.openhab.binding.wemo

But again, nothing related to the binding is appearing. Info for other bindings is coming up in the log but not for WeMo.

Nearly, WeMo Binding is an ESH binding, so it has to be

log:set TRACE org.eclipse.smarthome.binding.wemo

Ah, got it. For future reference, how can I tell what the package name is to use for logging?
Here is what came up in the log which includes me trying to switch it on from Basic UI once.

2017-06-24 12:18:16.720 [ERROR] [apache.karaf.shell.support.ShellUtil] - Exception caught while executing command
java.lang.IllegalArgumentException: No enum constant org.apache.karaf.log.core.Level.ORG.ECLIPSE.SMARTHOME.BINDING.WEMO
	at java.lang.Enum.valueOf(Enum.java:238)[:1.8.0_121]
	at org.apache.karaf.log.core.Level.valueOf(Level.java:23)[50:org.apache.karaf.log.core:4.0.8]
	at org.apache.karaf.log.core.internal.LogServiceImpl.setLevel(LogServiceImpl.java:125)[50:org.apache.karaf.log.core:4.0.8]
	at org.apache.karaf.log.command.SetLogLevel.execute(SetLogLevel.java:48)[50:org.apache.karaf.log.core:4.0.8]
	at org.apache.karaf.shell.impl.action.command.ActionCommand.execute(ActionCommand.java:83)[55:org.apache.karaf.shell.core:4.0.8]
	at org.apache.karaf.shell.impl.console.osgi.secured.SecuredCommand.execute(SecuredCommand.java:67)[55:org.apache.karaf.shell.core:4.0.8]
	at org.apache.karaf.shell.impl.console.osgi.secured.SecuredCommand.execute(SecuredCommand.java:87)[55:org.apache.karaf.shell.core:4.0.8]
	at org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:480)[55:org.apache.karaf.shell.core:4.0.8]
	at org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:406)[55:org.apache.karaf.shell.core:4.0.8]
	at org.apache.felix.gogo.runtime.Pipe.run(Pipe.java:108)[55:org.apache.karaf.shell.core:4.0.8]
	at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:182)[55:org.apache.karaf.shell.core:4.0.8]
	at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:119)[55:org.apache.karaf.shell.core:4.0.8]
	at org.apache.felix.gogo.runtime.CommandSessionImpl.execute(CommandSessionImpl.java:94)[55:org.apache.karaf.shell.core:4.0.8]
	at org.apache.karaf.shell.impl.console.ConsoleSessionImpl.run(ConsoleSessionImpl.java:274)[55:org.apache.karaf.shell.core:4.0.8]
	at java.lang.Thread.run(Thread.java:745)[:1.8.0_121]
2017-06-24 12:19:12.859 [TRACE] [ome.binding.wemo.handler.WemoHandler] - Command 'ON' received for channel 'wemo:socket:wallLight:state'
2017-06-24 12:20:00.356 [DEBUG] [ome.binding.wemo.handler.WemoHandler] - WeMo UPnP device Socket-1_0-221710K0101CDC not yet registered
2017-06-24 12:20:00.358 [DEBUG] [ome.binding.wemo.handler.WemoHandler] - Setting up WeMo GENA subscription for 'org.eclipse.smarthome.binding.wemo.handler.WemoHandler@1f8f9e9' FAILED - service.isRegistered(this) is FALSE
2017-06-24 12:20:00.489 [DEBUG] [nding.network.service.NetworkService] - established connection [host '192.168.1.3' port '0' timeout '5000']
2017-06-24 12:22:00.356 [DEBUG] [ome.binding.wemo.handler.WemoHandler] - WeMo UPnP device Socket-1_0-221710K0101CDC not yet registered
2017-06-24 12:22:00.361 [DEBUG] [ome.binding.wemo.handler.WemoHandler] - Setting up WeMo GENA subscription for 'org.eclipse.smarthome.binding.wemo.handler.WemoHandler@1f8f9e9' FAILED - service.isRegistered(this) is FALSE
2017-06-24 12:24:00.405 [DEBUG] [ome.binding.wemo.handler.WemoHandler] - WeMo UPnP device Socket-1_0-221710K0101CDC not yet registered
2017-06-24 12:24:00.407 [DEBUG] [ome.binding.wemo.handler.WemoHandler] - Setting up WeMo GENA subscription for 'org.eclipse.smarthome.binding.wemo.handler.WemoHandler@1f8f9e9' FAILED - service.isRegistered(this) is FALSE

Thanks for taking a look at this with me!

Doing a bundle:list on console, it should be listed Esclipse Smarthome WeMo Binding.

The log you posted is not really helpfull, i also need information from handler initialization.

Ah OK sorry, here is the log from reboot; is that sufficient?

2017-06-24 13:38:22.576 [INFO ] [io.openhabcloud.internal.CloudClient] - Connected to the openHAB Cloud service (UUID = 2e0495ab-226d-4bcc-8f85-2521622b4ccc, base URL = http://localhost:8080)
2017-06-24 13:38:27.608 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'rocko.items'
2017-06-24 13:38:30.951 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'presence.rules'
2017-06-24 13:38:32.768 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'rocko.sitemap'
2017-06-24 13:38:33.292 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'rocko.things'
2017-06-24 13:38:35.443 [INFO ] [.dashboard.internal.DashboardService] - Started dashboard at /start
2017-06-24 13:38:36.550 [INFO ] [basic.internal.servlet.WebAppServlet] - Started Basic UI at /basicui/app
2017-06-24 13:38:36.844 [INFO ] [assic.internal.servlet.WebAppServlet] - Started Classic UI at /classicui/app
2017-06-24 13:38:37.137 [INFO ] [arthome.ui.paper.internal.PaperUIApp] - Started Paper UI at /paperui
2017-06-24 13:38:37.478 [INFO ] [ui.habmin.internal.servlet.HABminApp] - Started HABmin servlet at /habmin
2017-06-24 13:38:37.626 [INFO ] [panel.internal.HABPanelDashboardTile] - Started HABPanel at /habpanel
2017-06-24 13:38:37.806 [DEBUG] [org.openhab.binding.network         ] - BundleEvent STARTING - org.openhab.binding.network
2017-06-24 13:38:37.808 [DEBUG] [org.openhab.binding.network         ] - BundleEvent STARTED - org.openhab.binding.network
2017-06-24 13:38:37.822 [DEBUG] [org.openhab.binding.network         ] - ServiceEvent REGISTERED - {org.eclipse.smarthome.config.discovery.DiscoveryService}={component.name=org.openhab.binding.network.discovery.NetworkDiscoveryService, component.id=197, service.id=326, service.bundleid=210, service.scope=bundle} - org.openhab.binding.network
2017-06-24 13:38:37.883 [DEBUG] [org.openhab.binding.network         ] - ServiceEvent REGISTERED - {org.eclipse.smarthome.core.thing.binding.ThingHandlerFactory}={component.name=org.openhab.binding.network.internal.NetworkHandlerFactory, component.id=198, service.id=327, service.bundleid=210, service.scope=bundle} - org.openhab.binding.network
2017-06-24 13:38:37.895 [DEBUG] [org.eclipse.smarthome.binding.wemo  ] - BundleEvent STARTING - org.eclipse.smarthome.binding.wemo
2017-06-24 13:38:37.897 [DEBUG] [org.eclipse.smarthome.binding.wemo  ] - BundleEvent STARTED - org.eclipse.smarthome.binding.wemo
2017-06-24 13:38:37.928 [DEBUG] [org.eclipse.smarthome.binding.wemo  ] - ServiceEvent REGISTERED - {org.eclipse.smarthome.config.discovery.UpnpDiscoveryParticipant}={component.name=org.eclipse.smarthome.binding.wemo.discovery.WemoDiscoveryParticipant, component.id=199, service.id=328, service.bundleid=216, service.scope=bundle} - org.eclipse.smarthome.binding.wemo
2017-06-24 13:38:37.985 [DEBUG] [org.eclipse.smarthome.binding.wemo  ] - ServiceEvent REGISTERED - {org.eclipse.smarthome.config.discovery.DiscoveryService}={component.name=org.eclipse.smarthome.binding.wemo.discovery.WemoDiscoveryService, component.id=200, service.id=330, service.bundleid=216, service.scope=bundle} - org.eclipse.smarthome.binding.wemo
2017-06-24 13:38:38.000 [DEBUG] [.wemo.discovery.WemoDiscoveryService] - Starting WeMo UPnP discovery...
2017-06-24 13:38:38.003 [DEBUG] [.wemo.discovery.WemoDiscoveryService] - Starting UPnP RootDevice search...
2017-06-24 13:38:38.088 [DEBUG] [org.eclipse.smarthome.binding.wemo  ] - ServiceEvent REGISTERED - {org.eclipse.smarthome.core.thing.binding.ThingHandlerFactory}={component.name=org.eclipse.smarthome.binding.wemo.internal.WemoHandlerFactory, component.id=201, service.id=332, service.bundleid=216, service.scope=bundle} - org.eclipse.smarthome.binding.wemo
2017-06-24 13:38:38.258 [DEBUG] [nding.network.handler.NetworkHandler] - Initialize Network handler.
2017-06-24 13:38:38.303 [ERROR] [nding.network.service.NetworkService] - Cannot use DHCP listen: Permission denied (Bind failed)
2017-06-24 13:38:38.309 [DEBUG] [nding.network.handler.NetworkHandler] - Initialize Network handler.
2017-06-24 13:38:38.389 [DEBUG] [ing.wemo.internal.WemoHandlerFactory] - Trying to create a handler for ThingType 'wemo:socket
2017-06-24 13:38:38.401 [DEBUG] [ing.wemo.internal.WemoHandlerFactory] - Creating a WemoHandler for thing 'wemo:socket:wallLight' with UDN 'Socket-1_0-221710K0101CDC'
2017-06-24 13:38:38.410 [DEBUG] [ome.binding.wemo.handler.WemoHandler] - Creating a WemoHandler for thing 'wemo:socket:wallLight'
2017-06-24 13:38:38.428 [DEBUG] [ome.binding.wemo.handler.WemoHandler] - Initializing WemoHandler for UDN 'Socket-1_0-221710K0101CDC'
2017-06-24 13:38:38.430 [DEBUG] [ome.binding.wemo.handler.WemoHandler] - Setting up WeMo GENA subscription for 'org.eclipse.smarthome.binding.wemo.handler.WemoHandler@5b2c29' FAILED - service.isRegistered(this) is FALSE
2017-06-24 13:38:38.437 [DEBUG] [ome.binding.wemo.handler.WemoHandler] - WeMo UPnP device Socket-1_0-221710K0101CDC not yet registered
2017-06-24 13:38:38.440 [TRACE] [ome.binding.wemo.handler.WemoHandler] - Command 'REFRESH' received for channel 'wemo:socket:wallLight:state'

Thanks for the logs,
apart from the WeMo logs, I see another issue with your network, not being able to bind to your interface. This could also influence the WeMo binding.

Do you have a chance to setup a openHAB 1.8x instance on a different machine for testing.
The 1.8x binding does not use UPnP libraries to communicate with the devices, but creates the SAP messages directly.

Out of your logs, I can see thet the device is discovered, but it has not registered its services at UPnP.

I set up openHAB 1.83 on a Windows machine and made a switch with a binding to the WeMo socket. It works fine so it looks like your UPnP theory is correct. Let me know if you’d like me to change log settings but I figured since there is no problem with this install you wouldn’t need details.

2017-06-25 08:44:03.825 [INFO ] [.o.core.internal.CoreActivator] - openHAB runtime has been started (v1.8.3).
2017-06-25 08:44:04.858 [INFO ] [o.o.i.s.i.DiscoveryServiceImpl] - mDNS service has been started
2017-06-25 08:44:05.272 [INFO ] [o.o.i.s.i.DiscoveryServiceImpl] - Service Discovery initialization completed.
2017-06-25 08:44:07.485 [INFO ] [penhab.io.rest.RESTApplication] - Started REST API at /rest
2017-06-25 08:44:08.555 [INFO ] [c.internal.ModelRepositoryImpl] - Loading model 'default.sitemap'
2017-06-25 08:44:08.750 [INFO ] [c.internal.ModelRepositoryImpl] - Loading model 'kickstarter.script'
2017-06-25 08:44:08.888 [INFO ] [c.internal.ModelRepositoryImpl] - Loading model 'home.items'
2017-06-25 08:44:16.211 [INFO ] [.o.u.w.i.servlet.WebAppServlet] - Started Classic UI at /classicui/openhab.app
2017-06-25 08:44:18.715 [INFO ] [.o.b.wemo.internal.WemoBinding] - Wemo Device with UDN 'Socket-1_0-221710K0101CDC' discovered
2017-06-25 08:44:18.717 [INFO ] [.o.b.wemo.internal.WemoBinding] - Wemo Device with UDN 'Socket-1_0-221710K0101CDC' discovered
2017-06-25 08:44:19.718 [INFO ] [.service.AbstractActiveService] - Wemo Refresh Service has been started

Also, regarding the network issue you mentioned, are you referring to the error that says “Cannot use DHCP listen: Permission denied (Bind failed)”? I am not getting that message on reboot anymore but am still having the WeMo issue. I changed the permissions for the process with setcap as described here. Honestly wasn’t sure if that was the right thing to do but it did fix that error message.

So I went and bought a WeMo Insight today and set it up. It actually went fine getting it configured with openHAB and seems to have had no problems with discovery and being registered. It is behaving weirdly in some ways, but that will be for another topic thread I think (on/off state isn’t syncing right with the binding). The bottom line though is that it is working with my openHAB setup while the Mini Smart Plug is still having issues so I guess it is something to do with that model of device in particular since the docs don’t list it as a compatible device. Since the Mini Smart Plug was working with my install of openHAB 1.83, is there any way to get the WeMo binding to operate in OH2 like it does for 1.83?

No, the 1.x binding version is completely different from the ESH version.
In 1.x I had to code all SOAP communication on my own, as Belkin’s UPnP implementation is not spec compliant.
Therefore the binding uses polling request to get the state of devices, no support for GENA events.
With openHAB 2.0, we could “tweak” the underlying JUPnP implementation in a way, that the Binding could use it for discovery and GENA events, whereas command handling still is my own coding. Cause of this, not all devices, e.g. the WeMo Maker does not, support GENA events.
The list of supported devices includes only those that I already have and could fully implement, or with the next realease those, that have been implemented with heavy user support (Coffe Maker, Dimmer Switch). Not all WeMo devices have come to the European market, so I cannot buy and test all of them. Even If I could, I would not.

I didn’t realize that you developed the WeMo binding; thanks for your work! Thanks also for going through all of this with me. If you want to explore the Mini Smart Plug compatibility more let me know and I’d be glad to work through things at your direction. Until then I will work with the Insight device.

Reading this
https://community.openhab.org/t/find-binding-for-device/33173/2

It seems that there is no issue with the smart plug.