Skip to content

Getting Started

Marcus Davies edited this page Oct 9, 2021 · 34 revisions

So! you have taken the bait. Lets turn you into a pro with node-red-contrib-zwave-js

Before you begin

Please ensure your system meets or exceeds these requirements:

  • Node.js Version >= v12.22.2
  • Node-RED Version >= 1.3.3

node-red-contrib-zwave-js employs the nodejs serialport package, and during the installation,
it will attempt to pulldown a pre-build of that package for your host (it uses native NodeJS Modules).

If a pre-build is not available, it will attempt to compile one for you, therefore, you may need to ensure
your system has the following (if a pre-build is not available)

of course, if you know a pre-build is available, the requirements below do not apply.

Host specific requirements:

  • *nix
    • Python v3.6, v3.7, v3.8, or v3.9
    • A proper C/C++ compiler toolchain/environment, like GCC
    • If your host is openSUSE, you may also need to do:
      • zypper install nodejs-devel
      • zypper install -t pattern devel_C_C++
  • OSX
    • Python v3.6, v3.7, v3.8, or v3.9
    • XCode Command Line Tools
  • Windows
    • Python v3.6, v3.7, v3.8, or v3.9
    • Visual C++ Build Environment/tools (Visual Studio Community will do the trick)
    • Set NPM Visual Studio version npm config set msvs_version 20##

Installing

Installing the node, is no different to installing other Node-RED modules - just use the palette manager.
The install process might take a minute or 2, as it will build some native Node.js Modules (the serialports package).

If you prefer to use the command line, see below.

Installing from command line

Navigate to the .node-red directory and run the normal npm routines.

  • cd /home/pi/.node-red
  • npm install node-red-contrib-zwave-js@latest
  • Restart Node-RED

Home Assistant Users

Note! This module is not designed for (and will not work) with the Z-Wave JS driver in Home Assistant.
If, however, you use HA and still want to use this node inside the Node-RED plugin... continuing reading.

  • Do not attempt to install this node, via the palette manager - it will likely not install some serial port stuff
  • Edit the Node-RED add-on configuration as below (specifically system_packages and npm_packages)
  • Restart the add-on (Node-RED) and you should be ready to go
system_packages:
  - make
  - python3
  - g++
  - gcc
  - linux-headers
  - udev
npm_packages:
  - serialport
  - node-red-contrib-zwave-js

Now what?

Either follow the wiki down or click Here to obtain an example.