WeMo in OPenhab 2

648 views
Skip to first unread message

karsten.k...@gmail.com

unread,
May 13, 2015, 12:15:29 PM5/13/15
to open...@googlegroups.com
Hi Hans-Jörg,

just downloaded latest version from Cloudbees - using the minimum installation.

I have several standard switches on the network - as well as one insight switch.

I can work with them easily under openhab 1.6.2 and switch them on and off. 

With the current cloudbees version i tried to discover the things in the PaperUI - with no success. I even did a shutdown of OH1.6x - to ensure there is no issue in the discovery.Bit still no success.

start_debug shows a successfull run of the discovery service:

2015-05-13 18:13:38 [DEBUG] [.e.s.i.r.c.d.DiscoveryResource:73   ] - Scan for binding 'wemo' successfully finished.


is there any trick to enable those? Belkin WeMo app as well shows them and works like smart. Firmware Version is 2.x of the switches.

Cheers and thanks
Karsten

Hans-Jörg Merk

unread,
May 13, 2015, 1:09:16 PM5/13/15
to open...@googlegroups.com
Hi Karsten,
sorry, no clue on first sight.
There was nothing to be done with the snapshots i tested, so I might try latest snapshot tonight and figure out what's going wrong.

Best
Hans-Jörg

Hans-Jörg Merk

unread,
May 14, 2015, 6:09:19 PM5/14/15
to open...@googlegroups.com
Hi Karsten,
this one nearly drove me crazy, but I could track it down to the latest firmware update provided by Belkin.
Just set up a new WeMo insight switch which wasn't unboxed and has an old firmware.
This one works and is placed in inbox as it should be, whereas all my other WeMos with new firmware are not seen, like you described.

Now comes the ugly part, to figure out what had changed in the firmware to make the WeMos not respond to UPnP discovery messages.

@All WeMo Users reading this : DONT UPGRADE YOUR FIRMWARE IF YOU WANT TO TEST THEM WITH OH2 !!!!!!!!!!

I'm still trying if the WeMos work with OH1 binding.

I'll keep you posted.

Best regards
Hans-Jörg
Message has been deleted

karsten.k...@gmail.com

unread,
May 15, 2015, 12:51:32 AM5/15/15
to open...@googlegroups.com
Hmm,

meanwhile i did some testing as well. I removed the devices from Powerplug and put them back in. Then i switched them on/off with the Wemo Android app. And after some refresh of the search activties in PaperUi they are now showing up in my "inbox". All (2xswitch &1xinsight) of them with a 2.00xxx Firmware. 

I will test later on with a plug that has as well still an old FW below 2.xx as this is the 'move' plug for any special activities i need in my house. this is currently offline and not connected to the net. 

In regards to OH1 - they still work for me like charm with the 2.x FW.

Cheers
Karsten

Kai Kreuzer

unread,
May 15, 2015, 3:14:40 AM5/15/15
to open...@googlegroups.com
> In regards to OH1 - they still work for me like charm with the 2.x FW.

This gives some hope that it should only be a minor fix in openHAB 2…
Thanks for investigating this, guys!

Kai

-- 
You received this message because you are subscribed to the Google Groups "openhab2" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openhab2+u...@googlegroups.com.
To post to this group, send email to open...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openhab2/3280c468-389b-47ba-8ae5-70d48236dfde%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Hans-Jörg Merk

unread,
May 15, 2015, 3:48:01 AM5/15/15
to open...@googlegroups.com
Hi,
I am afraid not.
I had my WeMos updated to latest firmware 2.00.8643.PVT-OWRT and they stopped working.
The one which still works is on firmware 2.00.3007.PVT.

@Kai and Karsten, could you both check the firmware versions of your WeMos which work.

Best
Hans-Jörg

Kai Kreuzer

unread,
May 15, 2015, 3:50:12 AM5/15/15
to open...@googlegroups.com
So they also stopped working for openHAB 1?
Sure, I will check with mine.
> To view this discussion on the web visit https://groups.google.com/d/msgid/openhab2/bdce3274-f2b7-4257-ae54-44bebd219b78%40googlegroups.com.

