zwavejs2mqtt

For Z-Wave related questions in Domoticz

Moderator: leecollings

Post Reply
hestia
Posts: 357
Joined: Monday 25 December 2017 23:06
Target OS: Raspberry Pi / ODroid
Domoticz version: 2022.1
Location: Paris
Contact:

Re: zwavejs2mqtt

Post by hestia »

AllesVanZelf wrote: Friday 13 August 2021 21:48 Start ZwaveJS2MQTT via systemd
Hi AllesVanZelf,
could you please share how to do it, I'm not so good with linux
Thanks!
User avatar
heggink
Posts: 972
Joined: Tuesday 08 September 2015 21:44
Target OS: Raspberry Pi / ODroid
Domoticz version: 12451
Location: NL
Contact:

Re: zwavejs2mqtt

Post by heggink »

The errors are definitely relevant since it's not supposed to error. Please switch on debug and open an issue on github where you attach the log.
It looks like a device definition is missing a value.
Docker in Truenas scale, close to latest beta
DASHTICZ 🙃
RFXCOM, zwavejs2mqtt, zigbee2mqtt,
P1 meter & solar panel
Google home, Wifi Cams motion detection
Geofence iCloud, Bluetooth & Wifi ping
Harmony hub, Nest, lots more :-)
User avatar
heggink
Posts: 972
Joined: Tuesday 08 September 2015 21:44
Target OS: Raspberry Pi / ODroid
Domoticz version: 12451
Location: NL
Contact:

Re: zwavejs2mqtt

Post by heggink »

hestia wrote: Tuesday 24 August 2021 21:08
AllesVanZelf wrote: Friday 13 August 2021 21:48 Start ZwaveJS2MQTT via systemd
Hi AllesVanZelf,
could you please share how to do it, I'm not so good with linux
Thanks!
There is 2 ways to run zwavejs2mqtt. One is to install the software itself and run as a service (ie systemd), the other is to follow the guidelines on the plugin page in which case you run the zwavejs2mqtt docker container (which is, what I assume, you already did).

btw: you can see the node number from the devices tab in domoticz. It's the number after the first / in the device id or name. so /76/xxx is node 76. You can see that in OZW as well as in zwavejs2mqtt.
Docker in Truenas scale, close to latest beta
DASHTICZ 🙃
RFXCOM, zwavejs2mqtt, zigbee2mqtt,
P1 meter & solar panel
Google home, Wifi Cams motion detection
Geofence iCloud, Bluetooth & Wifi ping
Harmony hub, Nest, lots more :-)
hestia
Posts: 357
Joined: Monday 25 December 2017 23:06
Target OS: Raspberry Pi / ODroid
Domoticz version: 2022.1
Location: Paris
Contact:

Re: zwavejs2mqtt

Post by hestia »

Thanks for your quick reply
For the docker
Yes I did the docker, and what is written in the guidelines.
But if I reboot my system, I get "Unable to connect" when I try to connect to ...:8091, because the docker is not running.
I need to exec the command docker

Code: Select all

run --rm -it -p 8091:8091 -p 3000:3000 --device=/dev/ttyACM0 --mount source=zwavejs2mqtt,target=/usr/src/app/store zwavejs/zwavejs2mqtt:latest
to get it work, and with something running in my Linux session. I don't know enough about docker (as others who will want to do it later on)
User avatar
heggink
Posts: 972
Joined: Tuesday 08 September 2015 21:44
Target OS: Raspberry Pi / ODroid
Domoticz version: 12451
Location: NL
Contact:

Re: zwavejs2mqtt

Post by heggink »

Ah, clear. I use a different start command that automatically starts the docker container on system start. I suggest you add --name zwavejs2mqtt --restart-always to the command
That way, the container has a name and is always restarted.

Sent from my SM-G980F using Tapatalk

Docker in Truenas scale, close to latest beta
DASHTICZ 🙃
RFXCOM, zwavejs2mqtt, zigbee2mqtt,
P1 meter & solar panel
Google home, Wifi Cams motion detection
Geofence iCloud, Bluetooth & Wifi ping
Harmony hub, Nest, lots more :-)
hestia
Posts: 357
Joined: Monday 25 December 2017 23:06
Target OS: Raspberry Pi / ODroid
Domoticz version: 2022.1
Location: Paris
Contact:

