Fixing Z-Wave for once and for all!

For Z-Wave related questions in Domoticz

Moderator: leecollings

User avatar
Ragdag
Posts: 149
Joined: Friday 30 March 2018 13:56
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Fixing Z-Wave for once and for all!

Post by Ragdag »

hestia wrote: Wednesday 01 December 2021 13:50 port and address are those for the mqtt broker, not the ws server
1883 and localhost for me
I thought I understood, but there is still a missing gap :D
If I run this Docker image (https://github.com/zwave-js/zwavejs2mqtt) on the RPI would I need to also install the broker separately?
So do I need anything else beside Domoticz and zwavejs2mqtt.
User avatar
heggink
Posts: 977
Joined: Tuesday 08 September 2015 21:44
Target OS: Raspberry Pi / ODroid
Domoticz version: 12451
Location: NL
Contact:

Re: Fixing Z-Wave for once and for all!

Post by heggink »

You do need a mosquitto broker indeed. Also, if you run that on the same system as the zwavejs2mqtt docker, do not use localhost in the docker container as localhost IS the docker container, not the host machine! Put in the hostname or IP for the host machine!
So both domoticz and zwavejs need the hostname/IP and port (default 1883) of the mqtt broker.
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
Ragdag
Posts: 149
Joined: Friday 30 March 2018 13:56
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Fixing Z-Wave for once and for all!

Post by Ragdag »

Thanks, figured that part out as well and created a docker-compose for Mosquitto

Code: Select all

version: '3'
services:
  mosquitto:
    container_name: mosquitto
    image: eclipse-mosquitto:latest
    restart: always
    deploy:
      resources:
        limits:
          memory: 125M
    ports:
       - "1883:1883"
       - "9001:9001"
    volumes:
      - ./config/mosquitto.conf:/mosquitto/config/mosquitto.conf
      - ./data:/mosquitto/data
      - ./log:/mosquitto/log
one for zwavejs2mqtt

Code: Select all

version: '3.7'
services:
  zwavejs2mqtt:
    container_name: zwavejs2mqtt
    image: zwavejs/zwavejs2mqtt:latest
    restart: always
    tty: true
    stop_signal: SIGINT
    environment:
      - SESSION_SECRET=mysupersecretkey
      - ZWAVEJS_EXTERNAL_CONFIG=/usr/src/app/store/.config-db
      # Uncomment if you want logs time and dates to match your timezone instead of UTC
      # Available at https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
      - TZ=Europe/Amsterdam
    networks:
      - zwave
    devices:
      # Do not use /dev/ttyUSBX serial devices, as those mappings can change over time.
      # Instead, use the /dev/serial/by-id/X serial device for your Z-Wave stick.
      - '/dev/serial/by-id/usb-0658_0200-if00:/dev/zwave'
    volumes:
      - zwave-config:/usr/src/app/store
    ports:
      - '8091:8091' # port for web interface
      - '3000:3000' # port for Z-Wave JS websocket server
networks:
  zwave:
volumes:
  zwave-config:
    name: zwave-config
Now it works with my test wall plug
Image

So far so good, will start some testing and see how it goes.
Thanks for the help and patience, it's a lot to process if this is the first time dipping your toes in Docker, MQTT and zwavejs2mqtt :oops:
User avatar
heggink
Posts: 977
Joined: Tuesday 08 September 2015 21:44
Target OS: Raspberry Pi / ODroid
Domoticz version: 12451
Location: NL
Contact:

Re: Fixing Z-Wave for once and for all!

Post by heggink »

That's understandable but once you get used to the docker approach, you don't go back!

I have been on zwavejs2mqtt and domoticz autodiscovery for nearly a month now and am very happy with the stability and flexibility.

My zwave stick is the aeotec gen5 which, on a pi4, suffers from the reboot problem (the old gen5 didn't follow the usb specs very well and the pi4 is more strict than the 3). That causes me to have to use a usb hub which then triggers the occasional disconnect. Now I can simply write a udev rule to restart the container on a connect. Works like a champ.

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
Ragdag
Posts: 149
Joined: Friday 30 March 2018 13:56
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Fixing Z-Wave for once and for all!

Post by Ragdag »

Not sure if I should continue all my questions here or if I should start a new thread.

It appears all devices from the discovered node are added automatically to the Domoticz dashboard.
Image
Is there a way to disable that?

Other thing I see is that I can switch the wall plug on and off from Domoticz but changing the state on the plug physically is not reflected in Domoticz. It stays as off.
I do see it flip over in zwavejs2mqtt
Image

Also see it flipping in Mosquitto
Image
User avatar
heggink
Posts: 977
Joined: Tuesday 08 September 2015 21:44
Target OS: Raspberry Pi / ODroid
Domoticz version: 12451
Location: NL
Contact:

Re: Fixing Z-Wave for once and for all!

Post by heggink »

There was a discussion regarding automatic addition of devices on Slack and this behaviour is by design indeed.
In terms of states not being updated correctly, this can be a bug in domoticz not handling the response message correctly. Best to go onto slack (pm me your email address and I will send you an invitation) and provide the autodiscovery topic/message as well as the response message. If you install mqtt explorer, you can easily find them.
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 :-)
Gravityz
Posts: 587
Joined: Wednesday 16 December 2015 19:13
Target OS: NAS (Synology & others)
Domoticz version: 2022.2
Location: Netherlands
Contact:

Re: Fixing Z-Wave for once and for all!

Post by Gravityz »

i am running domoticz in docker(indeed very pleased) but still use the native zwave devices.
my setup is very stable.
the only problem i have had is that power consumption devices were not stable.
as a result you could se the power go off/on while in reality the device was constant on.

i solved this by using compute on every power/energy device
the problem with zwave is that it generates a lot of devices which apparently doe the same(but in reality do not)

question regarding moving to MQTT

do you replace the old devices with the new devices once you are convinced everything is stable. that way you keep the hisory of those devices
User avatar
heggink
Posts: 977
Joined: Tuesday 08 September 2015 21:44
Target OS: Raspberry Pi / ODroid
Domoticz version: 12451
Location: NL
Contact:

Re: Fixing Z-Wave for once and for all!

Post by heggink »

It's doable but a bit tricky since you cannot have your controller connected to both ozw and zwavejs at the same time.

What you can do is to disable ozw, start jwavejs, user autodiscovery such that it creates devices. Once you have those, you can switch the ozw history over but you would need to reenable ozw for that.

As said, it's doable but takes a bit of fiddling and switching backwards and forwards...

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 :-)
solarboy
Posts: 332
Joined: Thursday 01 November 2018 19:47
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.6
Location: Portugal
Contact:

