Author Topic: Belkin WeMo plugin  (Read 85132 times)

Offline futzle

  • Beta Testers
  • Master Member
  • *****
  • Posts: 3255
  • Karma: +191/-9
Belkin WeMo plugin
« on: April 17, 2013, 06:46:28 am »
Edit 2015-01-12: This plugin is UNMAINTAINED. If it breaks for you then there is nothing I can do.  I no longer have any WeMo equipment.  If anyone wants to take ownership of the plugin please post here on the forum, or contact futzle on GitHub.

Edit 2013-06-23: I've packed up my WeMo devices and will be giving them to a family member.  I'll continue to support this plugin where possible, but I have to rely on users to capture logs to test.  If anyone wants to take ownership of the plugin please contact me.

It's been a long wait, but the Belkin WeMo plugin is now released to the MiOS app store.

In version 3:
  • Discover switches and sensors (that you have already added to your LAN through the iPhone app).
  • Control WeMo switches and get instant status back when a switch changes status.
  • Get instant status back when a WeMo motion sensor detects motion.

The user manual is at https://github.com/futzle/MiOS-WeMo.  Abbreviated instructions follow.

How to install:
  • Install the WeMo plugin from http://apps.mios.com/plugin.php?id=3726
  • Visit the device's Configuration tab to add WeMo devices that the plugin finds on your LAN.  One child device will be created for each in the dashboard.  Use Add Static if you have created DHCP reservations for your WeMo devices, Add Dynamic otherwise.
  • Highly recommended: Install the UPnP Event Proxy plugin from http://apps.mios.com/plugin.php?id=3716 (note that this plugin requires special steps to uninstall).  Without this extra plugin, you won't see status updates on Vera if you change a switch through the iPhone app.

Please try it out and report any feedback that you have on how well discovery works, whether instant status reporting continues to work after several hours, anything else you notice.
« Last Edit: September 08, 2015, 06:40:53 pm by futzle »

Offline parkerc

  • Sr. Hero Member
  • ******
  • Posts: 2411
  • Karma: +33/-45
  • Life Moves Pretty Fast....
Re: Belkin WeMo plugin released
« Reply #1 on: April 17, 2013, 05:27:33 pm »
Looks great @futzle,

i'm looking forward to trying it out, I've had my eye on some Wemo devices so now I have an excuse ;)

As for uPnP Event Proxy, is there a forum post to discuss that plugin? The reason for asking is that I'm curious about what it can do, e.g is there scope for it to see my uPnP adsl router information etc?
« Last Edit: April 17, 2013, 05:29:30 pm by parkerc »

Offline futzle

  • Beta Testers
  • Master Member
  • *****
  • Posts: 3255
  • Karma: +191/-9
Re: Belkin WeMo plugin released
« Reply #2 on: April 17, 2013, 05:45:04 pm »
As for uPnP Event Proxy, is there a forum post to discuss that plugin? The reason for asking is that I'm curious about what it can do, e.g is there scope for it to see my uPnP adsl router information etc?

Talk about the UPnP proxy plugin is happening here.

It implements only one part of the UPnP spec, namely, receiving asynchronous NOTIFY messages from a remote device. So it won't be much help in your stated use case.

Offline a-lurker

  • Hero Member
  • *****
  • Posts: 844
  • Karma: +58/-8
Re: Belkin WeMo plugin released
« Reply #3 on: April 17, 2013, 10:10:17 pm »
Good stuff.

Do you have to have a WeMo account for all this stuff to work - I suppose you do, if you want to use IFFT? I don't like the idea of having to rely on Belkin's servers for the next ten years. Likewise will it or is it possible to set up the gear without an iPhone? Ideally I would like all this to just work locally via Vera.

As an aside, I see that they are about roll out an actual light switch as well.

Offline futzle

  • Beta Testers
  • Master Member
  • *****
  • Posts: 3255
  • Karma: +191/-9
Re: Belkin WeMo plugin released
« Reply #4 on: April 17, 2013, 11:13:11 pm »
Do you have to have a WeMo account for all this stuff to work - I suppose you do, if you want to use IFFT?

I haven't signed up for an account yet, so that answers that. If I want to use IFTTT then I think will have to.

Quote
Likewise will it or is it possible to set up the gear without an iPhone? Ideally I would like all this to just work locally via Vera.

You do need the iPhone app to set up a device, but once you have done that you no longer need the app at all. I'm unlikely to want to add setup functionality to the Vera plugin; it's a lot of programming for something that you only do once.  Edit: Actually, the way you set up a WeMo device means you really have to have the app; it ships with a Wi-Fi access point which you have to join with your iOS device and teach it your existing Wi-Fi SSID and password.  Vera can't possibly do that, especially the Lite without any Wi-Fi radio.
« Last Edit: April 20, 2013, 08:22:45 pm by futzle »

Offline petequintanilla

  • Jr. Member
  • **
  • Posts: 61
  • Karma: +0/-0
Re: Belkin WeMo plugin released
« Reply #5 on: April 22, 2013, 05:50:12 pm »
Im pretty exited about integrating wemo to vera. I had installed the plugin, but under configure I doesn't detect any wemo on my LAN, even the wemos are working on my iPhone app. I had enabled UpnP on my router. And installed the UpnP event plugin.
Any clues?
« Last Edit: April 22, 2013, 05:51:52 pm by petequintanilla »

Offline futzle

  • Beta Testers
  • Master Member
  • *****
  • Posts: 3255
  • Karma: +191/-9
Re: Belkin WeMo plugin released
« Reply #6 on: April 22, 2013, 06:27:30 pm »
under configure I doesn't detect any wemo on my LAN, even the wemos are working on my iPhone app.

Thanks for trying.  You did reload the Luup Interface a couple of times, right?