Kai Kreuzer

unread,
May 15, 2015, 4:21:27 AM5/15/15
to open...@googlegroups.com
Mine is a WeMo Insight with firmware 2.00.7166.PVT.
It works flawlessly on openHAB 2.
Shall I upgrade the firmware and test again?

Regards,
Kai

> Am 15.05.2015 um 09:48 schrieb Hans-Jörg Merk <josh....@gmail.com>:
>
> To view this discussion on the web visit https://groups.google.com/d/msgid/openhab2/bdce3274-f2b7-4257-ae54-44bebd219b78%40googlegroups.com.

Hans-Jörg Merk

unread,
May 15, 2015, 5:23:36 AM5/15/15
to open...@googlegroups.com
Better not to upgrade cause there is no downgrade option.
I will try to figure out what is causing the problem here and how to patch JUPnP to get the new firmware running again.
Best
Hans-Jörg

Kai Kreuzer

unread,
May 15, 2015, 5:27:52 AM5/15/15
to open...@googlegroups.com
Ok, thanks, I will wait for your update then!
> To view this discussion on the web visit https://groups.google.com/d/msgid/openhab2/8a921c0d-f39e-42ec-a9ab-55948eaffe06%40googlegroups.com.

Hans-Jörg Merk

unread,
May 15, 2015, 2:03:07 PM5/15/15
to open...@googlegroups.com
Hi,
just googled a bit and think that I found an information about the Problem.
It seems like Wemo has stopped responding to SSDP discovery requests with an ST value of ssdp:all and only responds to ST value equal upnp:rootdevice.
I will try this tonight with the oh1 bindind, cause it is easy to implement there.
If thats the cause of the problem, I will check if we can implement this in JUPnP as well.

Keep you posted.
Best
Hans-Jörg

Hans-Jörg Merk

unread,
May 15, 2015, 6:15:50 PM5/15/15
to open...@googlegroups.com
Hi again,
changing the SSDP discovery request solved the problem for openbHAB 1.x, my PR is waiting to be merged.

For having no straight idea how to fix this within JUPnP, this will take a bit longer.

@Kai, I hope to have this fixed by mid of next Week so we have it ready for the Alpha2 release.

Best Regards
Hans-Jörg 
> >>> To unsubscribe from this group and stop receiving emails from it, send an email to openhab2+unsubscribe@googlegroups.com.
> >>> To post to this group, send email to open...@googlegroups.com.
> >>> To view this discussion on the web visit https://groups.google.com/d/msgid/openhab2/bdce3274-f2b7-4257-ae54-44bebd219b78%40googlegroups.com.
> >>> For more options, visit https://groups.google.com/d/optout.
> >
> > --
> > You received this message because you are subscribed to the Google Groups "openhab2" group.
> > To unsubscribe from this group and stop receiving emails from it, send an email to openhab2+unsubscribe@googlegroups.com.

Thomas Eichstädt-Engelen

unread,
May 16, 2015, 8:46:58 AM5/16/15
to open...@googlegroups.com, josh....@gmail.com
PR is merged … Thanks Hans-Jörg

Kai Kreuzer

unread,
May 16, 2015, 8:47:31 AM5/16/15
to open...@googlegroups.com
@Kai, I hope to have this fixed by mid of next Week so we have it ready for the Alpha2 release.

