Page 5 of 23
Re: zwavejs2mqtt
Posted: Tuesday 24 August 2021 21:08
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!
Re: zwavejs2mqtt
Posted: Tuesday 24 August 2021 21:41
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.
Re: zwavejs2mqtt
Posted: Tuesday 24 August 2021 21:45
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.
Re: zwavejs2mqtt
Posted: Tuesday 24 August 2021 22:21
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)
Re: zwavejs2mqtt
Posted: Tuesday 24 August 2021 22:32
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
Re: zwavejs2mqtt
Posted: Tuesday 24 August 2021 23:40
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...
Re: zwavejs2mqtt
Posted: Tuesday 24 August 2021 23:46
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 (55.67 KiB) Viewed 2037 times
with openzwave

- Screenshot 2021-08-24 223335.png (60.51 KiB) Viewed 2037 times

- Screenshot 2021-08-24 224148.png (81.22 KiB) Viewed 2037 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
Re: zwavejs2mqtt
Posted: Tuesday 24 August 2021 23:58
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:
Re: zwavejs2mqtt
Posted: Wednesday 25 August 2021 0:30
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.
Re: zwavejs2mqtt
Posted: Wednesday 25 August 2021 9:45
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:
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)
Re: zwavejs2mqtt
Posted: Wednesday 25 August 2021 9:54
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...
Re: zwavejs2mqtt
Posted: Wednesday 25 August 2021 11:50
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:
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
Re: zwavejs2mqtt
Posted: Wednesday 25 August 2021 11:59
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
Re: zwavejs2mqtt
Posted: Wednesday 25 August 2021 13:42
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
Re: zwavejs2mqtt
Posted: Wednesday 25 August 2021 14:02
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:
I created a ZwaveJS2MQTT folder in Pi's Home directory:
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.
Re: zwavejs2mqtt
Posted: Wednesday 25 August 2021 14:18
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.
Re: zwavejs2mqtt
Posted: Wednesday 25 August 2021 14:19
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:
I created a ZwaveJS2MQTT folder in Pi's Home directory:
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.
Re: zwavejs2mqtt
Posted: Wednesday 25 August 2021 14:23
by waltervl
On Debian and Ubuntu, the Docker service is configured to start on boot by default. So it depends on your image.
Re: zwavejs2mqtt
Posted: Wednesday 25 August 2021 14:26
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.
Re: zwavejs2mqtt
Posted: Wednesday 25 August 2021 14:33
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.