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/

7 thoughts on “Lights Control – Open Zwave”

  1. Hi there
    Very interesting work, I’m experimenting with doing more or less the same thing (and also adding Arduino controllers on ethernet). Have you got any plans on sharing/GPLing your code? I started writing my own Qt/C++ ZWave implementation from scratch and got to the point where I could control dimmers and switches, but now I’m leaning more towards including the OpenZWave library in my project instead. So I’m interested in seeing how you’ve solved those parts. I’m also looking at a web UI and was planning on a jQuery UI, are you writing your UI from scratch?

    1. Hi,

      Eventually I will be sharing the project online but need to find some time to re-factor some code and make it more easy to setup. The system is based on different technologies being, Open-Zwave Socket Server in c++, PHP client, crontab to scheduled tasks and a jquerymobile UI for smartphones and tablets.

      I will try to put some code snippets which might help you.

  2. Hello Mr. Conrad Vassallo,

    Great work!!! I just recently started playing with Open-Zwave and after several attempts trying to embed php into openzwave-control-panel I gave up. Libmicrohttpd doesn’t support php and I couldn’t find a way around. At least JQuerry didn’t give me much trouble and allowed to re-format control panel to look and function more user friendly.

    I noticed you mentioned that you will be sharing your code with a public after you re-factor it, but do you think maybe you could post it earlier…? It would save tons of time for beginners as myself and would help others to improve your work, and hopefully, they’ll do the same – share. As Henry Ford said: “Coming together is a beginning; keeping together is progress; working together is success.”

    1. Hi Andrei,

      Some code samples are available on this post. Hopefully, during summer I will have more time to dedicate to the project.

      Conrad

  3. Nice start. The UI looks suspiciously like my Fibaro Home Centre 2 box which still doesn’t work. So i’m now looking at solutions like you have with the idea to extend them and get things working!

    1. Hi Mike,

      Yes Fibaro Home Control was without any doubt an inspiration. However, stay tuned for an updated version to follow soon. Also a Raspbian image with everything setup to run on a Raspberry Pi.

      Conrad

Leave a Reply

Your email address will not be published. Required fields are marked *