WEMO Ideas

Showing results for 
Search instead for 
Do you mean 

Raspberry Pi as webserver, and controller

by mike_h on ‎01-07-2015 03:56 PM

Love my wemos, but wanted more functionality:


1)  I wanted faster access (iPhone app delays aren't impressive)

2)  I wanted more rules, for example:

    a) turn a light off 90 minutes after it was manually switched on by a family member

    b) do not turn on the watering system if the published (website) forecast for rain is more than 70%

    c) do not turn on the watering system if it is actually raining


To achieve these things, I have set up a Raspberry Pi as a wemo server (and web server):


1)  Faster access is acheived by the Raspberry Pi serving web pages which are optimized for mobile phone display

     -> Immediate "start up" from mobile (just loading a web page ... and iphone lets me put an icon on the home page to click)

     -> Immediately available remotely (anywhere in the world)


2)  Raspberry Pi deals with the issues of finding the wemos, keeping subscriptions to their events current, and dealing with any communication errors etc.


3)  Raspberry Pi web pages allow me to set special rules etc.  The rules are either "input" rules (responding when someone switches a switch, or there is motion) ... or "timed" rules (eg time of day, sunset, sunrise, etc).


The Raspberry Pi is programmed in C ... so it is very fast, and very efficient.  It uses freely avaiable coding for all its parts.


Total cost for setting this up ?   $AU 38.00 for the Raspberry Pi.


I have written the program for myself, for fun.  It isn't great coding, and it isn't written to be production ready (or even made available generally to the public).


I publish this short note just wondering if there are other people out there who have interest in this kind of thing.


PS.  I tried "ouimeaux" but found it a bit tricky and it did not do what I wanted.  My Raspberry Pi has never crashed with the current version of the program (many weeks running ... only rebooted when I update the software).

by melduforx
on ‎01-15-2015 03:49 PM

I have been using the Wemo android app and it has been mostly good.  There were some issues with the updates that took place, but it has been very stable as of late.  I'd been very interested in your code for the Rasberry Pi as having better control over the Wemos is very useful to me.


Would you be willing to post the code?

by grahambb
on ‎01-31-2015 03:28 PM

Try looking at openHAB, it can do most of what you want.

by MapleLeafs
on ‎02-05-2015 02:06 PM
I have been going all the way down to the physical layer and doing my home automation with straight RF remote control. Wemo's present scheme is to give everything an IP address. I say, give the Pi an IP address and it "routes" the queries via straight RF. I have found the on/off performance too slow and unreliable going through the entire HTTP stack. Which if you're not at home, okay, but at home I want it instantaneous and in sync. Anf if you're worried about security, simply take the Pi off the gateway.
by WEMO Maker Inventor
on ‎02-05-2015 08:45 PM

And a 3rd option - Walmart as the "Zinger ZTE" android 4.4.2 (kitkat) phone "rolled back" to $19.99.  It's no barn stormer, but I've verified that it runs WemoManager and more just fine.  Fast wifi, battery backup and a built in touch screen.  You don't need to activate it as a phone to use it as a local mini-tablet/WemoServer. 


It's no a cakewalk but it's easier to setup and use than oiumaux or the Raspberry Pi (though WemoManager will run there too) and it's professionally supported.  Yeah, I realize which is easier is subjective, but I think the Zinger wins on value and considering that 3 wemos are close to $150 it's hard to argue too much over price.


WemoManager has a pretty rich rule set and it integrates well with other apps like Tasker, Automagic, Google, and more.  You can see more here if interested.


And to second MapleLeafs (is it just me or are there a lot of fellow canucks on this board?), security needs to be given a lot of thought.  The Wemo's themselves are very secure.  But if you set up an HTTP server on a PC or  raspberry and expose it to the internet you're going to be discovered by the hacker armies.  Maybe nothing will happen, but you never know - and you've built a bridge for them into your local network.  (WemoManager has a built in encrypted web server and service).

