Zwave JS UI Server install without docker for x86-64 platforms

These instructions assume that you know how to install and navigate your OS on your device.

Install Raspberry Raspbian with desktop for desktop PC.

Initial setup of Raspberry Raspbian is easier with monitor keyboard and mouse hooked up local to your device.
Enable SSH in configuration, once you have enabled SSH then remote configuring is preferred for below instructions.
You can copy and paste below commands into the terminal, these instructions assume you have knowledge on the ability to SSH into your device.
Copy and paste is the easiest, and PuTTY allows right click paste.
These steps use the default user of pi, so if using different then what is default make changes as needed.

(Note some stuff will not work fully until all the steps have been done IE shared folders won’t connect until that directory is made.)

This instruction will do the following:

  1. Will allow network shares of certain folders for editing and backing up your configuration of files and access to root directory.
    ((WARNING MESSING AROUND IN ROOT DIR CAN BREAK YOUR INSTALL))

  2. Will install Zwave-JS-UI server onto your device.

  3. Will allow Zwave-JS-UI Server to restart after a reboot.

  4. Will allow Access at your machines IP local address “http://xxx.xxx.xxx.xxx:8091/”

"DO NOT COPY AND PASTE STUFF IN QUOTES"

“LOG INTO THE TERMINAL.”

sudo apt update

sudo apt upgrade -y

sudo apt autoremove -y

“STEPS BELOW ALLOWS SHARING OF FOLDERS OVER YOUR LOCAL NETWORK.”


sudo apt install samba -y


sudo nano /etc/samba/smb.conf

“CLEAR SCREEN BY HOLDING DOWN THE CTRL AND K KEYS.”

“COPY ALL BELOW THIS LINE DOWN TO NOT INCLUDING END.”


[global]
netbios name = Zwave Server
server string = The HA File Center
workgroup = WORKGROUP
hosts allow =
socket options = TCP_NODELAY IPTOS_LOWDELAY SO_RCVBUF=65536 SO_SNDBUF=65536
remote announce =
remote browse sync =

[HOME PI]
path = /home/pi
comment = No comment
browsable = yes
read only = no
valid users =
writable = yes
guest ok = yes
public = yes
create mask = 0777
directory mask = 0777
force user = root
force create mode = 0777
force directory mode = 0777
hosts allow =

[ROOT]
path = /
comment = No comment
browsable = yes
read only = no
valid users =
writable = yes
guest ok = yes
public = yes
create mask = 0777
directory mask = 0777
force user = root
force create mode = 0777
force directory mode = 0777
hosts allow =

[ZWAVE SERVER]
path = /home/pi/zwave-js-ui
comment = No comment
browsable = yes
read only = no
valid users =
writable = yes
guest ok = yes
public = yes
create mask = 0777
directory mask = 0777
force user = root
force create mode = 0777
force directory mode = 0777
hosts allow =

“END”

“PRESS CRTL+O (write out), ENTER, CTRL+X (exit).”

sudo smbpasswd -a pi

“ENTER THE PASSWORD IT WILL ASK TWICE.”

sudo service smbd restart

“STEPS BELOW MAKES Zwave-JS Server START ON REBOOT.”

sudo nano -w /etc/systemd/system/zwavejs.service

“COPY ALL BELOW THIS LINE DOWN TO NOT INCLUDING END.”

[Unit]
Description=ZWave-JS
Wants=network-online.target
After=network-online.target

[Service]
User=pi
Group=pi
WorkingDirectory=/home/pi/zwave-js-ui
ExecStart=/home/pi/zwave-js-ui/zwave-js-ui-linux

[Install]
WantedBy=multi-user.target

“END”

“PRESS CRTL+O (write out), ENTER, CTRL+X (exit).”

sudo systemctl --system daemon-reload

sudo systemctl enable zwavejs.service

“BELOW INSTALLS THE ZWAVE JS SERVER.”

sudo apt install curl

sudo apt update

sudo apt upgrade -y

sudo apt autoremove -y


cd ~
sudo systemctl stop zwavejs.service

