zwavejs2mqtt

For Z-Wave related questions in Domoticz

Moderator: leecollings

Post Reply
User avatar
waltervl
Posts: 5152
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: zwavejs2mqtt

Post by waltervl »

heggink wrote: Wednesday 25 August 2021 14:18
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.
Perhaps for docker just refer to the docker installation manual https://github.com/zwave-js/zwavejs2mqt ... ter/docker
I miss for example the "Add -e TZ=Europe/Stockholm to the docker run command to set the correct timezone in container" note.
On that page there is also the reference to the docker-compose.yml
If you migrate from OZW, this will be a new plugin with new devices. Once you delete OZW in domoticz, your old devices are gone. If you need to retain history then you need to replace the old device with the new one if identical devices are created. New devices will be (automatically) added to domoticz (new names, new IDX) on the first status change.
I think you should warn not to use OZW and ZwaveJS together.
So a possible migration scenario:
1. Document current OZW/Domoticz configuration (How?)
2. Disable (or delete?) OZW from Domoticz. Reboot system or restart Domoticz
3. Install ZwaveJS2MQTT (Docker)
4. Install Plugin
5. Reboot system or restart Domoticz
6. Activate plugin and wait for all New devices to appear in Domoticz
7. Rename new devices to old names if used in scripts or modify scripts to use new names. If OZW was disabled, devices with the same name will give errors in dzVents so delete the old device from OZW after renaming the new device. Is function replace device (wiki https://www.domoticz.com/wiki/Managing_ ... ace_device )a good alternative method as it will also keep the device history logging if present.
8. Remove OZW hardware (if not done in step 2)
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: Wednesday 25 August 2021 11:59
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.
[...]
I've set a name in zwavejs2mqtt
I've disabled the plugin in dz and removed all the zwavejs2mqtt devices
I've enabled the plugin in dz
The name show up in the devices list for some devices of the node (switches, but no kWh)
After I change the name in zwavejs2mqtt and redo the process, and the names didn't change in dz (I think it is good because the initial names have to be changed)
Screenshot 2021-08-25 165109.png
Screenshot 2021-08-25 165109.png (28.19 KiB) Viewed 1945 times
Screenshot 2021-08-25 165317.png
Screenshot 2021-08-25 165317.png (128.5 KiB) Viewed 1945 times
If I put all the good names in zwavejs2mqtt on my testing environment, will it be possible to export them in the production ones?
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 »

I've copied/pasted the name off all the 37 nodes from dz to zwave.js2mqtt.
About 1/2 hours.
Do I push them right now in dz, or do I wait for a fix about the names of the other devices?
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 »

Some answers to me ;-)
Control Panel / Actions / Advanced / Export => export the nodes with the the names

Code: Select all

{
  "1": {
    "name": "Z-Stick Gen5"
  },
  "11": {
    "name": "Portail SN 16056DR384 PN ZMNHSD1 H1S1P2"
  },
  "17": {
    "name": "Terrasse !!!!!"
  },
  "30": {
    "name": "Smart Plug HKZW-SO05"
  },
Control Panel / Actions / Advanced / Import => export the nodes withe the names.
So if I remove the container, I could do it several times
And also import it on the production env.

(if we could have the same export from dz, no need to do it manually!)
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: Wednesday 25 August 2021 18:06 Some answers to me ;-)
Control Panel / Actions / Advanced / Export => export the nodes with the the names

Code: Select all