by MapleLeafs
on ‎02-06-2015 09:07 AM
We are trying to juggle two tradeoffs here: security and standards. The lack of standards is killing IoT, which everybody is trying to tackle--which in turn produces a litany of standards. HTTP is already an established standard with which people are trying to build on. The value add for wemo is the ability to control things remotely via your cell phone and/or the internet. If I just wanted to automate my house while I'm in or near the house, I can get a good 15-channel RF remote with 15 transceivers for $250. Wemo presently offers the option not to allow remote access--that addresses your security--but that leaves you paying triple the money for something that is slower. The lack of standards doesn't exactly help straight RF, either, since if your and your neighbors' devices are all talking willy nilly on the 315Mhz and 433MHz bands (at least we've got a standard for that), pretty soon you're all confusing the heck out of each other. That's why we have 802.11 and IP.
by WEMO Maker Inventor
on ‎02-06-2015 11:04 AM

Yeah, I agree, RF is a problem (the higher cost rolling code ones are better), but they lack remote access.  I'm not a fan of the proprietary hubs, too expensive and typically closed systems.  Zigbee has some potential for secure open standard based local control and it's gaining support.  But as you point out, no proper standards yet for the IoT.


There's some low cost "cloud" based remote switches competing with Wemo from no name overseas companies, but you need to be a very trusting person to let them onto your private network.  (Same with IP cameras - if you're using an import version it's a good idea to see if it's calling "home" to any overseas web servers, many do).


This wild west is why I'm not a fan of the IoT for home automation and likely never will be - it gives up too much privacy, security, reliability and performance for the sake of convenience.  But, like wemo remote access, I guess it's ok for casual use by the bulk of the market.


What I'm after is an INTRAnet of things for home automation - secure but open local interoperability.  Remote access only where I personally and tightly control the server and any IoT interaction.  For example only allow incoming geofence messages that don't expose what they're about, and don't broadcast my home status to anyone but me (and encrypt it when it does).  This is the real core/goal of WemoManager - built on an open platform (android) using it's standard app interaction, it's secure, reliable, easy to upgrade, and it's compatible with automation apps like Tasker, etc. and anything else you can put on android or get to using http.

by MapleLeafs
on ‎02-08-2015 09:15 PM

Raspberry Pi could very well be the non-proprietary hub; since, after all, the whole Raspberry Pi project is in itself open source.    Your setup you did with an old cell phone is good for end users and mobile software developers, but it's a closed system to hardware people.   And not very open source.   Pi is strong at prototyping, but not so good at cost and packaging (as cheap as a $30 computer may seem, it adds up when you put on a case, a Wifi board, a touchscreen TFT, a breadboard, and whatever else--when you can get a decent tablet for $80).   But still, both solutions completely blow Wink Relay and Wigwag Relay out of the water (at $199/$299 apiece, and no touchscreen).   What I also like about Pi is that I can wire relays directly to the hub.  Wireless is optional.


As far as yet another Canuck on the board--two words:   Bloomington and Yonge.

by grahampowell
‎02-13-2015 07:39 AM - edited ‎02-13-2015 07:43 AM

I am very interesated. maybe i can help with some of the programming?


I love it.


Thanks for sharing...


Just noticed you are in C+ I program in python...



by nsonde1977
on ‎02-14-2015 11:46 AM

Just got a RPi 2 and have several Wemo devices.  I'd be interested mike in how you setup the Pi as a Wemo server?  Do you have to use openHAB?  What OS on the Pi?

by WEMO Maker Inventor
on ‎02-16-2015 10:29 AM

I don't have a raspberry pi so I haven't tried this myself.  Another user has my DscServer (a very similar app) running on it, the instructions here should be very similar: https://sites.google.com/site/mppsuite/downloads/dscserver-2.

Unlike the DscServer, the WemoServer has a headless mode so you don't need the UI, you'll see more on this link:  https://sites.google.com/site/mppsuite/downloads/wemoserver-java/headless