Ok, thanks! I hope you will find a solution! As it seems, WeMo does not respond on generic scans anymore, but needs to be specifically queried for. I would think that jUPnP supports this as well - but you probably will need to write your own DiscoveryService for it, you cannot do it as a UPnPDiscoveryParticipant anymore :-(

Regards,
Kai

Message has been deleted

Hans-Jörg Merk

unread,
May 16, 2015, 5:05:33 PM5/16/15
to open...@googlegroups.com
Hi Kai,

not only that they do not repsond on generic requests any more, they also do not respond on requests for all devices and services, which is the standard in JUPnP.
So I think I will have to write my own DiscoveryService, cause changing the search target in JUPnP is not an easy way.

Best Regards
Hans-Jörg


> >>> To view this discussion on the web visit https://groups.google.com/d/msgid/openhab2/bdce3274-f2b7-4257-ae54-44bebd219b78%40googlegroups.com.
> >>> For more options, visit https://groups.google.com/d/optout.
> >
> > --
> > You received this message because you are subscribed to the Google Groups "openhab2" group.
> > To unsubscribe from this group and stop receiving emails from it, send an email to openhab2+u...@googlegroups.com.
> > To post to this group, send email to open...@googlegroups.com.

Kai Kreuzer

unread,
May 16, 2015, 5:31:21 PM5/16/15
to open...@googlegroups.com, josh....@gmail.com
Hi Josh,

Would maybe calling something like

upnpService.getControlPoint().search(new USNRootDeviceHeader());

suffice?

Regards,
Kai

Hans-Jörg Merk

unread,
May 16, 2015, 5:42:22 PM5/16/15
to open...@googlegroups.com, josh....@gmail.com
Hi Kai,

I am also reading the cling documentations and found the different search options.
I will try and see how the WeMos react on this.

Best
Josh

Hans-Jörg Merk

unread,
May 18, 2015, 4:58:14 PM5/18/15
to open...@googlegroups.com, josh....@gmail.com
Hi Kai,

just gave it a try, but with no success.

JUPnP does only accept USNRootDeviceHeaders with a ROOT_DEVICE_SUFFIX = "::upnp:rootdevice" but the WeMo's use ROOT_DEVICE_SUFFIX = "::urn:Belkin:device:controllee:1"

I will pass the question to the cling group to see if they can come up with an idea how to "easily" override the STAllHeader.

Best
Josh

Am Samstag, 16. Mai 2015 23:31:21 UTC+2 schrieb Kai Kreuzer:

Kai Kreuzer

unread,
May 18, 2015, 5:00:14 PM5/18/15
to open...@googlegroups.com
Thanks for the update.
Otherwise we would have to fallback to a self-written discovery service. This is what you have in place for openHAB 1, right?

Hans-Jörg Merk

unread,
May 18, 2015, 5:16:34 PM5/18/15
to open...@googlegroups.com
Yes, that's what I did for openHAB 1, but I have no clue, how to write a WeMo specific discovery service for openHAB 2.
In openHAB1, it is just the binding using the information extracted from discovery, whereas in openHAB 2, this needs to be published to several places, I guess

Kai Kreuzer

unread,
May 19, 2015, 11:07:16 AM5/19/15
to open...@googlegroups.com
Not sure if I understand your concern.

Couldn’t you simply implement a WemoDiscoveryService and use the code from your wemoDiscovery() implementation of openHAB 1 within this? All you need to do is to create a DiscoveryResult from the response - no need to „publish to several places“.

Regards,
Kai


Hans-Jörg Merk

unread,
May 19, 2015, 1:38:53 PM5/19/15
to open...@googlegroups.com
It wasn't a real concern, more like a question how to implement this.
in the meantime I came closer to a solution patching JUPnP, which is my preferred way.

I would like to be able to use JUPnP, so I can move on to implement GENA subscriptions and the use of UPnP actions.

Regards
Josh

Hans-Jörg Merk

unread,
May 21, 2015, 10:26:09 AM5/21/15
to open...@googlegroups.com
Hi Kai,

I followed your suggestion and wrote a WemoDiscoveryService.

The complete Binding is now independent of JUPnP and works fine with all my WeMo switches.

I will create a PR to ESH in a couple of minutes.

Best Regards
Josh

Am Dienstag, 19. Mai 2015 17:07:16 UTC+2 schrieb Kai Kreuzer:

Kai Kreuzer

unread,
May 21, 2015, 12:12:59 PM5/21/15
to open...@googlegroups.com
Thanks Josh, seems to work smoothly again!
What does this mean to your plans to use jUPnP GENA subscriptions? I guess this is now rather out of scope, right?

One drawback of the new implementation is that you require a local listening socket (port 1901), so for people using a firewall, this is a new constraint.

When you say "JUPnP does only accept USNRootDeviceHeaders“, this refers to incoming messages? Or did you mean that you can only send out such requests? If the latter, did you check whether you can manually send a broadcast and have jUPnP receiving the responses to it?

Regards,
Kai

Hans-Jörg Merk

unread,
May 21, 2015, 5:56:01 PM5/21/15
to open...@googlegroups.com
Hi Kai,

it's funny, after I created the PR and closed my question at CLING (which I reopened now), I got some comments from Christian Bauer, saying that there should be no need to patch JUPnP/CLING.
Again, I asked to give me an example, how to initiate the needed search method.

So to answer your question, no, using UPnP actions and GENA subscription is not out of scope, it just might take a bit longer. Meanwhile, we could use my actual implementation

The limitation I quoted regars to sending discovery messages.
I found a way to add a new search method for sending a discovery message with ST:upnp:rootdevice (which is needed by WeMo devices), but this would lead to send out to requests,

upnpService.getControlPoint().search
upnpService.getControlPoint().search(STRootDeviceHeader)

I hope to have the final "solution by Saturday night.

Best Regards
Josh

karsten.k...@gmail.com

unread,
May 22, 2015, 2:49:10 AM5/22/15
to open...@googlegroups.com
Hi both,

is the updated version already on Cloudbees?

Cheers
Karsten

Hans-Jörg Merk

unread,
May 22, 2015, 2:58:22 AM5/22/15
to open...@googlegroups.com
No, but I think we will have it ready for the Alpha2 release this weekend.

Best
Hans-Jörg

Kai Kreuzer

unread,
May 22, 2015, 3:07:22 AM5/22/15
to open...@googlegroups.com
Hi Josh,

Thanks for the update. I think your current (custom) implementation is fine for the alpha 2 release, so I would not try to rush a solution with jUPnP.
So let’s better take some time and test it and update the code after the alpha 2 release. Would you agree?

Best regards,
Kai


Hans-Jörg Merk

unread,
May 22, 2015, 5:55:43 AM5/22/15
to open...@googlegroups.com
Hi Kai,

yes, absolutely agreed.
I closed the old PR and created a new one woth incoporating your comments and also removed the picture in the README.

So from my side LGTM :-)
Please feel free to merge.