Re: zwavejs2mqtt

Post by hestia »

so I've tried this command

Code: Select all

 docker run --rm -it -p 8091:8091 -p 3000:3000 --device=/dev/ttyACM0 --mount source=zwavejs2mqtt,target=/usr/src/app/store zwavejs/zwavejs2mqtt:latest --name zwavejs2mqtt --restart always
and I've got this error: node: bad option: --name
I've looked at the docker docs, but didn't find yet the right commands to use...
hestia
Posts: 357
Joined: Monday 25 December 2017 23:06
Target OS: Raspberry Pi / ODroid
Domoticz version: 2022.1
Location: Paris
Contact:

Re: zwavejs2mqtt

Post by hestia »

heggink wrote: Tuesday 24 August 2021 21:45 btw: you can see the node number from the devices tab in domoticz. It's the number after the first / in the device id or name. so /76/xxx is node 76. You can see that in OZW as well as in zwavejs2mqtt.
Ok, so I've got this
with zwavejs2mqtt
Screenshot 2021-08-24 223200.png
Screenshot 2021-08-24 223200.png (55.67 KiB) Viewed 1826 times
with openzwave
Screenshot 2021-08-24 223335.png
Screenshot 2021-08-24 223335.png (60.51 KiB) Viewed 1826 times
Screenshot 2021-08-24 224148.png
Screenshot 2021-08-24 224148.png (81.22 KiB) Viewed 1826 times
I don't have always the id in the Hardware (Device tab)
So the job will be to rename all the devices and add them in the right plans and the scripts with the new id.
Perhaps a script to write
User avatar
heggink
Posts: 972
Joined: Tuesday 08 September 2015 21:44
Target OS: Raspberry Pi / ODroid
Domoticz version: 12451
Location: NL
Contact:

Re: zwavejs2mqtt

Post by heggink »

I use it slightly differently. In your situation, -i means interactive, -t means it has a pseudo terminal and --rm means it's destroyed on shutdown.

I start docker as follows:

Code: Select all

docker run -d --name zwavejs2mqtt --restart unless-stopped -p 8091:8091 -p 3000:3000 --device=/dev/ttyACM0 --mount source=zwavejs2mqtt,target=/usr/src/app/store zwavejs/zwavejs2mqtt:latest
-d means it's detached (daemon)
--restart unless-stopped means it's restarted if it stops (unless you stop it)
--name means that it's given a name so you can start/stop/delete it by name

Mind you: since I don't have --rm, I need to delete the container if I want to upgrade it. Since it is normally not deleted, I can stop it (docker stop zwavejs2mqtt), start it (docker start zwavejs2mqtt), delete it (docker rm zwavejs2mqtt) and then rebuild it with the same command as above (which will then download the latest image and start it again under the zwavejs2mqtt name).

You can also see it's state with:

Code: Select all

docker ps
Docker in Truenas scale, close to latest beta
DASHTICZ 🙃
RFXCOM, zwavejs2mqtt, zigbee2mqtt,
P1 meter & solar panel
Google home, Wifi Cams motion detection
Geofence iCloud, Bluetooth & Wifi ping
Harmony hub, Nest, lots more :-)
User avatar
waltervl
Posts: 5154
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: zwavejs2mqtt

Post by waltervl »

heggink wrote: Tuesday 24 August 2021 20:15 That's a good idea. Just added some extra explanations here and there. Should be pretty complete now. Have a read and let me know if it's clear and concise enough.

H
I miss a section about migrating from OZW to ZwaveJS.
What is the impact for those users? New IDX, new Names? Tips and tricks to migrate?
Some are there like issue a zwavejs save command to trigger device recreation in Domoticz. But perhaps there are more.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
hestia
Posts: 357
Joined: Monday 25 December 2017 23:06
Target OS: Raspberry Pi / ODroid
Domoticz version: 2022.1
Location: Paris
Contact:

Re: zwavejs2mqtt

Post by hestia »

heggink wrote: Tuesday 24 August 2021 23:58

Code: Select all

docker run -d --name zwavejs2mqtt --restart unless-stopped -p 8091:8091 -p 3000:3000 --device=/dev/ttyACM0 --mount source=zwavejs2mqtt,target=/usr/src/app/store zwavejs/zwavejs2mqtt:latest
-d means it's detached (daemon)
--restart unless-stopped means it's restarted if it stops (unless you stop it)
--name means that it's given a name so you can start/stop/delete it by name

Mind you: since I don't have --rm, I need to delete the container if I want to upgrade it. Since it is normally not deleted, I can stop it (docker stop zwavejs2mqtt), start it (docker start zwavejs2mqtt), delete it (docker rm zwavejs2mqtt) and then rebuild it with the same command as above (which will then download the latest image and start it again under the zwavejs2mqtt name).

You can also see it's state with:

Code: Select all

docker ps
Thanks, it works with this.
To summarize what I've tested
1/ Installation

Code: Select all

docker run -d --name zwavejs2mqtt --restart unless-stopped -p 8091:8091 -p 3000:3000 --device=/dev/ttyACM0 --mount source=zwavejs2mqtt,target=/usr/src/app/store zwavejs/zwavejs2mqtt:latest
2/ operations

Code: Select all

docker ps
docker stop zwavejs2mqtt
docker start zwavejs2mqtt
docker logs zwavejs2mqtt
docker restart zwavejs2mqtt
3/ upgrade
docker stop zwavejs2mqtt
docker rm zwavejs2mqtt
+ step 1: installation
(probably a better way with the update command)
hestia
Posts: 357
Joined: Monday 25 December 2017 23:06
Target OS: Raspberry Pi / ODroid
Domoticz version: 2022.1
Location: Paris
Contact:

Re: zwavejs2mqtt

Post by hestia »

Other questions:
In which way does it work? I've set a name for a node in the control panel (ZWave To MQTT) and it didn't arrive in domoticz. Do I have to do somethings?

Where are located the ZWave To MQTT data (and other stuff). To backup them...
User avatar
heggink
Posts: 972
Joined: Tuesday 08 September 2015 21:44
Target OS: Raspberry Pi / ODroid
Domoticz version: 12451
Location: NL
Contact:

Re: zwavejs2mqtt

Post by heggink »

hestia wrote:
heggink wrote: Tuesday 24 August 2021 23:58

Code: Select all

docker run -d --name zwavejs2mqtt --restart unless-stopped -p 8091:8091 -p 3000:3000 --device=/dev/ttyACM0 --mount source=zwavejs2mqtt,target=/usr/src/app/store zwavejs/zwavejs2mqtt:latest
-d means it's detached (daemon)
--restart unless-stopped means it's restarted if it stops (unless you stop it)
--name means that it's given a name so you can start/stop/delete it by name

Mind you: since I don't have --rm, I need to delete the container if I want to upgrade it. Since it is normally not deleted, I can stop it (docker stop zwavejs2mqtt), start it (docker start zwavejs2mqtt), delete it (docker rm zwavejs2mqtt) and then rebuild it with the same command as above (which will then download the latest image and start it again under the zwavejs2mqtt name).

You can also see it's state with:

Code: Select all

docker ps
Thanks, it works with this.
To summarize what I've tested
1/ Installation

Code: Select all

docker run -d --name zwavejs2mqtt --restart unless-stopped -p 8091:8091 -p 3000:3000 --device=/dev/ttyACM0 --mount source=zwavejs2mqtt,target=/usr/src/app/store zwavejs/zwavejs2mqtt:latest
2/ operations

Code: Select all

docker ps
docker stop zwavejs2mqtt
docker start zwavejs2mqtt
docker logs zwavejs2mqtt
docker restart zwavejs2mqtt
3/ upgrade
docker stop zwavejs2mqtt
docker rm zwavejs2mqtt
+ step 1: installation
(probably a better way with the update command)
Correct

Sent from my SM-G980F using Tapatalk

