Coding Belkin WeMo Switch C# .NET API Library – Auto Power Cycle Cable Modem On Disconnect

A lot of you requested that I do a video with some software development in it. Well it turns out a gift I received a few months ago from my friend Greg in the form of a Belkin WeMo switch turned on a lightbulb over my head (No pun intended, or was it… I forget). Anyways here is the video showing you the C# .NET code written in Visual Studio 2012 and the command line batch script that drives the WeMo application I developed to automate the process of detecting when the internet is not reachable and powercycling the cable modem automatically and as many times as it takes before internet is restored.

This will solve the huge problem I have where my cable modem goes offline during vacation and I can’t remote to my machine or the cable modem locks up while we’re watching Netflix in the bedroom and I have to go to the closet and unplug it and get out of my nice, warm, cozy bed!

I hope you guys enjoy the video and take a look at the code and I hope some developers or aspiring developer see this video and find a use for the code I have created and continue to build on it and make it better. Due to the huge time constraints on this project because of my busy life I had to skip a lot of error checking and segmentation steps to make the code perfect but I got to the point where it serves my purpose.

The cool thing this project demonstrates is that even though Belkin didn’t release any software to control these devices outside of the iOS platform (iPhone & iPad) it is possible to intercept the traffic from these devices and devise a way to communicate with them in a supported way from any platform (Windows, .NET framework, etc). Now other people can utilize this library to build more robust automation and do some seriously cool things with these devices (christmas lights anyone)?

If it plugs in, you can turn it on or off with WeMo. Just plug your lamp, or fan, or stereo (almost anything) into the WeMo Switch, and you’re ready to control it with the WeMo app.

Technology Used:
.NET 4.5
Visual Studio 2012 Ultimate
Windows 8
Windows 7
Command Script (Batch File)

Source Code + Binaries:

Jerry This show is an independent production of Jerry Berg (aka Barnacules). Opinions are my own and do not necessarily reflect the opinions of my employer, friends, or any companies mentioned in the show. Email business inquiries to Help the channel by donating BitCoin to 1MfVZVMjfUUq8srg1d4RbgXR5e7JLw7R6P

▼ Support me by sending BitCoin (Wallet Address) ▼

▼ Get 10% off Kinesis Split Ergonomic Keyboards & Pedals ▼

▼ Join my Folding@Home team and help cure diseases with spare CPU/GPU cycles ▼
Barnacules Nerdgasm Team # 231300
Download Client @
** Top 10 contributers shown on Twitter weekly!

▼ I am now live streaming on Twitch so come give me a follow to receive notifications when I’m streaming ▼