Best Regards
Josh

karsten.k...@gmail.com

unread,
May 22, 2015, 9:57:41 AM5/22/15
to open...@googlegroups.com
Thanks for the pace!

Just finished a notification setting between OH1 and OH2 using the Wemo Insight power consumption in combination with the REST interface and http binding.

Works like charm! Looking forward to move all to OH2 in near future.

WAF is extremly high - my wife gets notified by OH/ Habdroid when the whashing machine is finished :) - so no unnecessary ways into the cellar.

Cheers
Karsten

Hans-Jörg Merk

unread,
May 22, 2015, 10:48:34 AM5/22/15
to open...@googlegroups.com
Hi Karsten,

my changes have been merged, so the new version should be available soon on cloudbees snapshot.

Just let me know, if there seems to be any problem.

Best Regards
Hans-Jörg

Kai Kreuzer

unread,
Sep 10, 2015, 10:37:03 AM9/10/15
to openhab2
Hi Josh!
 
I hope to have the final "solution by Saturday night.

Which Saturday night were you exactly referring to...? ;-)
Any chance to get a solution that works again with jUPnP?

Cheers,
Kai 

Kai Kreuzer

unread,
Sep 10, 2015, 11:16:44 AM9/10/15
to open...@googlegroups.com
Hi Josh,

I just found out that there is a new firmware since August: http://community.wemothat.com/t5/WEMO-Hardware/New-WEMO-Firmware-Rollout-7-30-2015/m-p/12603#U12603.

The release notes list:
  • Improved discovery of devices on network

