I’ve recently started diving into home automation stuff, and of course immediately ran into issues. I purchased a z-wave water sensor and planned to use Home Assistant to monitor the sensor and send me alerts (via pushover) if it detects water. While getting HA installed was quick and easy, the trouble began when I tried to actually read from the sensor. I could see in the OZW_Log.txt log file that the system was receiving data, but the HA log had no event information.
After a bunch of searching, I came across a post talking about using open-zwave-control-panel (ozwcp) to diagnose and configure z-wave devices. Awesome! Sadly, the documentation for this project is lacking, and it took a bit of trial and error to figure out the right steps to get ozwcp build, let alone run. Eventually I figured it out, reconfigured my sensor and everything worked. So to save others the frustration of trying to build ozwcp, I’ve got a quick and simple tutorial for you!
UPDATE: There’s a docker image that’s only slightly out of date, I suggest trying that first before going to the effort of compiling ozwcp. If you don’t have docker installed, follow one of the many tutorials out there, then run this command (where /dev/ttyUSB0 is your zwave controller):
docker run -p 8008:8008 –device /dev/ttyUSB0 openzwave/openzwave-control-panel &>/dev/null &
And now back to our regularly scheduled programming:
Please note, these instructions have only been tested on Raspbian 8 (jessie) on a Raspberry Pi 3. Your milage may vary! All commands are run as root, because I’m lazy.
First, install some (probably) important libraries:
apt-get update
apt-get install libgnutls28-dev libgnutlsxx28
Download, build and install libmicrohttpd
cd
wget ftp://ftp.gnu.org/gnu/libmicrohttpd/libmicrohttpd-0.9.19.tar.gz
tar zxvf libmicrohttpd-0.9.19.tar.gz
mv libmicrohttpd-0.9.19 libmicrohttpd
cd libmicrohttpd
./configure
make
make install
Download and build the open-zwave library
cd
git clone https://github.com/OpenZWave/open-zwave.git
cd open-zwave
make
Download open-zwave-control-panel
cd
git clone https://github.com/OpenZWave/open-zwave-control-panel.git
cd open-zwave-control-panel
Open the Makefile and find the following line:
OPENZWAVE := ../
LIBMICROHTTPD := -lmicrohttpd
Change it to:
OPENZWAVE := ../open-zwave
LIBMICROHTTPD := /usr/local/lib/libmicrohttpd.a
Build ozwcp
make
ln -sd ../open-zwave/config
And finally, run it!
./ozwcp -p 8888
Now you can open http://your_system:8888 in a browser to start using the open-zwave-control-panel!
Great tutorial. I also had to set the location for LIBMICROHTTPD in the Make File for open-zwave-control-panel.
LIBMICROHTTPD := /usr/local/lib/libmicrohttpd.a
Should this be done from within the hass virtualenv?
It does not need to be done in a virtualenv.
Thank you. Exactly what I needed.
I’m new to Linux and home automation and I’m following your guide but I’m stuck on “open makefile” What do I have to type to do this?
this is awesome thanks. I’m actualy trying to do the exact same thing (flood sensors with a pi, aeon gen 5 stick, and everspring). Do you have sample configs of your configuration.yaml by chance?
@kktwo, use any editor you want. This should do it:
nano Makefile
Thanks for the guide, i follow the step, everything go fine until i compile the open-zwave-control-panel.
g++: error: IOKit: No such file or directory
g++: error: CoreFoundation: No such file or directory
g++: error: unrecognized command line option â-frameworkâ
g++: error: unrecognized command line option â-frameworkâ
Makefile:72: recipe for target ‘ozwcp’ failed
make: *** [ozwcp] Error 1
Any one face this issue?
I founded is my mistake did not edit the compilation for Linux. Original Makefile
# for Linux uncomment out next three lines
LIBZWAVE := $(wildcard $(OPENZWAVE)/*.a)
#LIBUSB := -ludev
#LIBS := $(LIBZWAVE) $(GNUTLS) $(LIBMICROHTTPD) -pthread $(LIBUSB) -lresolv
# for Mac OS X comment out above 2 lines and uncomment next 5 lines
#ARCH := -arch i386 -arch x86_64
#CFLAGS += $(ARCH)
#LIBZWAVE := $(wildcard $(OPENZWAVE)/cpp/lib/mac/*.a)
LIBUSB := -framework IOKit -framework CoreFoundation
LIBS := $(LIBZWAVE) $(GNUTLS) $(LIBMICROHTTPD) -pthread $(LIBUSB) $(ARCH) -lresolv
So just need to comment LIBUSB and LIBS for Mac OS X, then remove the comment for Linux. Then everything will be work.
Thanks
Hi,
I am new in Linux. By following your step, I can compile and run open zwave control panel in raspberry pi 3. But I got the problem of Manager::GetDriver failed – Home ID 0x00000000 is unknown no matter I tried /dev/ttyACM0 or /dev/ttyUSB0 in device name box (ozcp). Actually, I created a slink /dev/ttyUSB0 -> /dev/ttyACM0.
I glanced the manager.cpp although I don’t know C++. It seems to me that no Z-Wave driver is found so Home ID is 0x0000000.
How can I solve the issue?
Thanks
Billy
Hi
I am sorry that I forgot provide the controller information.
I am using Sigma Design Z-Wave Static Controller (USB).
Thanks
I followed Alan’s advice and uncommented the Linux commands but I am still getting an error after running make command:
[email protected]:~/open-zwave-control-panel $ make
g++ -c -Wall -Wno-unknown-pragmas -Wno-inline -Wno-format -g -DDEBUG -ggdb -O0 -I ../open-zwave/cpp/src -I ../open-zwave/cpp/src/command_classes/ -I ../open-zwave/cpp/src/value_classes/ -I ../open-zwave/cpp/src/platform/ -I ../open-zwave/cpp/src/platform/unix -I ../open-zwave/cpp/tinyxml/ -I /usr/local/include/ -o ozwcp.o ozwcp.cpp
ozwcp.cpp:54:24: fatal error: microhttpd.h: No such file or directory
#include “microhttpd.h”
^
compilation terminated.
Makefile:51: recipe for target ‘ozwcp.o’ failed
make: *** [ozwcp.o] Error 1
Any ideas?
Thanks
Why libmicrohttpd-0.9.19 instead of a much newer version, such as libmicrohttpd-0.9.51?
Thanks for the instructions: they were mostly complete. I did make a few additional modifications to the Makefile based on comments therein. The result compiled and executed without any muss, fuss, or bother, and the result is a great tool for debugging and understanding my network.
DO be aware, however, that the code is NOT under the GPL. The copyright license permits copying WITHOUT MODIFICATION for any purpose. Copyright law permits you to modify it anyway, but you cannot then make the modified result available to anyone else. I expect most people will not care, but please be careful.
Billy Tsang: I am using a Z-stick. On my system, it is recognized as /dev/ttyACM0. Since you are new to Limux, you may not be aware of the /dev directory, so I provide the following “recipe”. This is brute-force but easy to do. There are other methods.
1) remove your z-stick and reboot your Pi.
2) issue the command
ls /dev
3) insert the z-stick
4) again issue the command
ls /dev
5) look for added names in the list. In my case there are two: ttyACM0 and one other, so the z-stick represents itself as two separate USB devices in the USB tree. Note that neither of these is the default /dev/ttyUSB0 that is expected by some parts of OpenZWave.
Now you can open the OZWCP web page and enter /dev/ttyACM0 in the “device name” box, and the system should find your controller.
So close to the finish but I am stuck at “ln -sd ../python-openzwave/open-zwave/config” (=the path that worked for me in the Makefile)
[email protected]:~/open-zwave-control-panel$ ln -sd ../python-openzwave/open-zwave/config
ln: failed to create symbolic link ‘./config’: File exists
Does somebody have a suggestion for me? It seems to be necessary for running the ozwp program because ….
[email protected]:~/open-zwave-control-panel$ ./ozwcp -p 8888
2016-10-06 18:51:54.219 Error, Cannot find a path to the configuration files at ./config/. Exiting…
2016-10-06 18:51:54.222 Error, Exception: Options.cpp:91 – 1 – Cannot Find Configuration Files
Error: Options.cpp:91 – Cannot Find Configuration Files
If I sound ignorant … I am pretty new to Linux 😉
Cheers Ronald
P.S. the “/python-openzwave/open-zwave/config” file exists but it is empty
I made a new install (with the open-zwave install to the “open-zwave” folder) and can now run ./ozwcp -p 8888 and connect via the webinterface (which I now have to figure out how to discover my Z-stick Gen5).
BTW the microhttpd library mentioned above was to old and failed for me when running ./ozwcp -p 8888.\
I fixed this with …
$ sudo apt-get -y install libmicrohttpd-dev
If anybody else is using Ansible to manage their setup, this Ansible role might be useful:
https://github.com/mechaxl/ansible-ozwcp
It’s mostly just copying these instructions, with some extra goodies, such as running as a non-root user, and systemd integration (which will automatically shut down the home assistant service to run ozwcp, if it’s been set up with https://github.com/mechaxl/ansible-homeassistant).
Check it out and feel free to star it on Github if you find it useful at all. Thanks!
can we use this with not usb stick but razberry module?
Can anyone explain this command –
make
ln -sd ../open-zwave/config (What does this command mean)
Was there ever an answer to:
Jeff
September 14, 2016 at 10:59 pm
I followed Alan’s advice and uncommented the Linux commands but I am still getting an error after running make command:
[email protected]:~/open-zwave-control-panel $ make
g++ -c -Wall -Wno-unknown-pragmas -Wno-inline -Wno-format -g -DDEBUG -ggdb -O0 -I ../open-zwave/cpp/src -I ../open-zwave/cpp/src/command_classes/ -I ../open-zwave/cpp/src/value_classes/ -I ../open-zwave/cpp/src/platform/ -I ../open-zwave/cpp/src/platform/unix -I ../open-zwave/cpp/tinyxml/ -I /usr/local/include/ -o ozwcp.o ozwcp.cpp
ozwcp.cpp:54:24: fatal error: microhttpd.h: No such file or directory
#include “microhttpd.h”
^
compilation terminated.
Makefile:51: recipe for target ‘ozwcp.o’ failed
make: *** [ozwcp.o] Error 1
Any ideas?
Thanks
In the main section – Edit Make file: need to add the (un)coment Linux/Mac lines note.
OK, up and running, sees Node5, 6, & 7. All sorts of logs when I manually turn 5 on/off/on/off.
A) “Add Device”, Go, “Waiting for user action” – Ah, turned light on and “command complete”.
B) and this is my primary question: How do I turn that light on/off from the command line? Well via a Bash script.
(typos in prev – lack of coffee – my story…)
Still more playing in browser:
1 *LB Static Controller Static Controller Aeotec DSA02203 Z-Stick S2 9:39:29 AM Ready
5 LBR Routing Slave Binary Power Switch GE 45609 On/Off Relay Switch on 10:21:39 AM Ready
6 LR Routing Slave Binary Power Switch off 9:39:34 AM Dead
7 LBR Routing Slave Binary Power Switch off 9:39:35 AM Dead
and 6 & 7 are???? I only have 1 switch wired. I’m unable to turn 5 off (unless I walk into the other room and hit the switch).
Then I went out to my greenhouse and plugged in 2 GE 12720 outdoor smart switches, came back in, still only 5,6,7 – no 8 or 9. Also when I stop/restart ozwcp and the web app I have to start all over with Device name etc. Is there no config file?
Just restarted everything, 5 & 6 gone, 7 listed. added 5 again and it’s back. Turned a 12720 on/off (add dev) and nothing. ??
Thanks for any help
Chuck
I wish I could edit previous posts – I’m up and running – web page working fine – U7 On (I confess, I confess), U7 Off. Now all I need is to get ozw-cli working.
OK, I’ve got everything working – web wise. However I need to be able to turn things On/Off from the command like (or via sw) ie. turn a greenhouse pump on for 45 seconds then off. Is there a way to pipe a string [0x0109001305022502252ccc..] through say telnet sg53:8888 or via nc or …
Thanks
I was getting the following error:
“/home/ubuntu/open-zwave/cpp/hidapi/linux/hid.c:46:21: fatal error: libudev.h: No such file or directory
compilation terminated.”
when running “make” for open-zwave. Fixed by running:
apt-get install libudev-dev
(source: https://github.com/OpenZWave/open-zwave/issues/902)
Also got this error when trying to “make” open-zwave-control-panel:
g++ -o ozwcp -g ozwcp.o webserver.o zwavelib.o ../open-zwave//libopenzwave.a /usr/local/lib/libmicrohttpd.a -pthread -framework IOKit -framework CoreFoundation -lresolv
g++: error: IOKit: No such file or directory
g++: error: CoreFoundation: No such file or directory
g++: error: unrecognized command line option ‘-framework’
g++: error: unrecognized command line option ‘-framework’
Makefile:71: recipe for target ‘ozwcp’ failed
make: *** [ozwcp] Error 1
Had to edit these parts of the Makefile as well:
# for Linux uncomment out next three lines
LIBZWAVE := $(wildcard $(OPENZWAVE)/*.a)
LIBUSB := -ludev
LIBS := $(LIBZWAVE) $(GNUTLS) $(LIBMICROHTTPD) -pthread $(LIBUSB) -lresolv
# for Mac OS X comment out above 2 lines and uncomment next 5 lines
#ARCH := -arch i386 -arch x86_64
#CFLAGS += $(ARCH)
#LIBZWAVE := $(wildcard $(OPENZWAVE)/cpp/lib/mac/*.a)
#LIBUSB := -framework IOKit -framework CoreFoundation
#LIBS := $(LIBZWAVE) $(GNUTLS) $(LIBMICROHTTPD) -pthread $(LIBUSB) $(ARCH) -lresolv
(I’m on Ubuntu)
You have no idea how long I have been beating my head against this one. THANK YOU!!! THANK YOU!!!
Any thought of what I did wrong?
[email protected]:~/open-zwave-control-panel $ sudo ./ozwcp -p 8888
2017-05-12 13:08:36.513 Error, Cannot find a path to the configuration files at ./config/. Exiting…
2017-05-12 13:08:36.516 Error, Exception: Options.cpp:91 – 1 – Cannot Find Configuration Files
Here is the compile, I did have a warning was not sure if that was an issue?
[email protected]:~/open-zwave-control-panel $ sudo make
g++ -c -Wall -Wno-unknown-pragmas -Wno-inline -Wno-format -g -DDEBUG -ggdb -O0 -I ../open-zwave/cpp/src -I ../open-zwave/cpp/src/command_classes/ -I ../open-zwave/cpp/src/value_classes/ -I ../open-zwave/cpp/src/platform/ -I ../open-zwave/cpp/src/platform/unix -I ../open-zwave/cpp/tinyxml/ -I /usr/local/include/ -o ozwcp.o ozwcp.cpp
g++ -c -Wall -Wno-unknown-pragmas -Wno-inline -Wno-format -g -DDEBUG -ggdb -O0 -I ../open-zwave/cpp/src -I ../open-zwave/cpp/src/command_classes/ -I ../open-zwave/cpp/src/value_classes/ -I ../open-zwave/cpp/src/platform/ -I ../open-zwave/cpp/src/platform/unix -I ../open-zwave/cpp/tinyxml/ -I /usr/local/include/ -o webserver.o webserver.cpp
g++ -c -Wall -Wno-unknown-pragmas -Wno-inline -Wno-format -g -DDEBUG -ggdb -O0 -I ../open-zwave/cpp/src -I ../open-zwave/cpp/src/command_classes/ -I ../open-zwave/cpp/src/value_classes/ -I ../open-zwave/cpp/src/platform/ -I ../open-zwave/cpp/src/platform/unix -I ../open-zwave/cpp/tinyxml/ -I /usr/local/include/ -o zwavelib.o zwavelib.cpp
g++ -o ozwcp -g ozwcp.o webserver.o zwavelib.o ../open-zwave/libopenzwave.a /usr/local/lib/libmicrohttpd.a -pthread -ludev -lresolv
webserver.o: In function `Webserver::SendTopoResponse(MHD_Connection*, char const*, char const*, char const*, char const*)’:
/home/pi/open-zwave-control-panel/webserver.cpp:338: warning: the use of `mktemp’ is dangerous, better use `mkstemp’ or `mkdtemp’
For a fresh rig on ubuntu 16.04 you should also add “sudo apt-get install libudev-dev” in the make of open-zwave library.
Also, for the compilation of ozwcp you need the following: autoconf, libtool and texinfo.
hello,
i did everything but at the end i couldnt run it
i got that error:
[email protected]:~/open-zwave-control-panel $ ./ozwcp -p 8888
bash: ./ozwcp: No such file or directory
problem is resolved and i get OpenZWave Control Panel ozwcp started.
I fixed by repeating the 2 last commands
Thank you for the great tutorial but i should say that there is some commands should written like we have to uncomment the lines of linux by file Makefile and comment the fifth line of Mac
[email protected]:~/open-zwave-control-panel $ sudo make
g++ -o ozwcp -g ozwcp.o webserver.o zwavelib.o ../open-zwave/libopenzwave.a /usr/local/lib/libmicrohttpd.a -pthread -ludev -lresolv
webserver.o: In function `Webserver::SendTopoResponse(MHD_Connection*, char const*, char const*, char const*, char const*)’:
/home/pi/open-zwave-control-panel/webserver.cpp:338: warning: the use of `mktemp’ is dangerous, better use `mkstemp’ or `mkdtemp’
[email protected]:~/open-zwave-control-panel $ ln -sd ../open-zwave/config
ln: failed to create symbolic link ‘./config’: File exists
[email protected]:~/open-zwave-control-panel $
[email protected]:~/open-zwave-control-panel $ ./ozwcp -p 8888
Could Not Open OZW Log File.
2017-10-12 15:51:11.660 Always, OpenZwave Version 1.4.2757 Starting Up
webserver starting port 8888
Thanks for the tutorial.
Also got:
Makefile:71: recipe for target ‘ozwcp’ failed
make: *** [ozwcp] Error 1
On a Raspberry Pi, I had to uncomment the GNUTLS line:
#Remove comment below for gnutls support
GNUTLS := -lgnutls