{
  "1": {
    "name": "Z-Stick Gen5"
  },
  "11": {
    "name": "Portail SN 16056DR384 PN ZMNHSD1 H1S1P2"
  },
  "17": {
    "name": "Terrasse !!!!!"
  },
  "30": {
    "name": "Smart Plug HKZW-SO05"
  },
Control Panel / Actions / Advanced / Import => export the nodes withe the names.
So if I remove the container, I could do it several times
And also import it on the production env.

(if we could have the same export from dz, no need to do it manually!)
That's indeed one option. The other is to take all the zwavejs2mqtt files and copy these to your production system. You would need to use the same stick for that to work.
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 »

Screenshot 2021-08-25 182854.png
Screenshot 2021-08-25 182854.png (104.33 KiB) Viewed 1939 times
So I did it
37 nodes => 143 devices => 15 devices with bad names for 9 nodes
The bad nodes are not in specifics Type or SubType, but looks random
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 »

After I change the name in zwavejs2mqtt and redo the process, and the names didn't change in dz (I think it is good because the initial names have to be changed)

I did some thinking and realised that this is how the plugin is supposed to work: it creates default devices with the names from zwavejs2mqtt. If then you change the name (or the room name), you may not want your names in domoticz to be overwritten so names will never change through the plugin. If you want changed names, delete the device and it will recreate them with the new name.
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: Wednesday 25 August 2021 17:57 I've copied/pasted the name off all the 37 nodes from dz to zwave.js2mqtt.
About 1/2 hours.
Do I push them right now in dz, or do I wait for a fix about the names of the other devices?
I don't quite understand what the issue is. Could you explain a bit more what happens that is unexpected?
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 »

Yes!
in the picture just above (18:34) some devices are created without the name set in zwavejs2mqtt.
It's
Screenshot 2021-08-25 182854.png
Screenshot 2021-08-25 182854.png (104.33 KiB) Viewed 1937 times
"random" because for a node, some devices are ok and others are ko
Also, possible to remove the "ZwaveMQTT" from the device name, not very user friendly
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: Wednesday 25 August 2021 18:46 Yes!
in the picture just above (18:34) some devices are created without the name set in zwavejs2mqtt.
It's Screenshot 2021-08-25 182854.png"random" because for a node, some devices are ok and others are ko
Also, possible to remove the "ZwaveMQTT" from the device name, not very user friendly
Right, so some devices get created correctly using the name in zwavejs but some are not?

Please file a bug on the plugin github page. What would help is that you enable full debugging and also list what device this is together with the device screen from zwavejs2mqtt. As mentioned previously, we have a bunch of devices that are already correct but there may well be the odd one here and there that may not work correctly. ALl bugs are tracked through github.

In terms of removing the plugin name from the device name, please file that separately as an enhancement and we'll look into that as well.

Outside of that, things working OK?
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 »

waltervl wrote: Wednesday 25 August 2021 16:09
heggink wrote: Wednesday 25 August 2021 14:18
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.
Perhaps for docker just refer to the docker installation manual https://github.com/zwave-js/zwavejs2mqt ... ter/docker
I miss for example the "Add -e TZ=Europe/Stockholm to the docker run command to set the correct timezone in container" note.
On that page there is also the reference to the docker-compose.yml
If you migrate from OZW, this will be a new plugin with new devices. Once you delete OZW in domoticz, your old devices are gone. If you need to retain history then you need to replace the old device with the new one if identical devices are created. New devices will be (automatically) added to domoticz (new names, new IDX) on the first status change.
I think you should warn not to use OZW and ZwaveJS together.
So a possible migration scenario:
1. Document current OZW/Domoticz configuration (How?)
2. Disable (or delete?) OZW from Domoticz. Reboot system or restart Domoticz
3. Install ZwaveJS2MQTT (Docker)
4. Install Plugin
5. Reboot system or restart Domoticz
6. Activate plugin and wait for all New devices to appear in Domoticz
7. Rename new devices to old names if used in scripts or modify scripts to use new names. If OZW was disabled, devices with the same name will give errors in dzVents so delete the old device from OZW after renaming the new device. Is function replace device (wiki https://www.domoticz.com/wiki/Managing_ ... ace_device )a good alternative method as it will also keep the device history logging if present.
8. Remove OZW hardware (if not done in step 2)
I think I now pretty much added most of your suggestions. Hope it helps other people.
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 »

By the way, in case you missed it, unlike OZW, deleting dead devices in zwavejs2mqtt is really simple and deleted devices stay deleted.

In the zwavejs2mqtt interface, open the dead device that is to be deleted, click advanced click remove under failed nodes.

After years of OZW, I had quite a number of dead devices (many smoke detectors that, at some point, would just drop off the network and re-including then created new devices for no apparent reason). Took me a few minutes to delete them. No need to edit stick databases or any of that hassle.
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
Varazir
Posts: 360
Joined: Friday 20 February 2015 22:23
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Contact:

Re: zwavejs2mqtt

Post by Varazir »

Hello,

I used this to install https://github.com/zwave-js/zwavejs2mqt ... er#install
( didn't say anything of I need to docker pull zwavejs/zwavejs2mqtt ) so I got a error

Code: Select all

Unable to find image 'zwavejs/zwavejs2mqtt:latest' locally
I installed the docker using the pull command

Started with this command again

Code: Select all

docker run --rm -it -p 8091:8091 -p 3000:3000 --device=/dev/ttyAMA0 --mount source=zwavejs2mqtt,target=/usr/src/app/store zwavejs/zwavejs2mqtt:latest -e TZ=Europe/Stockholm

Code: Select all

[eval]:1
pi@zwave2:~/domoticz/plugins $ docker run --rm -it -p 8091:8091 -p 3000:3000 --device=/dev/ttyAMA0  -e TZ=Europe/Stockholm --mount source=zwavejs2mqtt,target=/usr/src/app/store zwavejs/zwavejs2mqtt:latest
/bin/sh: git: not found
2021-08-26 12:21:56.448 INFO APP: Version: 5.5.1
2021-08-26 12:21:56.468 INFO APP: Application path:/usr/src/app

 ______                       _     ___                  _   _
|___  /                      (_)   |__ \                | | | |
   / /_      ____ ___   _____ _ ___   ) |_ __ ___   __ _| |_| |_
  / /\ \ /\ / / _` \ \ / / _ \ / __| / /| '_ ` _ \ / _` | __| __|
 / /__\ V  V / (_| |\ V /  __/ \__ \/ /_| | | | | | (_| | |_| |_
/_____|\_/\_/ \__,_| \_/ \___| |___/____|_| |_| |_|\__, |\__|\__|
                            _/ |                      | |
                           |__/                       |_|

2021-08-26 12:21:56.581 WARN STORE: settings.json not found
2021-08-26 12:21:56.604 WARN STORE: scenes.json not found
2021-08-26 12:21:56.613 WARN STORE: nodes.json not found
2021-08-26 12:21:56.758 INFO APP: Listening on port 8091 host 0.0.0.0 protocol HTTP
2021-08-26 12:21:57.040 ERROR GATEWAY: Zwave settings are not valid

What did I miss in the installations steps ?
Raspberry PI 2 with RaZberry Controller 2016 ZWave+ and CC2531(zigbee)
Several IKEA devices/z-wave devices
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 »

Difficult to say. There should be no need to pull any docker image since it should do that automatically when you issue "docker run".

The command you run subsequently (docker run --rm -it -p ...) starts the container in interactive mode with a terminal attached. Does it stop immediately or does it keep running (and you can access the web interface)? Is your device (/dev/ttyAMA0) the correct one (ie used by OZW)?

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
Varazir
Posts: 360
Joined: Friday 20 February 2015 22:23
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Contact:

Re: zwavejs2mqtt

Post by Varazir »

heggink wrote: Thursday 26 August 2021 13:03 Difficult to say. There should be no need to pull any docker image since it should do that automatically when you issue "docker run".

The command you run subsequently (docker run --rm -it -p ...) starts the container in interactive mode with a terminal attached. Does it stop immediately or does it keep running (and you can access the web interface)? Is your device (/dev/ttyAMA0) the correct one (ie used by OZW)?

H
It keeps running.
I can access the webbgui
It's the device OZW using
I haven'tr enabled the plugin in Domoticz yet
Raspberry PI 2 with RaZberry Controller 2016 ZWave+ and CC2531(zigbee)
Several IKEA devices/z-wave devices
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 »

Ok, so you need to tell the docker container what device to map in the container and then you need to select that device from the zwavejs2mqtt web interface. If the correct device has been passed to the container, it should all work without a problem.


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
Varazir
Posts: 360
Joined: Friday 20 February 2015 22:23
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Contact:

Re: zwavejs2mqtt

Post by Varazir »

heggink wrote: Thursday 26 August 2021 15:19 Ok, so you need to tell the docker container what device to map in the container and then you need to select that device from the zwavejs2mqtt web interface. If the correct device has been passed to the container, it should all work without a problem.


Sent from my SM-G980F using Tapatalk
How do I do that? I have never worked with docker. Just installed it.
Followed the steps on the github.
Raspberry PI 2 with RaZberry Controller 2016 ZWave+ and CC2531(zigbee)
Several IKEA devices/z-wave devices
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 »

Easiest to follow the instructions on the zwavejs2mqtt plugin on github:
- write down what device OZW uses (you should see it in the domoticz OZW settings)
- create a folder that will contain your zwavejs2mqtt data files. below, a folder called "/opt/zwavejs2mqtt/store" is used for that purpose
- then start the docker container using the following command (replace OZW_DEVICE with the device name you got from OZW):

Code: Select all

docker run -d --name zwavejs2mqtt --restart unless-stopped -v /opt/zwavejs2mqtt/store:/usr/src/app/store -p 8091:8091 -p 3000:3000 --device=OZW_DEVICE  zwavejs/zwavejs2mqtt:latest
You can check if it runs with

Code: Select all

docker ps
You can stop it with

Code: Select all

docker stop zwavejs2mqtt
You can start it with

Code: Select all

docker start zwavejs2mqtt
If you want to upgrade to the latest version:
stop it with

Code: Select all

docker stop zwavejs2mqtt
delete it with

Code: Select all

docker rm zwavejs2mqtt
and recreate with the same command you did the first time:

Code: Select all

docker run -d --name ...
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
Varazir
Posts: 360
Joined: Friday 20 February 2015 22:23
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Contact:

Re: zwavejs2mqtt

Post by Varazir »

One step forward, thanks.
Raspberry PI 2 with RaZberry Controller 2016 ZWave+ and CC2531(zigbee)
Several IKEA devices/z-wave devices
User avatar
Varazir
Posts: 360
Joined: Friday 20 February 2015 22:23
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Contact:

Re: zwavejs2mqtt

Post by Varazir »

I can see the devices in the webGUI
Korrekt me but that is the broker ?
So in the plugin settings I use localhost as adress ?
Raspberry PI 2 with RaZberry Controller 2016 ZWave+ and CC2531(zigbee)
Several IKEA devices/z-wave devices
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests