I picked up a WeMo a few weeks ago. It is a pretty handy little device. Basically, it allows me to turn a light switch on an off via the internet. You can also connect it to IfThisThenThat (ifttt.com) for some interesting automation possibilities.
When I picked up the device, I already knew that an official app did not exist for Windows Phone, so I figured I would end up writing on myself, and so it begins.
What I have figure out so far…
This device needs to be configured first using the official iOS/Android app, after that you can do a little hacking. WeMo connects to your network just like any other device but it is a UPnP device. It sits quietly on your network and listens for requests. After it receives the UDP broadcast it then gets pretty chatty. After I issue an SSDP request, all devices (including my WeMo) respond. The WeMo responds with a packet.
I inspect the packet (some names have been changed to protect the innocent)
"HTTP/1.1 200 OK"
"DATE: Sat, 08 Feb 2014 13:43:32 GMT"
"OPT: \"http://schemas.upnp.org/upnp/1/0/\"; ns=01"
"SERVER: Unspecified, UPnP/1.0, Unspecified"
Great. Now I have the location, which I need to get information about this device.
I can now inspect the XML (some names have been changed to protect the innocent)
Belkin International Inc.
Belkin Plugin Socket 1.0
Great. Now I can get the information I need and issue SOAP requests.
I start creating a simple app. First discovering all UPnP device, then narrowing it down to ones that have a WSDL file I can parse like XML.
This approach worked well until about an hour later. After testing, I found that the WeMo stops responding to SSDP broadcasts. I can no longer discover it.
The device is still on the network, still responds to a ping. and I can still control it using the iOS app / IfThisThenThat. It seems like the device stops responding to local requests after it is connected to the internet for about an hour. I hope this isn’t the case and it is just a bug in the firmware. If this is by design I will be stuck in the water until Belkin releases an API for WeMo devices. Resetting the device does allow it to be discovered on my local network, but after about an hour it stops responding to SSDP. Is there anyone else out there seeing this? I hope this is not by design and possibly a defective unit.