Docker in Truenas scale, close to latest beta
DASHTICZ 🙃
RFXCOM, zwavejs2mqtt, zigbee2mqtt,
P1 meter & solar panel
Google home, Wifi Cams motion detection
Geofence iCloud, Bluetooth & Wifi ping
Harmony hub, Nest, lots more :-)
User avatar
heggink
Posts: 972
Joined: Tuesday 08 September 2015 21:44
Target OS: Raspberry Pi / ODroid
Domoticz version: 12451
Location: NL
Contact:

Re: zwavejs2mqtt

Post by heggink »

hestia wrote:Other questions:
In which way does it work? I've set a name for a node in the control panel (ZWave To MQTT) and it didn't arrive in domoticz. Do I have to do somethings?

Where are located the ZWave To MQTT data (and other stuff). To backup them...
The best way is to, before you install the plugin, name all your devices in zwavejs2mqtt. They will all then be created with that name in domoticz. I would need to check myself what happens if you change the name of an existing device in zwavejs2mqtt. Don't know really.

Wrt backups, it depends on the installation of zwavejs2mqtt. If you, like me, use docker without persistent storage, all your data is stored under docker until you delete it. On my pi4b, the location is /var/lib/docker/volumes/zwavejs2mqtt/_data

Instead of just using the docker command, you can also use the docker-compose mechanism where all the configh details are stored in a config file:
https://github.com/zwave-js/zwavejs2mqt ... ompose.yml

This example (the default) maps a local config folder (./store) into the container. You can then access the files from that folder directly without having to go through /var/lib/docker/...

H
Docker in Truenas scale, close to latest beta
DASHTICZ 🙃
RFXCOM, zwavejs2mqtt, zigbee2mqtt,
P1 meter & solar panel
Google home, Wifi Cams motion detection
Geofence iCloud, Bluetooth & Wifi ping
Harmony hub, Nest, lots more :-)
User avatar
waltervl
Posts: 5154
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: zwavejs2mqtt

Post by waltervl »

waltervl wrote: Wednesday 25 August 2021 0:30
heggink wrote: Tuesday 24 August 2021 20:15 That's a good idea. Just added some extra explanations here and there. Should be pretty complete now. Have a read and let me know if it's clear and concise enough.

H
I miss a section about migrating from OZW to ZwaveJS.
What is the impact for those users? New IDX, new Names? Tips and tricks to migrate?
Some are there like issue a zwavejs save command to trigger device recreation in Domoticz. But perhaps there are more.
Perhaps something like: https://community.home-assistant.io/t/s ... qtt/276721
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
AllesVanZelf
Posts: 265
Joined: Monday 05 February 2018 8:42
Target OS: Raspberry Pi / ODroid
Domoticz version: 12467
Location: Netherlands, near Haarlem
Contact:

Re: zwavejs2mqtt

Post by AllesVanZelf »

I was using a direct systemd service file to start zwavejs2mqtt via docker.
But this was not working well for me.
I found out that docker can start containers at boot if you enable this.

This can be done by:

Code: Select all

sudo systemctl enable docker
I created a ZwaveJS2MQTT folder in Pi's Home directory:

Code: Select all

mkdir /home/pi/zwavejs2mqtt
And start the zwavejs2mqtt container as:

Code: Select all

docker run -dit --restart unless-stopped --name zwave-js -p 8091:8091 -p 3000:3000 --device=/dev/ttyACM0 -v /home/pi/zwavejs2mqtt:/usr/src/app/store zwavejs/zwavejs2mqtt:latest
Till now this is working great and survives a reboot.
Domoticz 2020.1 (12230) on Raspberry Pi 3B with Raspian Buster. Besides Domoticz, Rpi is running Pi-Hole.
User avatar
heggink
Posts: 972
Joined: Tuesday 08 September 2015 21:44
Target OS: Raspberry Pi / ODroid
Domoticz version: 12451
Location: NL
Contact:

Re: zwavejs2mqtt

Post by heggink »

