All posts by conradv

Open-Zwave on Raspberry Pi

Raspberry Pi & Aeon Labs Z-Stick

Thanks to the tutorials found below I have managed to get the system up and running:

http://www.instructables.com/id/Raspberry-Pi-Web-Server/

http://thomasloughlin.com/z-wave-controller-setup-on-my-raspberry-pi/

 

Now it’s time to improve the software.  Keep tuned for more updates.

http://code.google.com/p/open-zwave-controller/source/checkout

The Raspberry Pi has landed!

The wait is over! Finally got my Raspberry Pi and also a complementary T-shirt.

Many things on the agenda:

  • Design and cut a case for the Pi on my CNC
  • Build and install the Open-Zwave library
  • Install the Web server and the Open-Zwave-Controller software
  • Transform the Pi into a DIY Home Automation System

Open-Zwave-Controller Code available through svn

Finally got some time to put the code on google code which can be found below.  This is not fully ready and needs more work, especially the scheduler.  More updates will follow soon hopefully.

http://code.google.com/p/open-zwave-controller/source/checkout

Basically, first start by compiling the server.  Get the open-zwave code and compile my server code from the cpp/examples folder.  Run the server.

Next, import the mysql database into your mysql server.  Manually enter the admin username and password inside the admin table.

Next, host the control panel and web client php files on the same pc running the socket server.

These are some very crude setup steps. Should you need any more detail, let me know.

Lights Control – Open Zwave

Lately I have been busy building the web interface to customise and control the devices on my z-wave network. The screen shots below will give you a taste of what has been done so far.

Showing list of devices grouped by room
Naming each device and associating a room
Scheduler in its infancy but functional... more to come
The settings section

Resources

Due to several requests asking for code, below please find some sample code of how the system was implemented.

Socket Server

The socket server is based on the sample code by the Open-Zwave  library found in the directory

open-zwave\cpp\examples\linux\MinOZW

It was modified to include the socket server connection and a very basic protocol to control the devices.

Main.cpp

The server is not fully implemented and supports only Multilevel and Binary switches.  Moreover, the status request is still to be implemented.  (Hopefully by next summer).

PHP Socket Client

A client written in PHP to send commands to the socket server.

server.php

Update

Code is available here:

http://conradvassallo.com/2012/06/21/open-zwave-controller-code-available-through-svn/

Open Zwave Project

Aeon Labs Z-Stick Series II Z-Wave USB controller

Lately I bought an Aeon Labs Z-Stick Series II Z-Wave USB controller since it is the most feasible device to use on Linux.  Referring back to the previous solution I had posted here, the problem was that I had to run the system on a virtual machine which does not make it so efficient to run on my green Atom powered home server.  The main problem was that the USB controller from Controlthink was not supported on Linux so I had to seek for another solution.

Finally, thanks to the guys developing the Open Zwave Project now it is possible to control Z-wave devices from Linux.  My solution is  a socket server which accepts requests from different clients such as from a web interface or from an Android phone /  tablet.  Practically, the socket server works very similar to  the same system implemented by http://melloware.com/products/zwave/.

The main challenge in this project was to get my hands dirty with C++ which I am not very familiar with but having said that, the sample examples provided by the Open Zwave team, helped a lot understanding how to use their library.  I managed to kill two birds with one stone, learning a bit of C++ while having my Linux server controlling the Z-wave devices natively.

Server

Currently, the socket server gives a list of devices to the client and accepts commands to control each device.

Server (Left) Telnet client (right)

Clients

Web Client

It is still work in progress, however it does most of the stuff  I need.  The screen shot below shows a PHP socket client displaying the list of devices which can be controlled.

The Z-wave web interface

Setting up each device found on the z-wave network

Android

Below are some screen shots of the Android client.

Z-wave Web Interface

Lately, I have been experimenting on home automation.  I have got a couple of z-wave devices from Home Pro and manage to set up every device properly to work as expected.  Although, the devices do work like a normal switch, the interesting part is to implement some kind of automation.  So I had bought one of these USB controller from Controlthink.  Unfortunately, it’s not the ideal controller to buy especially when using Linux, so I had to figure out a solution.  First, I tried to compile the samples which were written in .NET on mono but it wouldn’t compile.

Since my home server runs on Fedora the device is not supported on Linux.  So, I installed Virtual Box OSE and installed a copy of Windows XP and used a program developed by Melloware which is a free application that was written especially for the Controlthink USB controller.  The zwave controller is a very simple application which detects the devices connected to your z-wave network and allows you to control each device by sending the z-wave commands through the USB controller.  It does the job very well but since my z-wave devices do not support scenes, I had to figure out how I could implement the scenes functionality using a work around.

So this is were my project comes in.  The z-wave controller written by Melloware, accepts connections through TCP and also HTTP requests. The protocol can be found here.  The HTTP requests feature solved my problem to be able to implement the additional features like the Scheduler and Virtual Scenes that I felt missing from the Melloware z-wave controller.

Aim

The aim of this project is to have a free Home Automation Solution using available free software (assuming you have a genuine Windows installation).

Requirements

This project is written in PHP 5 and JQuery and needs a copy of the Melloware Z-wave Controller running either on a native Windows machine or at least virtually like on Virtual Box.  You also need the ControlThink USB controller.

Features

The web interface has the following functionalities:

  • Status – Showing the list of the devices and their status.
  • Setup – Get the list of devices from the server and save a cached copy in an XML file.
  • Controller – Lets you control the devices by selecting the device and control it using On/Off and a Slider.
  • Scheduler – lets you create cron jobs to automate the HTTP requests to the server.
  • Scenes – group devices and set their levels to pre-defined presets.

Currently, under work in progress are the Scheduler and Scenes functionalities.

The Z-wave controller

 

Conclusion

Currently the solution although not fully implemented, the Controller works fine and can be accessed practically from any device having an Internet connection and a browser capable of running Java Scricpt.  The code can be downloaded from here.  Currently there is no documentation on how to setup the system since it is still in early alpha stage.  Proper documentation will follow as soon as the system will be ready to be released.

Website Launched!!!

Welcome to my website! The idea of this website is to serve as a showcase of my projects done so far and hopefully help other customers to create their own image on the Internet using the latest software and techniques available on the market.

Feel free to browse my portfolio to have an idea of what I can come up with.