Using the Expire binding with Wemo things on OpenHAB 2.0

I’m having a great deal of trouble getting my Wemo lights and switches to automatically turn off after a given amount of time, using the Expire binding. I have a feeling the problem is that the Wemo binding is a 2.0 binding but Expire is an old fashioned 1.x binding.

Given these auto-discovered things:

  • a wemo switch : wemo:socket:Socket-1_0-221402K1100XXX
  • a wemo link lightbulb: wemo:MZ100:Bridge-1_0-231518B0100683:94103EA2B277XXXX

How do I create timer switch items for those things, binding them to Expire? The switches need to be turned on by rules, and automatically turn themselves off. My latest effort looks like:

in the wemo.items file:

  • Switch Switch_Timer “Switch Timer [%s]” { wemo=“Socket-1_0-221402K1100XXX;state”, expire=“10s,command=OFF” }

  • Switch Lightbulb_Timer “Lightbulb Timer [%s]” { wemo=“MZ100:Bridge-1_0-231518B0100683:94103EA2B277XXXX;state”, expire=“10s,command=OFF” }

But Sending the command ON or OFF to the timer switches has no effect. For instance Switch_Timer.sendCommand(ON) does nothing when I expect it to turn on the Wemo switch.

What should those items look like?

Thanks!

John

I don’t use that binding but from looking into the docs your item definition is wrong:

Wemo binding: Switch Socket1 { wemo="Socket-1-0-12345678" }
Belkin Wemo binding: Switch DemoSwitch { channel="wemo:socket:Switch1:state" }

I wouldn’t worry about that, it is a quite new binding and working very well in openHAB2.

As Sihui already wrote, your items definition is “1.x” style, and not adressing the thing channels.

Thanks. It’s still not clear to me what I should do.

Are you saying I should use the Belkin Wemo Binding rather than the Wemo binding?

Does that mean I can’t use autodiscovery of the things, but have to manually define the things, and then define the items using the names I created in the things file?

An example of how to do it, based on the things I have listed, would be very helpful!

John

OK, I figured it out. Using Belkin Wemo bindings was the trick, as suggested.

For anyone who finds this, this is what I did:

I used a wemo.things file to give my things meaningful names (in my case Sherlock for the socket, Main for the lighting bridge and Bookshelf for the lightglobe in question):

wemo:socket:Sherlock [udn="Socket-1_0-221402K110XXXX"]
Bridge wemo:bridge:Main [udn="Bridge-1_0-231518B010XXXX"] {
  MZ100 Bookshelf [ deviceID="94103EA2B277XXXX" ]
}

Then I used those names in the wemo.items to bind them to the Expire binding:

Switch Sherlock_Switch    { channel="wemo:socket:Sherlock:state" }
Switch Sherlock_Timer { channel="wemo:socket:Sherlock:state", expire="10m,command=OFF" }
Switch Bookshelf_Right_Switch { channel="wemo:MZ100:Main:Bookshelf:state" }
Switch Bookshelf_Right_Timer { channel="wemo:MZ100:Main:Bookshelf:state", expire="10m,command=OFF" }

So now, I can turn the things on or off using the normal _Switch, and turn them on with 10 minute timer using the _Timer switch.

thanks!

John

1 Like