waltervl wrote: Wednesday 25 August 2021 13:42
waltervl wrote: Wednesday 25 August 2021 0:30
heggink wrote: Tuesday 24 August 2021 20:15 That's a good idea. Just added some extra explanations here and there. Should be pretty complete now. Have a read and let me know if it's clear and concise enough.

H
I miss a section about migrating from OZW to ZwaveJS.
What is the impact for those users? New IDX, new Names? Tips and tricks to migrate?
Some are there like issue a zwavejs save command to trigger device recreation in Domoticz. But perhaps there are more.
Perhaps something like: https://community.home-assistant.io/t/s ... qtt/276721
I added quite a bit to the readme so it should be pretty close to a how to move from OZW. Let me know if this is good enough or whether anything is missing.
Docker in Truenas scale, close to latest beta
DASHTICZ 🙃
RFXCOM, zwavejs2mqtt, zigbee2mqtt,
P1 meter & solar panel
Google home, Wifi Cams motion detection
Geofence iCloud, Bluetooth & Wifi ping
Harmony hub, Nest, lots more :-)
User avatar
heggink
Posts: 972
Joined: Tuesday 08 September 2015 21:44
Target OS: Raspberry Pi / ODroid
Domoticz version: 12451
Location: NL
Contact:

Re: zwavejs2mqtt

Post by heggink »

AllesVanZelf wrote: Wednesday 25 August 2021 14:02 I was using a direct systemd service file to start zwavejs2mqtt via docker.
But this was not working well for me.
I found out that docker can start containers at boot if you enable this.

This can be done by:

Code: Select all

sudo systemctl enable docker
I created a ZwaveJS2MQTT folder in Pi's Home directory:

Code: Select all

mkdir /home/pi/zwavejs2mqtt
And start the zwavejs2mqtt container as:

Code: Select all

docker run -dit --restart unless-stopped --name zwave-js -p 8091:8091 -p 3000:3000 --device=/dev/ttyACM0 -v /home/pi/zwavejs2mqtt:/usr/src/app/store zwavejs/zwavejs2mqtt:latest
Till now this is working great and survives a reboot.
Correct. I noticed that I was using a different docker command from what was in teh README. The joys of multiple people working on the same thing ;-). So I added a new recommended line which includes the restart of the docker container and uses persistent storage for easier backup.
Docker in Truenas scale, close to latest beta
DASHTICZ 🙃
RFXCOM, zwavejs2mqtt, zigbee2mqtt,
P1 meter & solar panel
Google home, Wifi Cams motion detection
Geofence iCloud, Bluetooth & Wifi ping
Harmony hub, Nest, lots more :-)
User avatar
waltervl
Posts: 5154
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: zwavejs2mqtt

Post by waltervl »

On Debian and Ubuntu, the Docker service is configured to start on boot by default. So it depends on your image.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
User avatar
waltervl
Posts: 5154
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: zwavejs2mqtt

Post by waltervl »

And the 3000 port is conflicting with users running Grafana and or for example NefitEasy server, so either move ZwaveJS or Grafana to another port.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
User avatar
heggink
Posts: 972
Joined: Tuesday 08 September 2015 21:44
Target OS: Raspberry Pi / ODroid
Domoticz version: 12451
Location: NL
Contact:

Re: zwavejs2mqtt

Post by heggink »

waltervl wrote: Wednesday 25 August 2021 14:26 And the 3000 port is conflicting with users running Grafana and or for example NefitEasy server, so either move ZwaveJS or Grafana to another port.
I believe port 3000 is only used with Home Assistant (HA) so that would mean that HA and Grafana conflict. Since I kicked out HA again, I don't know how configurable that port is (suspect it is).

In any case, I expect people to be savvy enough to understand what they have running on their system, where ports may conflict and how to resolve. It's important but, if you agree, will leave that out of the README for now.
Docker in Truenas scale, close to latest beta
DASHTICZ 🙃
RFXCOM, zwavejs2mqtt, zigbee2mqtt,
P1 meter & solar panel
Google home, Wifi Cams motion detection
Geofence iCloud, Bluetooth & Wifi ping
Harmony hub, Nest, lots more :-)
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 1 guest