/ZWave2MQTT

A NodeJS bridge between Z-Wave devices and MQTT

Primary LanguageJavaScriptApache License 2.0Apache-2.0

DomoGeeek

This module is a gateway between Z-Wave devices and the MQTT broker and takes part from the DomoGeeek project.

This module is based on node-openzwave and allows you to transform Z-Wave messages into MQTT messages. Works perfectly on a Raspberry Pi with an Aeon Lab Z-Wave USB dongle.

My post in French about this Zwave Gateway : https://www.geeek.org/zwave2mqtt-objets-connectes-zwave-185/

Prerequisites

Compile OpenZwave

sudo apt-get install libudev-dev
cd ~ 
wget http://old.openzwave.com/downloads/openzwave-1.4.1.tar.gz
tar zxvf openzwave-*.gz
cd openzwave-* && make && sudo make install
export LD_LIBRARY_PATH=/usr/local/lib
sudo sed -i '$a LD_LIBRARY_PATH=/usr/local/lib' /etc/environment

Install

Install dependencies

$ npm install
$ vi config.js 

You can enable the debug flag to analyze the messages exchanged on the network.

Test

$ ./start.sh

By default, each family of messages are sent into specific MQTT topics (alarm, sensor ...).

Deploy

$ sudo npm install pm2 -g
$ ./pm2.sh
$ pm2 startup
$ pm2 save