WeMo switches only work one way?

I have 3 wemo switches that I’ve created items and sitemap switch entries for. When I click the switch in the web interface the wemo turns on and off and the log shows this happening. However when i manually change the state of the switch via the physical button on the front of the wemo openhab show nothing in the log and doesn’t update the switch.

Any ideas where to look?

Thanks,
Box

Please post some more information about your system (machine, os, java version, openHAB version) and your WeMo debug log entries.

I’m running Windows 2012r2 OS in a 2012r2 Hyper-V VM.

Java -version reports: java version “1.8.0_101”, Java™ SE Runtime Environment (build 1.8.0_101-b13), Java HotSpot™ 64-Bit Server VM (build 25.101-b13, mixed mode)
OH2 snapshot #558

I started openhab with start_debug.ba, I see events in the events.log:

2016-10-29 17:06:20.257 [ItemStateChangedEvent ] - wemo1 changed from ON to OFF
2016-10-29 17:06:21.819 [ItemCommandEvent ] - Item ‘wemo1’ received command ON
2016-10-29 17:06:21.863 [ItemStateChangedEvent ] - wemo1 changed from OFF to ON
2016-10-29 17:06:22.831 [ItemCommandEvent ] - Item ‘wemo1’ received command OFF
2016-10-29 17:06:22.874 [ItemStateChangedEvent ] - wemo1 changed from ON to OFF

2016-10-29 17:20:30.127 [ItemChannelLinkAddedEvent ] - Link ‘wemo1-wemo:socket:Socket-1_0-221413K1100634:state’ has been added.
2016-10-29 17:20:30.129 [ItemChannelLinkAddedEvent ] - Link ‘wemo2-wemo:socket:Socket-1_0-221519K1100DA2:state’ has been added.
2016-10-29 17:20:30.131 [ItemChannelLinkAddedEvent ] - Link ‘wemo3-wemo:socket:Socket-1_0-221519K1100E60:state’ has been added.
2016-10-29 17:20:30.213 [ThingAddedEvent ] - Thing ‘wemo:socket:Socket-1_0-221413K1100634’ has been added.
2016-10-29 17:20:30.217 [ThingAddedEvent ] - Thing ‘wemo:socket:Socket-1_0-221519K1100DA2’ has been added.
2016-10-29 17:20:30.217 [ThingAddedEvent ] - Thing ‘wemo:socket:Socket-1_0-221519K1100E60’ has been added.
2016-10-29 17:20:48.230 [ItemStateChangedEvent ] - wemo1 changed from NULL to OFF
2016-10-29 17:20:48.238 [ItemStateChangedEvent ] - wemo2 changed from NULL to ON
2016-10-29 17:20:48.240 [ItemStateChangedEvent ] - wemo3 changed from NULL to OFF
2016-10-29 17:21:04.498 [hingStatusInfoChangedEvent] - ‘wemo:socket:Socket-1_0-221413K1100634’ changed from UNINITIALIZED to INITIALIZING
2016-10-29 17:21:04.498 [hingStatusInfoChangedEvent] - ‘wemo:socket:Socket-1_0-221413K1100634’ changed from INITIALIZING to ONLINE
2016-10-29 17:21:04.552 [hingStatusInfoChangedEvent] - ‘wemo:socket:Socket-1_0-221519K1100DA2’ changed from UNINITIALIZED to INITIALIZING
2016-10-29 17:21:04.554 [hingStatusInfoChangedEvent] - ‘wemo:socket:Socket-1_0-221519K1100DA2’ changed from INITIALIZING to ONLINE
2016-10-29 17:21:04.554 [hingStatusInfoChangedEvent] - ‘wemo:socket:Socket-1_0-221519K1100E60’ changed from UNINITIALIZED to INITIALIZING
2016-10-29 17:21:04.556 [hingStatusInfoChangedEvent] - ‘wemo:socket:Socket-1_0-221519K1100E60’ changed from INITIALIZING to ONLINE