mkdir zwave-js-ui
cd zwave-js-ui
# download latest version
curl -s https://api.github.com/repos/zwave-js/zwave-js-ui/releases/latest  \
| grep "browser_download_url.*linux.zip" \
| cut -d : -f 2,3 \
| tr -d \" \
| wget -i -
unzip -o zwave-js-ui-v*.zip

rm zwave-js-ui-v*.zip

sudo apt-get install g++-multilib -y

sudo systemctl start zwavejs.service

“BELOW MANUALLY STARTS THE SERVER IN YOUR TERMINAL”

cd
cd zwave-js-ui

sudo systemctl stop zwavejs.service

./zwave-js-ui-linux

Although I am not a node.js developer, and thus some of my skills in this area are lacking, I’ll share how I install/upgrade zwave-js-ui on Ubuntu 20.0.4 on my Intel platforms.

  1. Git
    When installing from scratch I create a parent working directory, cd into that directory and then $git clone -b v8.2.1 https://github.com/zwave-js/zwave-js-ui.
    In this example, I am specifying getting release “v8.2.1” (If you want the latest and greatest in main, simply leave out the -b v8.2.1). This creates a child directory named zwave-js-ui.
    If I had earlier versions of zwavejs-ui/zwavejs2mqtt, now is when I copy the files from the old ./store/*.json to this newer directory’s ./store/

  2. Node Version Manager (nvm) - I use nvm to manage which version of node.js to use. Over time zwave-js-ui requires higher versions of node.js. Here is a link that includes installation instructions; I used the curl version to install. When finished, make sure you start a new shell for it to take affect.
    nvm ls shows you what versions of node.js are available. You can pick one or more and install them.
    nvm install --lts=gallium As an example installs node.js version 16.x
    nvm use 16.18.0 This will instruct the system to use node.js version 16.18.0

  3. Package Manager - Some time back, I used Node Package Manager (npm) to manage zwavejs2mqtt, but have since switched to yarn which is what zwave-js-ui recommends.
    Yarn has to be installed. Starting in node version 16.10, yarn already comes with node.js via “corepack” but has to be enabled so enter the command: corepack enable. For older versions of node.js can one can install yarn using: npm i -g yarn.
    At this point you can proceed to installing/building zwave-js-ui.
    cd into zwave-js-ui directory and run:
    yarn install
    yarn run build
    yarn start
    At this point, the Zwave-js-ui Webserver should be running.

Upgrading: I have had success upgrading to a newer version of zwave-js-ui, by simply cd-ing into the existing zwave-js-ui directory and running the following (first stop the current version of zwave-js-ui from running):
git pull origin vX.Y.Z where vX.Y.Z is a newer release version.
yarn install
yarn run build
You should now be able to restart zwave-js-ui. This way, all the existing cache files, and *.json config files can be left as is and don’t have to be copied over.

@wmaker
Sorry, kinda new to yarn and nodejs, currently using the snap package but I’d like to get more independant on what version I wanna run.
After running “yarn run build” and “yarn start”, do you get like a service that will be launched after a reboot like systemd does?
For the upgrades, how do you stop the current running version?
Thx!

Yes, I have created a services file for systemd to use, and in turn I can use systemctl to control the running, stopping, etc. The file I use is similar to the following:

[Unit]
Description=ZWaveJS-UI
After=network.target

StartLimitIntervalSec=500
StartLimitBurst=5

[Service]
Environment=PATH=YOUR_USER_SHELL_PATH
WorkingDirectory=DIRECTORY_WHERE_ZWAVEJSUI_IS_LOCATED
Type=simple
User=USERNAME_YOU_WANT_TO_RUN_AS
ExecStart=PATH_TO_YARN_EXECUTABLE start

Restart=on-failure
RestartSec=5s

Nice=-20

[Install]
WantedBy=multi-user.target

To determine what YOUR_USER_SHELL_PATH is, I login as the user that I want to execute yarn start, and then I enter $echo PATH and the result of this is what YOUR_USER_SHELL_PATH should be set to. The reason I do this is because in my case, I use nvm which depends on the user’s shell.
Hope this helps.

1 Like