Lights Control

Lights Control, is the latest version of my Home Automation software which makes use of the Open-Zwave library to manage Z-Wave devices.

Mobile version still under construction but coming soon!.

No installation hassle! Now also available as a Raspbian image for the Raspberry Pi!  Click here to download.  Web login username is Admin with first letter uppercase and passwor is admin, all lowercase. SSH login user: lightscontrol, pasword: lightscontrol.  Root password: lightscontrol.  Make sure you first setup the IP of your Raspi.  By default it is set to

Code available here: svn checkout lights-control-read-only

Control / Status of devices
Manage Scenes
Schedule scenes to automate your lights
Settings Menu to manage your devices

41 thoughts on “Lights Control”

    1. Actually I was trying to install the raspberry pi image but it doesn’t do anything when I power on. I verified the img installed and used other img files and those work fine.

      1. What is not working? Does it boot first? Ideally first test it with a monitor and start by changing the IP from /etc/network/interfaces since by default it is


      2. “Actually I was trying to install the raspberry pi image but it doesn’t do anything when I power on.”

        I’ve got the same problem. I downloaded your image-file an installed it to the SD-Card (dd bs=4 if=/path/to/image.img of=/dev/of/disk). When I power on the RPi, the screen stays black, LED stays red.
        When I install a normal RPi image to the SD-Card, the RPi is booting.

        1. Sometimes I used to experience that problem. I think that the problem is related to power since you have the Zwave stick connected. I used to remove the stick and also the network cable and it would start. Then I used to plugin the stick and the network cable when I see the lights flashing.

  1. Hi Is there any readme to install from google svn?

    i have got files, but seems to try to connect to mysql, but do not know where to configure or database squema where is located

    Could you help ?


    1. Hi Alberto,

      This version is not configured to work with MySQL but with sqlite which is found under protected/data/lights control.sqlite although you can modify it to run on MySQL if you want. Ideally you should use the Raspberry Pi image which has everything setup and running. If you want to run it on a PC, you need to have PHP, sqlite, curl, gcc …


      1. Thanks

        I Also im testing your server.php script with socket server witn open-zwave but i get Nothing to process!

        What could be wrong? I have server on port 6004 and telnet is working fine to send commands

        Thanksin advace

        1. Server.php accepts query strings to call the socket server. If no query strings are passed you will get nothing to process.

          1. Is there documentation somewhere on how the server.php works?
            From what I can see looking at the source code, I can send “rooms”, “devices” and “control”.

            Can I send something like control 9 99?
            Can it be use to control scenes?

          2. Hi Eric,

            You can get a list of devices by calling


            setnode – saves details to the zwcfg_0x014d02a8.xml


            Hope this helps

  2. This seems like a really cool project. Can you tell me how to implement it? I am using a ALIX board, so can’t use the rasp image. Your other project doesn’t let me add new devices and there is no feedback (ie if I turn off at the switch).

    It also seems you changed the interface.

      1. Thank you for the link. Unfortunatly he also takes the approach of using a rasp image. This won’t work for me since I do not own a Raspbian Pi.

        I would like to compile it on a debian wheezy (not rasp).

  3. What is the login for the web interface? I tried demo/demo, admin/admin, lightscontrol/lightscontrol and root/lightscontrol – none worked.

    1. Thomas, could you tell me how you compiled configured it? Since I do not own a Pi I would like to give it a try, but need source code I am guessing ……

  4. Hi, I’m trying to install on my Raspberry Pi and looking forward to using it, but for now had this error:

    CDbConnection failed to open the DB connection: could not find driver

    I installed php5-sqlite (sudo apt-get install php5-sqlite) and now have an other error:
    Undefined offset: 2

    I’ll post, if I can manage to find a solution.

    1. Is the error given on the control page? Is yes its because there are no devices yet. I had fixed this error on my local copy but still have to commit on Google code. However try importing the devices and the control page should work fine.

  5. Hello Conrad,

    I have just recently received my Aeon Z stick and being a complete noob on openzwave I opted to install both of your image and Mr. Loughlin’s – which at some point I was able to turn on the lights and nothing else being (for lack of my knowledge and a technical word) “unstable”. So, I went to install yours and upon logging in I’m stuck at a
    PHP warning page file_get_contents( failed to open stream: HTTP request failed!
    with the line of code highlighted:
    63 $zwDevices = file_get_contents(“http://” . $_SERVER[‘HTTP_HOST’] . “/server.php?command=devices”);
    I’d appreciate it if you can find the time to shed light on this. Thanks and have a good one!


  6. I am not aware of this, but I did run it on root (it was not letting me on lightscontrol acct. – error code 13) and gives out a message on php warning page on a highlighted line:
    $zwDevices = file_get_contents(“http://” . $_SERVER[‘HTTP_HOST’] . “/server.php?command=devices”);
    and running the socket server ./test goes into infinite “2013-02-14 04:35:32:745 WriteMsg Wait Timeout m_currentMsg=00000000”
    or ends on a message:
    2013-02-14 05:35:36:481 WARNING: Tried to write driver config with no home ID set

  7. Can’t get your image to work. The Pi turns on, and nothing else. No video, no activity light.

    Running the pi with nothing plugged in, just power and hdmi out. Wrote the lightcontrol.img to 8G sd card using HDD raw copy util (windows), also tried with Win32DiskImager.

    Also, any details at all on how to get your server to compile? I’ve tried compiling from open-zwave/cpp/build/linux, then making from open-zwave/cpp/examples/linux/server. Fails with a ton of errors. I have no idea whats going on there. Also tried to copy the server directory into a fresh open-zwave install example dir, and got the same issues.


  8. Hi Conrad, I finally managed to have it work using Thomas’ image.
    I can import the devices from my Aeon Stick, but when I go on the Control page, clicking on “On” or “OFF” doesn’t do anything. Any idea? Can I look at some logs somewhere?

    1. If you checkout the latest version from Google Code I have included a logs option in the menu. You can always read:


  9. Hello tnk for your lights control imlementation. I have try it but a got a error on server side if a d/w sensor is trigged. The server go down. I check and understand pnly swich and dimer are currently supported. My goal is to support more device classes like door/widows sensor, multivalue sensor. I want wrote a IOS app to control and monitor devices. The server side can be your server code with more supported devices. Any plant to support more devices classes? I will try from my side but my level in C++ is verry low. I hope got some help. Any way thank for sharing your hard work.

    1. Unfortunately I don’t have such devices to test with. Moreover, the server does not cater for triggers yet. Ideally someone with some knowledge of C and has access to sensors, can contribute to this project.

  10. When I load index.php?r=control
    I get the error file_get_contents( failed to open stream: Connection timed out

    My IP range is so I have no idea why would be involved. It looks like
    $zwDevices = file_get_contents(Yii::app()->params[‘serverurl’] . “/server.php?command=devices”);
    uses the serverurl variable from somewhere but I have no idea where. If I can change that to localhost, or the IP of my raspi, it would solve the problem I think.
    I am unable to install your (or Thomas’s) image because I’m using a custom service and it takes forever to recompile. I have all of the other parts working.

    1. Server.php has define(“ZWAVE_HOST”, “localhost”); and define(“ZWAVE_PORT”, 6004); these refer to the socket server IP and Port. Also note that the file lightscontrol/protected/config.php has reference to the server IP.

  11. Hi, your work looks very simple and seems to be easy to work with but cant make it work with the new raspi board.
    I was just wondering if there is a newer version of the raspi image that works with the new board?
    I was able to replace a few of the boot files and boot but the network eth0 does not work.

  12. Hi Conrad,

    I have it working 100% on a Debian box. I had to make a couple changes, one was to write the crontab.txt to /tmp so that the zwave user could read it during the SSH to set up the cron, otherwise it is in a tree owned by Apache which that user can’t read by default.

    I would like to add the ability to set device parameters, and to read reports. Have you looked into either of those things? I have a lot of PHP experience, but not with Yii so I am learning that.

    1. Hi Andy,

      Thanks for your comment. Currently I stopped developing this project however I would like to continue as soon as I have some free time. if you wish to contribute let me know and will add you as a developer.

Leave a Reply

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