zwavejs2mqtt
Moderator: leecollings
- heggink
- Posts: 972
- Joined: Tuesday 08 September 2015 21:44
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 12451
- Location: NL
- Contact:
zwavejs2mqtt
For people out there who experience issues with the built-in OZW, there is now an alternative solution using zwavejs2mqtt.
A while back, I was facing a lot of issues with OZW and didn't like the fact that it's built into domoticz (e.g. every time you want a dzvents update, you are also forced to adopt all OZW updates unless you want to build from source). I got connected to @moroen and we discussed possible approaches. Since Home Assistant already switched to zwavejs2mqtt, we figured that this would provide a more future proof approach with great community support. We also agreed that it would be best to not recreate too much zwavejs functionality in domoticz to keep the plugin more manageable. zwavejs already has a great user interface so managing (including, deleting, ..) devices, creating groups and so on/forth we decided to keep within the zwavejs side but still provide bidirectional device integration to domoticz.
@moroen created a base plugin framework and did most of the heavy lifting, I helped with the connection side, adding devices and discussions on how to implement devices generically. Recently, @moroen made some more changes to 1) allow multiple instances of the plugin each with their own configured devices (so you can have sensors in one instance and plugs in another and not have to worry about the 256 device limit) and 2) to configure device types outside of the plugin to be more flexible adding devices without having to resort to python coding.
The plugin can be found at: https://github.com/moroen/ZWave-MQTT-plugin
Instructions on how to install are on that page. In essence, it's fairly simple: install and run zwavejs2mqtt (ideally in a docker container), install the plugin, restart domoticz and start adding devices.
Since I had quite a selection of devices, it took me a while before I had moved everything from OZW to zwavejs2mqtt. Keeping the shop open whilst in transition, I had to switch between OZW and zwavej2 about 3 times before I could stop OZW altogether. This is a bit of a hassle since OZW is pretty iffy about being shut down and started up again. That said, it was not a big hassle for me (despite my 150 devices in domoticz) and I have been a very happy camper since. zwavejs2mqtt has been incredibly stable, has allowed me to configure things correctly/properly for the first time in my zwave history and provides functionality that OZW just does not (like deleting dead nodes and those nodes staying dead forever, unlike OZW just recreating them and having to resort to editing zwave databases in the stick).
I am seriously pleased with it but that does not mean that there are potential bugs/issues. As always with open source, contributions are very welcome. So far at least, there have been no reported bugs for many weeks and zwavejs itself has also seen minor changes for months now underlining the stability of it. For me, the plugin has been working flawless for months, my last restart is now 25 days ago and even that was not related to zwavejs and the last plugin/zwavejs update also was months ago. Lastly, I can now update domoticz at will as it's completely independent of OZW. The only prerequisite is a working python plugin system (and there have been changes lately so be careful) and ensuring you stay within 256 individual devices per plugin instance.
For me, domoticz now truly is the integration and automation hub and that's goodness. Dzvents, python plugins and so on are great assets of domoticz. They are the key reason why I have not switched to Home Assistant. That said, if you would want to run HA next to domoticz, the beauty of zwavejs is that it allows you to do that seamlessly. I also have HA up and running (and struggle with the functionality and complexity) right next to domoticz without any issues wrt zwavejs.
Let me know if you have any questions/issues. Happy to help.
Herman
A while back, I was facing a lot of issues with OZW and didn't like the fact that it's built into domoticz (e.g. every time you want a dzvents update, you are also forced to adopt all OZW updates unless you want to build from source). I got connected to @moroen and we discussed possible approaches. Since Home Assistant already switched to zwavejs2mqtt, we figured that this would provide a more future proof approach with great community support. We also agreed that it would be best to not recreate too much zwavejs functionality in domoticz to keep the plugin more manageable. zwavejs already has a great user interface so managing (including, deleting, ..) devices, creating groups and so on/forth we decided to keep within the zwavejs side but still provide bidirectional device integration to domoticz.
@moroen created a base plugin framework and did most of the heavy lifting, I helped with the connection side, adding devices and discussions on how to implement devices generically. Recently, @moroen made some more changes to 1) allow multiple instances of the plugin each with their own configured devices (so you can have sensors in one instance and plugs in another and not have to worry about the 256 device limit) and 2) to configure device types outside of the plugin to be more flexible adding devices without having to resort to python coding.
The plugin can be found at: https://github.com/moroen/ZWave-MQTT-plugin
Instructions on how to install are on that page. In essence, it's fairly simple: install and run zwavejs2mqtt (ideally in a docker container), install the plugin, restart domoticz and start adding devices.
Since I had quite a selection of devices, it took me a while before I had moved everything from OZW to zwavejs2mqtt. Keeping the shop open whilst in transition, I had to switch between OZW and zwavej2 about 3 times before I could stop OZW altogether. This is a bit of a hassle since OZW is pretty iffy about being shut down and started up again. That said, it was not a big hassle for me (despite my 150 devices in domoticz) and I have been a very happy camper since. zwavejs2mqtt has been incredibly stable, has allowed me to configure things correctly/properly for the first time in my zwave history and provides functionality that OZW just does not (like deleting dead nodes and those nodes staying dead forever, unlike OZW just recreating them and having to resort to editing zwave databases in the stick).
I am seriously pleased with it but that does not mean that there are potential bugs/issues. As always with open source, contributions are very welcome. So far at least, there have been no reported bugs for many weeks and zwavejs itself has also seen minor changes for months now underlining the stability of it. For me, the plugin has been working flawless for months, my last restart is now 25 days ago and even that was not related to zwavejs and the last plugin/zwavejs update also was months ago. Lastly, I can now update domoticz at will as it's completely independent of OZW. The only prerequisite is a working python plugin system (and there have been changes lately so be careful) and ensuring you stay within 256 individual devices per plugin instance.
For me, domoticz now truly is the integration and automation hub and that's goodness. Dzvents, python plugins and so on are great assets of domoticz. They are the key reason why I have not switched to Home Assistant. That said, if you would want to run HA next to domoticz, the beauty of zwavejs is that it allows you to do that seamlessly. I also have HA up and running (and struggle with the functionality and complexity) right next to domoticz without any issues wrt zwavejs.
Let me know if you have any questions/issues. Happy to help.
Herman
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 :-)
DASHTICZ 🙃
RFXCOM, zwavejs2mqtt, zigbee2mqtt,
P1 meter & solar panel
Google home, Wifi Cams motion detection
Geofence iCloud, Bluetooth & Wifi ping
Harmony hub, Nest, lots more :-)
-
- Posts: 742
- Joined: Saturday 30 May 2015 22:40
- Target OS: Raspberry Pi / ODroid
- Domoticz version: beta
- Contact:
Re: zwavejs2mqtt
This is very interesting! Thanks for all the hard work!
-
- Posts: 223
- Joined: Sunday 30 March 2014 15:24
- Target OS: Linux
- Domoticz version: Beta
- Location: Waterland
- Contact:
Re: zwavejs2mqtt
Thank you for the explended explination. After my holiday I will try this.
Thx
Thx
Rpi, RFXcom, klikaan klikuit switch,thermosmart, z-wave, espeasy, smartevse
-
- Posts: 265
- Joined: Monday 05 February 2018 8:42
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 12467
- Location: Netherlands, near Haarlem
- Contact:
Re: zwavejs2mqtt
Thank you Heggink! I'm testing right now!
Domoticz 2020.1 (12230) on Raspberry Pi 3B with Raspian Buster. Besides Domoticz, Rpi is running Pi-Hole.
-
- Posts: 223
- Joined: Sunday 30 March 2014 15:24
- Target OS: Linux
- Domoticz version: Beta
- Location: Waterland
- Contact:
Re: zwavejs2mqtt
A stupid question but when I to install pip3 install -r requirements.txt I get an error pip3 command not found.
Rpi, RFXcom, klikaan klikuit switch,thermosmart, z-wave, espeasy, smartevse
- heggink
- Posts: 972
- Joined: Tuesday 08 September 2015 21:44
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 12451
- Location: NL
- Contact:
Re: zwavejs2mqtt
sudo apt-get install python3-piprron wrote:A stupid question but when I to install pip3 install -r requirements.txt I get an error pip3 command not found.
Should fix it
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 :-)
DASHTICZ 🙃
RFXCOM, zwavejs2mqtt, zigbee2mqtt,
P1 meter & solar panel
Google home, Wifi Cams motion detection
Geofence iCloud, Bluetooth & Wifi ping
Harmony hub, Nest, lots more :-)
-
- Posts: 223
- Joined: Sunday 30 March 2014 15:24
- Target OS: Linux
- Domoticz version: Beta
- Location: Waterland
- Contact:
Re: zwavejs2mqtt
Thx, that did the trick. You also need to install the MQTT broker separately?
Rpi, RFXcom, klikaan klikuit switch,thermosmart, z-wave, espeasy, smartevse
- heggink
- Posts: 972
- Joined: Tuesday 08 September 2015 21:44
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 12451
- Location: NL
- Contact:
Re: zwavejs2mqtt
Yes. sudo apt install mosquitto I think...
Sent from my SM-G980F using Tapatalk
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 :-)
DASHTICZ 🙃
RFXCOM, zwavejs2mqtt, zigbee2mqtt,
P1 meter & solar panel
Google home, Wifi Cams motion detection
Geofence iCloud, Bluetooth & Wifi ping
Harmony hub, Nest, lots more :-)
-
- Posts: 223
- Joined: Sunday 30 March 2014 15:24
- Target OS: Linux
- Domoticz version: Beta
- Location: Waterland
- Contact:
Re: zwavejs2mqtt
Ok that looks ok to me. I need to buy an extra zwave dongle because I want to test it on a spare system. I don't want to mess up my production system.
Rpi, RFXcom, klikaan klikuit switch,thermosmart, z-wave, espeasy, smartevse
- heggink
- Posts: 972
- Joined: Tuesday 08 September 2015 21:44
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 12451
- Location: NL
- Contact:
Re: zwavejs2mqtt
I did the same but only after the move haha
Sent from my SM-G980F using Tapatalk
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 :-)
DASHTICZ 🙃
RFXCOM, zwavejs2mqtt, zigbee2mqtt,
P1 meter & solar panel
Google home, Wifi Cams motion detection
Geofence iCloud, Bluetooth & Wifi ping
Harmony hub, Nest, lots more :-)
-
- Posts: 223
- Joined: Sunday 30 March 2014 15:24
- Target OS: Linux
- Domoticz version: Beta
- Location: Waterland
- Contact:
Re: zwavejs2mqtt
I don want to mess up the production before my holidays.
Rpi, RFXcom, klikaan klikuit switch,thermosmart, z-wave, espeasy, smartevse
- heggink
- Posts: 972
- Joined: Tuesday 08 September 2015 21:44
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 12451
- Location: NL
- Contact:
Re: zwavejs2mqtt
Good thinking!
Sent from my SM-G980F using Tapatalk
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 :-)
DASHTICZ 🙃
RFXCOM, zwavejs2mqtt, zigbee2mqtt,
P1 meter & solar panel
Google home, Wifi Cams motion detection
Geofence iCloud, Bluetooth & Wifi ping
Harmony hub, Nest, lots more :-)
-
- Posts: 300
- Joined: Thursday 01 November 2018 19:47
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2024.6
- Location: Portugal
- Contact:
Re: zwavejs2mqtt
This is such a good concept and thank you for all this hard work. Definitely going to try it soon. Why is it better to use a "docker" and what is a "docker" ?
Also, I have been thinking it would be a good idea to have a spare Aeotec stick; do you think I would be able to run a separate Zwave network on the same Rpi using a second Stick and slowly migrating devices one by one while keeping a fully operational system ?
Also, I have been thinking it would be a good idea to have a spare Aeotec stick; do you think I would be able to run a separate Zwave network on the same Rpi using a second Stick and slowly migrating devices one by one while keeping a fully operational system ?
Last edited by solarboy on Sunday 08 August 2021 21:11, edited 1 time in total.
Intel NUC with Ubuntu Server VM (Proxmox),mosquitto(docker),RFXtrx433E,zwavejsUI (docker),Zigbee2mqtt(docker),SMA Hub (docker),Harmony Hub plugin, Kodi plugin,Homebridge(docker)+Google Home,APC UPS,SMA Modbus,Mitsubishi MQTT, Broadlink,Dombus
- heggink
- Posts: 972
- Joined: Tuesday 08 September 2015 21:44
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 12451
- Location: NL
- Contact:
Re: zwavejs2mqtt
Docker is a type of container technology. There's others as well.
You could compare it to a virtual machine running on your system. The beauty of containers is that anyone can build a container for a specific function. That container then 'contains' everything you need to run that function. In this case, ask the prerequisites (required packages to run) are installed in the container and therefore don't conflict with packages installed outside the container.
It's like its own system but then for a specific function (eg zwavejs).
That also makes updating very easy as you only need to delete the container and recreate it with the latest image. Persistent storage (settings and such) can be stored outside the container.
There are docker containers for zwavejs, zigbee, domoticz, dashticz and so on/forth.
Sent from my SM-G980F using Tapatalk
You could compare it to a virtual machine running on your system. The beauty of containers is that anyone can build a container for a specific function. That container then 'contains' everything you need to run that function. In this case, ask the prerequisites (required packages to run) are installed in the container and therefore don't conflict with packages installed outside the container.
It's like its own system but then for a specific function (eg zwavejs).
That also makes updating very easy as you only need to delete the container and recreate it with the latest image. Persistent storage (settings and such) can be stored outside the container.
There are docker containers for zwavejs, zigbee, domoticz, dashticz and so on/forth.
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 :-)
DASHTICZ 🙃
RFXCOM, zwavejs2mqtt, zigbee2mqtt,
P1 meter & solar panel
Google home, Wifi Cams motion detection
Geofence iCloud, Bluetooth & Wifi ping
Harmony hub, Nest, lots more :-)
-
- Posts: 300
- Joined: Thursday 01 November 2018 19:47
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2024.6
- Location: Portugal
- Contact:
Re: zwavejs2mqtt
Brilliant, thanks for that, I have a lot more reading to do ! Apologies for editing my last message while you were replying.
Intel NUC with Ubuntu Server VM (Proxmox),mosquitto(docker),RFXtrx433E,zwavejsUI (docker),Zigbee2mqtt(docker),SMA Hub (docker),Harmony Hub plugin, Kodi plugin,Homebridge(docker)+Google Home,APC UPS,SMA Modbus,Mitsubishi MQTT, Broadlink,Dombus
- heggink
- Posts: 972
- Joined: Tuesday 08 September 2015 21:44
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 12451
- Location: NL
- Contact:
Re: zwavejs2mqtt
Having a spare stick is always good as it is possible to backup your current stick in case of emergency and restore the database to a new stick.solarboy wrote:This is such a good concept and thank you for all this hard work. Definitely going to try it soon. Why is it better to use a "docker" and what is a "docker" ?
Also, I have been thinking it would be a good idea to have a spare Aeotec stick; do you think I would be able to run a separate Zwave network on the same Rpi using a second Stick and slowly migrating devices one by one while keeping a fully operational system ?
Whether it makes sense to gradually move, I can't say as it very much depends on your environment and the number of devices. I had quite a number devices that were difficult to access so decided to switch big bang. Your situation may well differ.
You can definitely have 2 sticks on 1 system, one serving ozw and one for zwavejs. The only challenge is that Linux will randomly number them so you need a udev rule using the serial number of the stick to identify the 2 and assign the proper stick to each service (there are other ways but I like/prefer the udev rule approach). Let me know if you need help with that. It's quite simple.
And you would obviously need to exclude device by device from ozw and include in zwavejs but that's logical.
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 :-)
DASHTICZ 🙃
RFXCOM, zwavejs2mqtt, zigbee2mqtt,
P1 meter & solar panel
Google home, Wifi Cams motion detection
Geofence iCloud, Bluetooth & Wifi ping
Harmony hub, Nest, lots more :-)
-
- Posts: 208
- Joined: Friday 04 November 2016 12:33
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Beta
- Location: France
- Contact:
Re: zwavejs2mqtt
I confirm that mutiple zwave controllers can work at the same time in the same area.
I run 2 controllers on different Pi's. First one is a Z-Stick Gen5 used directly by Domoticz via OZW, second one, used for new devices, is a SA413 Zwave 500 USB connected to a zwavejs2mqtt container.
This configuration is running without any problem for 2 month.
Concerning backup,for the Z-Stick Gen5 controller, I used to do it in WIndows with AEOTEC backup tool.
For the SA413 I did not find a dedicated backup tool. Any idea ?
I run 2 controllers on different Pi's. First one is a Z-Stick Gen5 used directly by Domoticz via OZW, second one, used for new devices, is a SA413 Zwave 500 USB connected to a zwavejs2mqtt container.
This configuration is running without any problem for 2 month.
Concerning backup,for the Z-Stick Gen5 controller, I used to do it in WIndows with AEOTEC backup tool.
For the SA413 I did not find a dedicated backup tool. Any idea ?
-
- Posts: 265
- Joined: Monday 05 February 2018 8:42
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 12467
- Location: Netherlands, near Haarlem
- Contact:
Re: zwavejs2mqtt
I disable OpenZwave in Domoticz.
Activate ZwaveJS2MQTT plugin.
In ZwaveJS2MQTT at http://ip-adres:8091 I configured Zwave. All Zwave devices show up there. And In there I've set up MQTT broker.
Do I leave the Prefix at zwave?
I've also set a MQTT username and password here. Needed in my Mosquitto server.
Is there a possibility to enter the username and password in the plugin too so this plugin can read from the mosquitto server?
Activate ZwaveJS2MQTT plugin.
In ZwaveJS2MQTT at http://ip-adres:8091 I configured Zwave. All Zwave devices show up there. And In there I've set up MQTT broker.
Do I leave the Prefix at zwave?
I've also set a MQTT username and password here. Needed in my Mosquitto server.
Is there a possibility to enter the username and password in the plugin too so this plugin can read from the mosquitto server?
Domoticz 2020.1 (12230) on Raspberry Pi 3B with Raspian Buster. Besides Domoticz, Rpi is running Pi-Hole.
- heggink
- Posts: 972
- Joined: Tuesday 08 September 2015 21:44
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 12451
- Location: NL
- Contact:
Re: zwavejs2mqtt
The current plugin does not support a user name and password but it should not be too difficult to implement I think. Can you create a change request in GitHub (or better, do a pull request )? I know moroen is a bit busy but Lets see. I run mqtt passwordless (as does moroen apparently) so we may not be able to test.
Sent from my SM-G980F using Tapatalk
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 :-)
DASHTICZ 🙃
RFXCOM, zwavejs2mqtt, zigbee2mqtt,
P1 meter & solar panel
Google home, Wifi Cams motion detection
Geofence iCloud, Bluetooth & Wifi ping
Harmony hub, Nest, lots more :-)
-
- Posts: 265
- Joined: Monday 05 February 2018 8:42
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 12467
- Location: Netherlands, near Haarlem
- Contact:
Re: zwavejs2mqtt
Domoticz 2020.1 (12230) on Raspberry Pi 3B with Raspian Buster. Besides Domoticz, Rpi is running Pi-Hole.
Who is online
Users browsing this forum: Bing [Bot] and 0 guests