My colleague just noticed that discovery is working with the OLD implementation (based on jUPnP). So possibly all there is to do is to revert your latest fix?

Could you have a look?

Cheers,
Kai


--
You received this message because you are subscribed to the Google Groups "openhab2" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openhab2+u...@googlegroups.com.
To post to this group, send email to open...@googlegroups.com.

Hans-Jörg Merk

unread,
Sep 12, 2015, 5:28:46 PM9/12/15
to openhab2
Hi Kai,

I just gave it a try, but can not confirm tha jUPnP discovers any of my WeMo devices.
Perhaps your colleague could get in touch with me so we can discuss what he did to have them discovered again.
Just send him my contact details.

Regarding your earlier post, I was talking about the Saturday when I implemented the WeMo Discovery Service and created the PR. :-)

Best
Josh 

Kai Kreuzer

unread,
Sep 12, 2015, 5:34:11 PM9/12/15
to open...@googlegroups.com
Hi Josh,

Hm, are you also using the latest firmware version?

Regarding your earlier post, I was talking about the Saturday when I implemented the WeMo Discovery Service and created the PR. :-)

No, because the final solution that you refer to is one that should use jUPnP:

upnpService.getControlPoint().search
upnpService.getControlPoint().search(STRootDeviceHeader)

I hope to have the final "solution by Saturday night.

And the current one (which was the quick fix for the alpha 2 release) is still your custom SSDP broadcast, isn’t it?

Best regards,
Kai


Message has been deleted

Hans-Jörg Merk

unread,
Sep 12, 2015, 8:00:54 PM9/12/15
to openhab2
Hi Kai,

yes, I am running latest firmware.

Reading the complete thread again, I think there was a misunderstanding between us. What I meant with final solution was having the binding working again before ALPHA2 release.

Anyway, I just gave it some more tries and now found a solution to have the WeMo devices discovered again by using jUPnP.

The discovery is startet by using

upnpService.getControlPoint().search(new STALLHeader)
If we add a second search straight after this by using

          upnpService.getControlPoint().search(new RootDeviceHeader) 

the WeMo devices are discovered again.

Switching back to using jUPnP leads again to errors polling the actual state of the devices. I see communication errors in the debug log.

As a conclusion I will have to solve more WeMo issues with using jUPnP (getting the services and use proper UPnP actions)

Just need to find time for doing so.....

Best
Josh

Kai Kreuzer

unread,
Sep 14, 2015, 5:40:35 AM9/14/15
to open...@googlegroups.com
Hi Josh,

Thanks for looking into this!

Anyway, I just gave it some more tries and now found a solution to have the WeMo devices discovered again by using jUPnP.
the WeMo devices are discovered again.

That sounds good! Would it be easy to create a PR that changes (only the discovery) to use this mechanism? The current implementation has the drawback that it requires to open another local post (1901), which is not necessary with the jUPnP approach, so this would be a nice improvement.

Switching back to using jUPnP leads again to errors polling the actual state of the devices. I see communication errors in the debug log.

This part is imho not really urgent, but rather a nice to have. Your current code works and didn’t break through any firmware upgrade, so that’s good :-)

Cheers,
Kai

Hans-Jörg Merk

unread,
Sep 14, 2015, 1:15:20 PM9/14/15
to openhab2
Hi Kai,
I will see what I can do until the weekend.

Best
Josh

karsten.k...@gmail.com

unread,
Sep 15, 2015, 3:19:38 AM9/15/15
to openhab2
Hi Hans-Jörg,
Just wondering - as i did not made the FW ugrade so far. As my standard OH still runs on 1.7 with the 1.8 binding Snapshot - have you tested this one as well? Or would you like me to update and test?

cheers and thanks
Karsten

Hans-Jörg Merk

unread,
Sep 15, 2015, 2:55:12 PM9/15/15
to openhab2
Hi Karsten,
The latest firmware is working with my development system, so shure, give it a try.

Best
Hans-Jörg
Reply all
Reply to author
Forward
0 new messages