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.

29 thoughts on “Open Zwave Project”

  1. Any chance you have made the project available to the public via github or google code? It would be great to see an example of someone building off the open zwave’s base and possibly help extend it. I have the openzwave-control-panel running but your interface looks a bit further along in terms of end user consumability. Plus a android app would be awesome. I’ve been thinking about the mono side and doing something similar. Thanks for taking the time!

    1. Yes those are the plans. Lately I have been working on the android app but still needs some testing.. Will keep you updated with the progress.

  2. Can an Android device act as the z-wave server to control all the devices? I have an Android unit that is always connected ‘Ethernet’ to my network..

    1. The problem is that you still need a zwave dongle connected to the Android device. Moreover, Open Zwave is used to control the dongle and is currently written in C++ and Python, so no Java yet. As it is right now, you can only use the Android device as a “remote control” to a server running on a pc.

  3. I’ve written my own RPC for OpenZWave, based on Apache Thrift. I’ve also written client libraries for eibd, the open-source KNX daemon. Put some Ruby magic in between, and therefore I can map device states between these two. mail me for more info.

  4. This is looking good, have you made any progress? I am just diving into the zWave linux space, and chance you are making this code public and can point me in the correct direction? I am also leaning toward making a tablet app (android) that can mange the thermostats in my house based on historic and current ambient outdoor temperature.

  5. Dear all friends
    My company is develop a simlpe z-wave controller,
    Sincerely hope to get your help ,and I can pay some money for it,
    my mail is liruib8@163.com,
    pls contact to me, discuss this project together
    thanks

  6. Hi,

    I am looking for a programmer who could creat an Android app (4.0/4.1) to control Z-Wave devices. Would you do something like this?

    The task is: I have an Android tablet and I would like to connect it to a Z-Wave USB Dongle (I think, this is the easiest solution). Now I need an Android app to control the Z-Wave devices.

    Thanks for your answer.
    Kind regards
    Christof

    1. Hi Christof,

      It sounds a good idea however I’m not sure if it is possible to compile the open-zwave library on Android. My Android tablet does not have a usb so I cannot test it. The simplest solution is to have the zwave dongle connected to a pc and an Android client will connect to the pc to control the devices. I am in the process of releasing a newer version of my code which will be able to run on a raspberry pi computer to avoid a pc.

      Stay tuned,

      Conrad

  7. Hi I was wondering if your android app is available anywhere I have been using your lights control project and its been working wonderfully. The PC interface works wonderful but using my nexus would be much easier. Thanks again for all you wonderful projects.

  8. I get the following slew of errors when compiling on Fedora:

    > make
    g++ -c -Wall -Wno-format -g -DDEBUG -I ../../../src -I ../../../src/command_classes/ -I ../../../src/value_classes/ -I ../../../src/platform/ -I ../../../h/platform/unix -I ../../../tinyxml/ -I ../../../hidapi/hidapi/ -o Main.o Main.cpp
    Main.cpp: In function ‘int main(int, char**)’:
    Main.cpp:299: error: ‘struct OpenZWave::Driver::DriverData’ has no member named ‘s_SOFCnt’
    Main.cpp:299: error: ‘struct OpenZWave::Driver::DriverData’ has no member named ‘s_ACKWaiting’
    Main.cpp:299: error: ‘struct OpenZWave::Driver::DriverData’ has no member named ‘s_readAborts’
    Main.cpp:299: error: ‘struct OpenZWave::Driver::DriverData’ has no member named ‘s_badChecksum’
    Main.cpp:300: error: ‘struct OpenZWave::Driver::DriverData’ has no member named ‘s_readCnt’
    Main.cpp:300: error: ‘struct OpenZWave::Driver::DriverData’ has no member named ‘s_writeCnt’
    Main.cpp:300: error: ‘struct OpenZWave::Driver::DriverData’ has no member named ‘s_CANCnt’
    Main.cpp:300: error: ‘struct OpenZWave::Driver::DriverData’ has no member named ‘s_NAKCnt’
    Main.cpp:300: error: ‘struct OpenZWave::Driver::DriverData’ has no member named ‘s_ACKCnt’
    Main.cpp:300: error: ‘struct OpenZWave::Driver::DriverData’ has no member named ‘s_OOFCnt’
    Main.cpp:301: error: ‘struct OpenZWave::Driver::DriverData’ has no member named ‘s_dropped’
    Main.cpp:301: error: ‘struct OpenZWave::Driver::DriverData’ has no member named ‘s_retries’
    make: *** [Main.o] Error 1

    1. The controller interface is running ok, but I am having trouble initializing the device. I am not sure hot to specify the device for initialization. I tried using /dev/ttyUSB0, but it did not seem to work, and only caused a lost connection to my UPS, which is plugged into another USB port.

      dmesg show the z-stick connected on /dev/ttyUSB0, but apparently this is more of a hub address, and not an exact address.

      Here is what I get from the command line when requesting USB port info:

      > ls /sys/bus/usb-serial/devices/ -ltrah
      total 0
      drwxr-xr-x. 4 root root 0 Mar 24 12:08 ..
      lrwxrwxrwx. 1 root root 0 Mar 24 12:08 ttyUSB0 -> ../../../devices/pci0000:00/0000:00:1d.1/usb4/4-2/4-2:1.0/ttyUSB0
      drwxr-xr-x. 2 root root 0 Mar 24 12:08 .

      > lsusb
      Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
      Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
      Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
      Bus 004 Device 002: ID 10c4:ea60 Cygnal Integrated Products, Inc. CP210x Composite Device
      Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
      Bus 003 Device 002: ID 051d:0002 American Power Conversion Uninterruptible Power Supply
      Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
      Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
      Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

      Any help would be appreciated.

      1. It seems to be working, If I don’t check the box for “USB”. I have one device, a water sensor, which has been synced with the z-stick, however it does not show anywhere in the OpenZWave Control Panel. Do I need to enter anything in the boxes under “Controller Status”? Also, the three radio buttons at the button don’t seem to be able to be changed, the one that is selected is “Current Values”.

        1. Just wondering, when I initialize the device, the last line in the log window is the following:

          Trying to open serial port /dev/ttyUSB0 (attempt 1)

          Is this what I should be seeing?

          1. I am running as root. I now get a crash and the following message in the log after I select an option such as “statistics” from the menu:

            2013-11-23 11:01:10.730 mgr, Manager::GetDriver failed – Home ID 0x00000000 is unknown
            ozwcp: ../../src/Manager.cpp:320: OpenZWave::Driver* OpenZWave::Manager::GetDriver(uint32): Assertion `0′ failed.

  9. Hello Mr. Conrad
    I am planning to do an android application to work with my z-wave thermostat. I have got my self the aeon labs z-stick. I am going to try out the opencv and zvirtualscene with it.
    Could you be of help and provide me how your project was performed. What did u use?
    And apon your knowledge can I access my thermostat using http requests if I used the zvirtualscene WEB API

  10. I am interested in running z-wave on a tablet that I have made that has a built-in z-wave module (ZM5202). the tablet will act as the home controller. Are the instructions available for purchase on how to build the required components (daemon, db, source code, etc.)?

      1. I have done as suggested but am encounter some issues, please see the following:

        What steps will reproduce the problem?
        1. run ozwcp on android
        2. open http interface from a pc
        3. try to add or remove a device

        What is the expected output? What do you see instead?
        messages from the zwave device thats being added.
        instead of that we don’t see any message

        What version of the product are you using? On what operating system?

        latest version on the download site. Android 4.2

        Please provide any additional information below.

        controller software runs on android. we are running the openzware controller frontend on port 8080. when we try to add or remove the devices, the response is very very slow and most of the times the task times out.

        SoC: Allwinner A20
        ZWAVE Module: ZM5304
        RAM: 1G

        Thank you for your help.

Leave a Reply

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