UPDATE: I upload my hacked Z-wave controller code to: https://github.com/tagroup/open-zwave-tcp-socket-server-and-client
Decided to try some easy home automation with my Raspberry Pi using the Aeon Labs Z-Stick S2, GE Wireless Outdoor Module (45604), open-zwave interface, and the openzwave-control-panel. The goal was simple. I wanted to turn a light on and off without leaving my chair or moving my arms (finger movement, I find acceptable at this time).
My Pi is set up with the Raspberry Pi Arm Debian image on a 8gb SanDisk Extreme III card and a Belkin powered USB hub. The instructions below should be the same for non-Pi installations on Debian/Ubuntu/Mint.
1. You will have to have build-essentials, make, subversion applications installed (maybe others).
sudo apt-get install build-essential make subversion
2. Plug in Z-Stick S2
3. Installed open-zwave:
svn checkout http://open-zwave.googlecode.com/svn/trunk/ open-zwave cd open-zwave/cpp/build/linux make
4. <<optional>> If compiling on Pi, Go get some food. This step took a while.
5. Pair your device (unplug Z-Stick, press button on z-stick, press button on switch/sensor, when light changes, press button on Z-stick controller)
6. Build the open-zwave example to test all is well.
cd ../examples/linux/MinOZW (change Makefile if your device is not at /dev/ttyUSB0) make ./test
While this is running – hit the button on the switch/sensor and it should react and write a config file – zwcf_yourhome.xml. I just opened this saw that my device was in it and jumped to openzwave-controller. More info can be found on the open-zwave project wiki.
7. Install openzwave-control-panel.
So I download that:
svn checkout http://openzwave-control-panel.googlecode.com/svn/trunk/ openzwave-control-panel
8. But before I get started I need to install libmicrohttpd. I think the one in the repository is too old and causes issues, so I downloaded the latest version with:
/*you don’t have to do this – I was in a rhythm and couldn’t stop*/
wget ftp://ftp.gnu.org/gnu/libmicrohttpd/libmicrohttpd-0.9.20.tar.gz tar -xzvf libmicrohttpd-0.9.20.tar.gz cd libm* ./configure make sudo make install
7. So then I went to back to openzwave-controller
Check the Makefile - (actually read it)
the path to libmicrohttpd and open-zwave should be updated to the appropriate paths
For me (yours could be different):
OPENZWAVE := ../open-zwave LIBMICROHTTPD := /usr/local/lib/libmicrohttpd.a
You also have to uncomment two lines depending on if you are running on mac or linux. Since I was using the pi,
# for Linux uncomment out next two lines LIBZWAVE := $(wildcard $(OPENZWAVE)/cpp/lib/linux/*.a) LIBUSB := -ludev
9. Time to test (the number after p is port number):
./ozwcp -p 55555
Then cruise to your favorite browser and type in http://ip_connected_to_z-wave:55555/.
The openzwave-controller is far from perfect but it is an awesome way to get up, running and testing your devices in under 10 minutes. Much praise to them.
The next plan is to connect directly to the open-zwave interface and create a socket server or simple REST API for handling basic commands and schedules.
UPDATES: I found http://conradvassallo.com/2012/03/14/lights-control-open-zwave/ project and after finding the right socket libraries I was off. I made a couple updates so I don’t lose the most current status of a notification event and built a quick little web page to turn on and off my light. More switches should be coming this week as well as a EtherRain sprinkler controller. The Pi will tie all the pieces together and give me one protocol to communicate to the switches.
CHRISTMAS UPDATE: Time to control the outdoor lights!