I'll need you to capture a Luup log for me. Before you do, go to the main device's Advanced tab and change the Debug variable from 0 to 2.  Then SAVE and catch the log, and post it here (or PM it to me).  This will show the discovery process.

Can you describe the path you are expecting data to travel through between Vera and WeMo device?  For me it's:
VeraLite <--(ethernet)--> Unmanaged switch <--(ethernet)--> Access point <--(Wi-Fi)--> WeMo
Perhaps your network layout is one that the plugin doesn't yet consider.

Some things that will block traffic (so make sure you don't do any of these):
  • Using subnets.  Vera must be able to send multicast packets to the WeMo, and these don't (normally) cross subnets.
  • Crossing NAT.  If your access point is doing NAT, then it will block multicast packets.  It's OK if your router is doing NAT to your ISP, because that's all upstream.
  • Excessive firewalling.  If something in the data path is blocking multicast packets, then they won't get through

I do plan to support manual adding of WeMo devices at fixed IP addresses for users that can't get discovery working, but it's not in this version.

Quote
I had enabled UpnP on my router.

Don't do that, that's something else entirely.

Offline petequintanilla

  • Jr. Member
  • **
  • Posts: 61
  • Karma: +0/-0
Re: Belkin WeMo plugin released
« Reply #7 on: April 22, 2013, 08:27:33 pm »
When I reload the message im seeing is "Belkin wemo startup Lua failed"

Offline futzle

  • Beta Testers
  • Master Member
  • *****
  • Posts: 3255
  • Karma: +191/-9
Re: Belkin WeMo plugin released
« Reply #8 on: April 22, 2013, 09:25:33 pm »
When I reload the message im seeing is "Belkin wemo startup Lua failed"

Ah, then that is what needs to be fixed first. Discovery isn't going to work until you no longer get "startup failed".

Can you please capture a Luup log? Set Debug to 2 so I see all the UPnP conversation in the log.

Offline petequintanilla

  • Jr. Member
  • **
  • Posts: 61
  • Karma: +0/-0
Re: Belkin WeMo plugin released
« Reply #9 on: April 23, 2013, 02:41:47 pm »

Can you please capture a Luup log?

Im not quite sure on how to do this, I did a SSH, and saved all log, but it does not let me upload here because it has more that 2,000 character. I think I can't send you PM because I haven't reach the 25 messages or such.

Offline futzle

  • Beta Testers
  • Master Member
  • *****
  • Posts: 3255
  • Karma: +191/-9
Re: Belkin WeMo plugin released
« Reply #10 on: April 23, 2013, 05:40:14 pm »
petequintanilla, I've sent you a PM with my email address.

Offline futzle

  • Beta Testers
  • Master Member
  • *****
  • Posts: 3255
  • Karma: +191/-9
Re: Belkin WeMo plugin released
« Reply #11 on: April 24, 2013, 12:35:51 am »
Thanks petequintanilla, I have your log.  I see from the log that you have a Vera Lite running 1.5.622. Me too.

The plugin is sending out the discovery, and getting back only one reply, from Vera itself at 192.168.11.126.

I take it that you've got no other UPnP devices on that subnet? Or that if there are, they are all wireless? I'm trying to establish how many devices should have responded, and from what IP addresses.

My working theory is that something between Vera and the WeMo is blocking the multicast UDP packet from crossing from the wired network to the wireless network, probably the router/access point. This apparently happens all the time in consumer equipment, and a lot of the time there isn't even a way to turn off this blocking. If the setting exists at all, it might be called "isolate wireless clients" (disable it) or "bridge wireless and wired networks" (enable it), or something else  And you might have to mess with the netmasks of your wired and wireless subnets to put them into the same logical subnet. Or the setting may just not exist.

This is the bane of UPnP in general; it's not something specific to Vera or WeMo. It would be useful to see you run a UPnP discovery tool on a PC that is connected to the network in the same way as Vera (i.e., no wireless). It should produce the same result, i.e., only the Vera responding.

If you are comfortable with messing around with your router/access point settings, you can see if it gets you anywhere. Otherwise, I'll be adding manual configuration to the plugin soon, which will let you bypass discovery and put the WeMo's IP address in directly.

Offline petequintanilla

  • Jr. Member
  • **
  • Posts: 61
  • Karma: +0/-0
Re: Belkin WeMo plugin released
« Reply #12 on: April 24, 2013, 01:09:16 am »
Futzle thanks for all efforts, i checked isolated wireless clients and it disabled, the networks connections are bridged, i will keep on trying but if not im afraid i have to wait for your new plugging.


Offline futzle

  • Beta Testers
  • Master Member
  • *****
  • Posts: 3255
  • Karma: +191/-9
Re: Belkin WeMo plugin released
« Reply #13 on: April 25, 2013, 06:14:01 am »
Version 4 has been submitted to the app store at apps.mios.com.

In this version: fixed a Lua startup crash found by petequintanilla (thanks); manual addition of WeMo devices if automatic discovery is not working for you.

Note that manual addition of devices has to know the IP address of the WeMo device, which has to remain static for the lifetime of the plugin.  So if you use this feature then you will have to tell your DHCP server (probably your router) the WeMo device's MAC address and give it a fixed IP address.  This is a good idea anyway for devices that are always in your home.

Compatibility notice for users on Version 3: If you have any child WeMo devices that you added with "Add Static", they need to be Removed then re-added (or you can delete the whole plugin and re-install it).

Offline petequintanilla

  • Jr. Member
  • **
  • Posts: 61
  • Karma: +0/-0
Re: Belkin WeMo plugin released
« Reply #14 on: April 25, 2013, 09:09:20 pm »
Version 4 has been submitted to the app store at apps.mios.com.


 Do you know how long will it take to appear version 4 in the App Store as its still showing v 3.0?