Re: Fixing Z-Wave for once and for all!

Post by solarboy »

heggink wrote: Thursday 02 December 2021 10:19 It's doable but a bit tricky since you cannot have your controller connected to both ozw and zwavejs at the same time.

What you can do is to disable ozw, start jwavejs, user autodiscovery such that it creates devices. Once you have those, you can switch the ozw history over but you would need to reenable ozw for that.

As said, it's doable but takes a bit of fiddling and switching backwards and forwards...

Sent from my SM-G980F using Tapatalk
I have managed to do this by changing the USB device for OZW to something that won't work but without disabling the OZW hardware device, this way the devices stay in the device list. Then you can start/install zwavejs2mqtt (best to name the devices there before connecting to MQTT) and let the devices populate in Domoticz, Once they are all there you can "replace" which can save a LOT of time. Some devices won't replace though, I noticed a few RGB devices are presented slightly differently but simple switches etc are fine.
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
mgugu
Posts: 218
Joined: Friday 04 November 2016 12:33
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: France
Contact:

Re: Fixing Z-Wave for once and for all!

Post by mgugu »

solarboy wrote: Friday 04 February 2022 1:16
heggink wrote: Thursday 02 December 2021 10:19 It's doable but a bit tricky since you cannot have your controller connected to both ozw and zwavejs at the same time.

What you can do is to disable ozw, start jwavejs, user autodiscovery such that it creates devices. Once you have those, you can switch the ozw history over but you would need to reenable ozw for that.

As said, it's doable but takes a bit of fiddling and switching backwards and forwards...

Sent from my SM-G980F using Tapatalk
I have managed to do this by changing the USB device for OZW to something that won't work but without disabling the OZW hardware device, this way the devices stay in the device list. Then you can start/install zwavejs2mqtt (best to name the devices there before connecting to MQTT) and let the devices populate in Domoticz, Once they are all there you can "replace" which can save a LOT of time. Some devices won't replace though, I noticed a few RGB devices are presented slightly differently but simple switches etc are fine.
Excellent idea, that can save a lot of time when switching
User avatar
heggink
Posts: 977
Joined: Tuesday 08 September 2015 21:44
Target OS: Raspberry Pi / ODroid
Domoticz version: 12451
Location: NL
Contact:

Re: Fixing Z-Wave for once and for all!

Post by heggink »

Agreed! Great suggestion! Should be in a kind of transition wiki...

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
waltervl
Posts: 5715
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: Fixing Z-Wave for once and for all!

Post by waltervl »

heggink wrote: Friday 04 February 2022 9:32 Agreed! Great suggestion! Should be in a kind of transition wiki...

Sent from my SM-G980F using Tapatalk
There already is a transition wiki: https://www.domoticz.com/wiki/ZwaveJS2M ... _OpenZwave
You are free to add this information :-)