2016-10-29 17:25:02.150 [ItemCommandEvent ] - Item ‘wemo1’ received command ON
2016-10-29 17:25:02.326 [ItemStateChangedEvent ] - wemo1 changed from OFF to ON
2016-10-29 17:25:04.250 [ItemCommandEvent ] - Item ‘wemo1’ received command OFF
2016-10-29 17:25:04.306 [ItemStateChangedEvent ] - wemo1 changed from ON to OFF

But nothing in the openhab.log file.

I have tried uninstalling and reinstalling the wemo binding. I think I’m possibly not enabling the wemo logging correctly?

Many thanks

Yes, in Karaf console please type
log:set DEBUG org.eclipse.smarthome.binding.wemo

Okay, here are some debug logs. It looks like it finds the wemos and sucessfully reads their states. Hovever after that there is nothing else logged in the logfile until I shut down openhab, but dring that time I sucessfully switched the wemos on and off through the web interface.

openhab.log
2016-10-30 11:15:39.050 [DEBUG] [org.eclipse.smarthome.binding.wemo ] - BundleEvent STARTING - org.eclipse.smarthome.binding.wemo
2016-10-30 11:15:39.050 [DEBUG] [org.eclipse.smarthome.binding.wemo ] - BundleEvent STARTED - org.eclipse.smarthome.binding.wemo
2016-10-30 11:15:39.052 [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=193, service.id=358, service.bundleid=213, service.scope=bundle} - org.eclipse.smarthome.binding.wemo
2016-10-30 11:15:39.056 [DEBUG] [ing.wemo.internal.WemoHandlerFactory] - Trying to create a handler for ThingType 'wemo:socket
2016-10-30 11:15:39.056 [DEBUG] [ing.wemo.internal.WemoHandlerFactory] - Creating a WemoHandler for thing ‘wemo:socket:Socket-1_0-221413K1100634’ with UDN 'Socket-1_0-221413K1100634’
2016-10-30 11:15:39.058 [DEBUG] [ome.binding.wemo.handler.WemoHandler] - Creating a WemoHandler for thing 'wemo:socket:Socket-1_0-221413K1100634’
2016-10-30 11:15:39.060 [DEBUG] [org.eclipse.smarthome.binding.wemo ] - ServiceEvent REGISTERED - {org.eclipse.smarthome.core.thing.binding.ThingHandler}={thing.type=wemo:socket, thing.id=wemo:socket:Socket-1_0-221413K1100634, service.id=359, service.bundleid=213, service.scope=singleton} - org.eclipse.smarthome.binding.wemo
2016-10-30 11:15:39.062 [DEBUG] [ing.wemo.internal.WemoHandlerFactory] - Trying to create a handler for ThingType 'wemo:socket
2016-10-30 11:15:39.062 [DEBUG] [ing.wemo.internal.WemoHandlerFactory] - Creating a WemoHandler for thing ‘wemo:socket:Socket-1_0-221519K1100DA2’ with UDN 'Socket-1_0-221519K1100DA2’
2016-10-30 11:15:39.062 [DEBUG] [ome.binding.wemo.handler.WemoHandler] - Creating a WemoHandler for thing 'wemo:socket:Socket-1_0-221519K1100DA2’
2016-10-30 11:15:39.062 [DEBUG] [org.eclipse.smarthome.binding.wemo ] - ServiceEvent REGISTERED - {org.eclipse.smarthome.core.thing.binding.ThingHandler}={thing.type=wemo:socket, thing.id=wemo:socket:Socket-1_0-221519K1100DA2, service.id=360, service.bundleid=213, service.scope=singleton} - org.eclipse.smarthome.binding.wemo
2016-10-30 11:15:39.062 [DEBUG] [ing.wemo.internal.WemoHandlerFactory] - Trying to create a handler for ThingType 'wemo:socket
2016-10-30 11:15:39.064 [DEBUG] [ing.wemo.internal.WemoHandlerFactory] - Creating a WemoHandler for thing ‘wemo:socket:Socket-1_0-221519K1100E60’ with UDN 'Socket-1_0-221519K1100E60’
2016-10-30 11:15:39.064 [DEBUG] [ome.binding.wemo.handler.WemoHandler] - Creating a WemoHandler for thing 'wemo:socket:Socket-1_0-221519K1100E60’
2016-10-30 11:15:39.064 [DEBUG] [org.eclipse.smarthome.binding.wemo ] - ServiceEvent REGISTERED - {org.eclipse.smarthome.core.thing.binding.ThingHandler}={thing.type=wemo:socket, thing.id=wemo:socket:Socket-1_0-221519K1100E60, service.id=361, service.bundleid=213, service.scope=singleton} - org.eclipse.smarthome.binding.wemo
2016-10-30 11:15:39.066 [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=194, service.id=362, service.bundleid=213, service.scope=bundle} - org.eclipse.smarthome.binding.wemo
2016-10-30 11:15:39.066 [DEBUG] [.wemo.discovery.WemoDiscoveryService] - Starting WeMo UPnP discovery…
2016-10-30 11:15:39.066 [DEBUG] [.wemo.discovery.WemoDiscoveryService] - Starting UPnP RootDevice search…
2016-10-30 11:15:39.066 [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=195, service.id=363, service.bundleid=213, service.scope=bundle} - org.eclipse.smarthome.binding.wemo
2016-10-30 11:15:40.382 [DEBUG] [ome.binding.wemo.handler.WemoHandler] - Initializing WemoHandler for UDN 'Socket-1_0-221413K1100634’
2016-10-30 11:15:41.147 [DEBUG] [ome.binding.wemo.handler.WemoHandler] - Initializing WemoHandler for UDN 'Socket-1_0-221519K1100E60’
2016-10-30 11:15:42.459 [DEBUG] [ome.binding.wemo.handler.WemoHandler] - Initializing WemoHandler for UDN 'Socket-1_0-221519K1100DA2’
2016-10-30 11:15:43.720 [DEBUG] [o.discovery.WemoDiscoveryParticipant] - Discovered a WeMo Socket thing with UDN 'Socket-1_0-221413K1100634’
2016-10-30 11:15:43.720 [DEBUG] [o.discovery.WemoDiscoveryParticipant] - Created a DiscoveryResult for device ‘3D Print System’ with UDN 'Socket-1_0-221413K1100634’
2016-10-30 11:15:43.728 [DEBUG] [o.discovery.WemoDiscoveryParticipant] - Discovered a WeMo Socket thing with UDN 'Socket-1_0-221519K1100E60’
2016-10-30 11:15:43.728 [DEBUG] [o.discovery.WemoDiscoveryParticipant] - Created a DiscoveryResult for device ‘WeMo-3’ with UDN 'Socket-1_0-221519K1100E60’
2016-10-30 11:15:43.800 [DEBUG] [ome.binding.wemo.handler.WemoHandler] - Received pair ‘BinaryState’:‘0’ (service ‘basicevent1’) for thing 'wemo:socket:Socket-1_0-221519K1100E60’
2016-10-30 11:15:43.800 [DEBUG] [ome.binding.wemo.handler.WemoHandler] - State ‘OFF’ for device ‘wemo:socket:Socket-1_0-221519K1100E60’ received
2016-10-30 11:15:43.876 [DEBUG] [o.discovery.WemoDiscoveryParticipant] - Discovered a WeMo Socket thing with UDN 'Socket-1_0-221519K1100DA2’
2016-10-30 11:15:43.876 [DEBUG] [o.discovery.WemoDiscoveryParticipant] - Created a DiscoveryResult for device ‘WeMo-2’ with UDN 'Socket-1_0-221519K1100DA2’
2016-10-30 11:15:43.930 [DEBUG] [ome.binding.wemo.handler.WemoHandler] - Received pair ‘BinaryState’:‘0’ (service ‘basicevent1’) for thing 'wemo:socket:Socket-1_0-221413K1100634’
2016-10-30 11:15:43.950 [DEBUG] [ome.binding.wemo.handler.WemoHandler] - State ‘OFF’ for device ‘wemo:socket:Socket-1_0-221413K1100634’ received
2016-10-30 11:15:43.984 [DEBUG] [ome.binding.wemo.handler.WemoHandler] - Received pair ‘BinaryState’:‘1’ (service ‘basicevent1’) for thing 'wemo:socket:Socket-1_0-221519K1100DA2’
2016-10-30 11:15:43.984 [DEBUG] [ome.binding.wemo.handler.WemoHandler] - State ‘ON’ for device ‘wemo:socket:Socket-1_0-221519K1100DA2’ received
2016-10-30 11:48:36.468 [DEBUG] [org.eclipse.smarthome.binding.wemo ] - BundleEvent STOPPING - org.eclipse.smarthome.binding.wemo
2016-10-30 11:48:36.469 [DEBUG] [org.eclipse.smarthome.binding.wemo ] - ServiceEvent UNREGISTERING - {org.eclipse.smarthome.core.thing.binding.ThingHandlerFactory}={component.name=org.eclipse.smarthome.binding.wemo.internal.WemoHandlerFactory, component.id=193, service.id=358, service.bundleid=213, service.scope=bundle} - org.eclipse.smarthome.binding.wemo
2016-10-30 11:48:36.469 [DEBUG] [org.eclipse.smarthome.binding.wemo ] - ServiceEvent UNREGISTERING - {org.eclipse.smarthome.core.thing.binding.ThingHandler}={thing.type=wemo:socket, thing.id=wemo:socket:Socket-1_0-221519K1100DA2, service.id=360, service.bundleid=213, service.scope=singleton} - org.eclipse.smarthome.binding.wemo
2016-10-30 11:48:36.470 [DEBUG] [ome.binding.wemo.handler.WemoHandler] - WeMoHandler disposed.
2016-10-30 11:48:36.471 [DEBUG] [ome.binding.wemo.handler.WemoHandler] - Removing WeMo GENA subscription for 'org.eclipse.smarthome.binding.wemo.handler.WemoHandler@5f67ba00’
2016-10-30 11:48:36.472 [DEBUG] [org.eclipse.smarthome.binding.wemo ] - ServiceEvent UNREGISTERING - {org.eclipse.smarthome.core.thing.binding.ThingHandler}={thing.type=wemo:socket, thing.id=wemo:socket:Socket-1_0-221413K1100634, service.id=359, service.bundleid=213, service.scope=singleton} - org.eclipse.smarthome.binding.wemo
2016-10-30 11:48:36.473 [DEBUG] [ome.binding.wemo.handler.WemoHandler] - WeMoHandler disposed.
2016-10-30 11:48:36.473 [DEBUG] [ome.binding.wemo.handler.WemoHandler] - Removing WeMo GENA subscription for 'org.eclipse.smarthome.binding.wemo.handler.WemoHandler@661d2363’
2016-10-30 11:48:36.474 [DEBUG] [org.eclipse.smarthome.binding.wemo ] - ServiceEvent UNREGISTERING - {org.eclipse.smarthome.core.thing.binding.ThingHandler}={thing.type=wemo:socket, thing.id=wemo:socket:Socket-1_0-221519K1100E60, service.id=361, service.bundleid=213, service.scope=singleton} - org.eclipse.smarthome.binding.wemo
2016-10-30 11:48:36.476 [DEBUG] [ome.binding.wemo.handler.WemoHandler] - WeMoHandler disposed.
2016-10-30 11:48:36.476 [DEBUG] [ome.binding.wemo.handler.WemoHandler] - Removing WeMo GENA subscription for 'org.eclipse.smarthome.binding.wemo.handler.WemoHandler@2261ae40’
2016-10-30 11:48:36.480 [DEBUG] [org.eclipse.smarthome.binding.wemo ] - ServiceEvent UNREGISTERING - {org.eclipse.smarthome.config.discovery.DiscoveryService}={component.name=org.eclipse.smarthome.binding.wemo.discovery.WemoDiscoveryService, component.id=194, service.id=362, service.bundleid=213, service.scope=bundle} - org.eclipse.smarthome.binding.wemo
2016-10-30 11:48:36.480 [DEBUG] [.wemo.discovery.WemoDiscoveryService] - Stopping WeMo UPnP discovery…
2016-10-30 11:48:36.481 [DEBUG] [org.eclipse.smarthome.binding.wemo ] - ServiceEvent UNREGISTERING - {org.eclipse.smarthome.config.discovery.UpnpDiscoveryParticipant}={component.name=org.eclipse.smarthome.binding.wemo.discovery.WemoDiscoveryParticipant, component.id=195, service.id=363, service.bundleid=213, service.scope=bundle} - org.eclipse.smarthome.binding.wemo
2016-10-30 11:48:36.490 [DEBUG] [org.eclipse.smarthome.binding.wemo ] - BundleEvent STOPPED - org.eclipse.smarthome.binding.wemo

events.log
2016-10-30 11:48:00.652 [ItemStateChangedEvent ] - wemo1 changed from OFF to ON
2016-10-30 11:48:00.763 [ItemCommandEvent ] - Item ‘wemo1’ received command ON
2016-10-30 11:48:01.788 [ItemCommandEvent ] - Item ‘wemo1’ received command OFF
2016-10-30 11:48:01.793 [ItemStateChangedEvent ] - wemo1 changed from ON to OFF
2016-10-30 11:48:02.728 [ItemCommandEvent ] - Item ‘wemo1’ received command ON
2016-10-30 11:48:02.730 [ItemStateChangedEvent ] - wemo1 changed from OFF to ON
2016-10-30 11:48:03.700 [ItemCommandEvent ] - Item ‘wemo1’ received command OFF
2016-10-30 11:48:03.703 [ItemStateChangedEvent ] - wemo1 changed from ON to OFF

Thanks,
Matthew

I’ve found that once OpenHAB is running, if I then modify my wemo.things file (no changes just re-save), which causes it to reload the model then everything starts working properly…

Is this supposed to happen? Should I need to wait for other openhab services to start then re-initialize the binding. Is there some way to automate this (I don’t want to have to manually touch the file every time openhab starts)?

Thanks,
Matthew

Hi Matthew,
until I found a solution for this behaviour, you can try the following:
In Karaf console, type

bundle:list

to find the bundle number of WeMo binding
Then, either try

bundle:restart <Number of WeMo Binding>

or

bundle:stop <Number of WeMo Binding>
bundle:start <Number of WeMo Binding>

Best
Hans-Jörg

Hi,

Many thanks that seems to work to reinitialize the plugin.

Thanks,
Matthew

@hmerk - I have found a work around to this problem. Hopefully it helps the author of this plugin as this has been an issue for me for like 8+ months - but i just had a chance to sit down and look at it tonight. It appears to be a timing issue when other plugins are starting and the upnp framework not being completely available.

More info i posted here: WEMO Insight Switch not initalized after start openHAB2

My current workaround: https://github.com/DigitalBites/smarthome/tree/fix_wemo-startup-issues

Shamelessly borrowed the concept from the Sonos binding. :slight_smile:

Let me know if this helps. I want to improve the startup time and test it a bit more and I’ll create a pull request.

Thanks Jayson, I left some comments on your PR.

Best
Hans-Jörg

Thanks, restarting the WeMo bundle solved this for me as well.