Edit: But reading it it is already there. Disabling the OCW hardware (instead of delete) should also have the old devices visible to be replaced. After that you can remove the OZW hardware, resulting in removing all old left over devices.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
barry44
Posts: 27
Joined: Thursday 17 November 2016 21:22
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.1
Contact:

Re: Fixing Z-Wave for once and for all!

Post by barry44 »

Hello

With the new stable version, I'm planning to migrate from ozw to zwavejs2mqtt. I've about 50 zwave used devices (and 130 not used).
I've juste read the "tip and trick" to disable ozw hardware, to get the old devices visible, and then replace one by one.

It will be long, but not impossible ^^. But I'm wondering what will happen with scripts.

I have a lot of script (lua/blockly/dzVents). With the replace method, we have a new device, with a new name and a new id.
So If I do nothing more, they will be broken.

If after replacing the device, I rename the new device with the old name, will it be enough for the script to work ?
With ID, I'm sure not. The ID is still diffrent
With named device and dzEvents/lua, I think it will be ok. Is it correct ?
With named device and blockly, no idea...

Any idea of other actions to prepare ?

Thank you for your ideas
User avatar
waltervl
Posts: 5715
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: Fixing Z-Wave for once and for all!

Post by waltervl »

In stable after replace the new device will get the name and idx of the old device resulting in no changes for your scripts.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
barry44
Posts: 27
Joined: Thursday 17 November 2016 21:22
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.1
Contact:

Re: Fixing Z-Wave for once and for all!

Post by barry44 »

Ohhh, great news

Thank you :)
Olgmo
Posts: 23
Joined: Tuesday 28 June 2016 12:24
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.10717
Location: Norway
Contact:

Re: Fixing Z-Wave for once and for all!

Post by Olgmo »

Ragdag wrote: Wednesday 01 December 2021 14:38 Thanks, figured that part out as well and created a docker-compose for Mosquitto

So far so good, will start some testing and see how it goes.
Thanks for the help and patience, it's a lot to process if this is the first time dipping your toes in Docker, MQTT and zwavejs2mqtt :oops:
Thank you for your post.
I am running the same in Docker, but I could not get mosquitto:latest to work, I'm still om 1.6
Could you show you mosquitto.conf file too, please?
User avatar
waltervl
Posts: 5715
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: Fixing Z-Wave for once and for all!

Post by waltervl »

Olgmo wrote: Thursday 24 March 2022 8:54
Ragdag wrote: Wednesday 01 December 2021 14:38 Thanks, figured that part out as well and created a docker-compose for Mosquitto

So far so good, will start some testing and see how it goes.
Thanks for the help and patience, it's a lot to process if this is the first time dipping your toes in Docker, MQTT and zwavejs2mqtt :oops:
Thank you for your post.
I am running the same in Docker, but I could not get mosquitto:latest to work, I'm still om 1.6
Could you show you mosquitto.conf file too, please?
From https://www.domoticz.com/wiki/MQTT#Installing_Mosquitto
Installing Mosquitto
The recommended way to install Mosquitto is by using Docker (Docker Compose).
For this to work you need to:
- Install both Docker Engine and Docker Compose.
- Install Mosquitto using docker (compose) (https://github.com/vvatelot/mosquitto-docker-compose)


Legacy installation method:

It is highly recommended that if you are using Debian or Rasbian that you use the additional Mosquitto repositories. This will ensure you get the latest stable version of Mosquitto as determined by the project itself, rather than an outdated version via the Debian or Raspbian repositories.

Rather than re-iterating the install procedure here, the guide given a thttps://randomnerdtutorials.com/how-to-install-mosquitto-broker-on-raspberry-pi/ is simple and easy to follow, and we encourage you to give their process a shot.

Warning: from Mosquitto v2.0.x you need extra configuration, else no connection is made with Domoticz see also viewtopic.php?f=28&t=35706

To fix this edit the /etc/mosquitto/mosquitto.conf file and add:

listener 1883
allow_anonymous true
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Olgmo
Posts: 23
Joined: Tuesday 28 June 2016 12:24
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.10717
Location: Norway
Contact:

Re: Fixing Z-Wave for once and for all!

Post by Olgmo »

Thanks for your reply. I am now on lastest mosquitto 2.0 on Docker.
I had an incorrect location on config file. I was on "./mosquitto/conf" but should have been "./mosquitto/config"
My error :oops: :roll:
eSbek
Posts: 20
Joined: Saturday 20 April 2019 14:03
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Fixing Z-Wave for once and for all!

Post by eSbek »

Guys, if you disable the OZW device, to see devices again you must go to settings -> System tab -> Hardware/Devices and uncheck the "Hide Disbaled Hardware Senosors".
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest