Page 1 of 2
Get ZWave devices visible in Domoticz (Zwave JS UI / MQTT)
Posted: Thursday 04 January 2024 16:46
by studiocascade
Since the new update, OZW has stopped (it was announced, but that message didn't receive me until i updated)
Now i started to install Zwave JS UI and Mosquitto on my Raspberry Pi, exactly followed the (somewhat briefly) instructions on the wiki:
https://www.domoticz.com/wiki/Zwave-JS-UI
Installation seems to be OK.
In Z-Wave JS UI i can see all my devices.
In Domoticz i added the new hardware "MQTT Auto Discovery Client Gateway with LAN interface"
At the first place, the log showed all my devices too, but since i didn't have the switch "Accept new hardware" turned on, nothing was added.
So i turned it on and was hoping to see my devices appear after a while, but nothing happened.
I removed the hardware and tried adding it again. Restarted my Raspberry Pi, even did the "make up" command a few times.
But i can't get my devices visible and i also don't know how to troubleshoot it.
Can someone help me getting it working?
Re: Get ZWave devices visible in Domoticz (Zwave JS UI / MQTT)
Posted: Thursday 04 January 2024 17:07
by solarboy
You need to make sure that you have the Auto Discovery prefix the same in Domoticz ( in "MQTT Auto Discovery Client Gateway with LAN interface" settings under "Auto discovery prefix") and also in Zwave-JS-UI under Settings>Home Assistant.Discovery prefix. People generally put "homeassistant" as this discovery topic.
Re: Get ZWave devices visible in Domoticz (Zwave JS UI / MQTT)
Posted: Thursday 04 January 2024 17:36
by studiocascade
Thanks a lot for your reply!
I had them both named 'zwave' (without quotes of course)
now renamed to 'domoticz', both in MQTT Auto Discovery settings and in JS-UI
But still no devices are being found or added.
The logs only says:
Code: Select all
Status: ZWave: Connecting to localhost:1883
Status: ZWave: connected to: localhost:1883
When i open MQTT Explorer on my 'regular' computer and i browse to it, i can also see the names 'zwave' and 'homeassistant' appear.
Under 'zwave' i can see my nodes, so that part seems to work
Re: Get ZWave devices visible in Domoticz (Zwave JS UI / MQTT)
Posted: Thursday 04 January 2024 17:42
by akamming
I had the same issue. In my case the cause was that I in zwave js ui I used 127.0.0.1 for the op adres of the Mqtt server
This however should be the actual op adres of the Mqtt server
Re: Get ZWave devices visible in Domoticz (Zwave JS UI / MQTT)
Posted: Thursday 04 January 2024 17:51
by studiocascade
Yes! That did the trick.
I now see all the devices again. Thank you so much
Re: Get ZWave devices visible in Domoticz (Zwave JS UI / MQTT)
Posted: Thursday 04 January 2024 20:54
by studiocascade
One final question.
After i reboot my Domoticz, the zWave-devices won't work anymore.
I have to SSH to my Domoticz, go to /opt/mosquitto and then run make up
Is there a way do to this automatically so it will start anytime i am rebooting my Domoticz system?
Re: Get ZWave devices visible in Domoticz (Zwave JS UI / MQTT)
Posted: Thursday 04 January 2024 21:36
by capitalT
studiocascade wrote: ↑Thursday 04 January 2024 20:54
One final question.
After i reboot my Domoticz, the zWave-devices won't work anymore.
I have to SSH to my Domoticz, go to /opt/mosquitto and then run
make up
Is there a way do to this automatically so it will start anytime i am rebooting my Domoticz system?
You used the docker compose repo?
I added this to docker-compose.override.yml:
Re: Get ZWave devices visible in Domoticz (Zwave JS UI / MQTT)
Posted: Thursday 04 January 2024 22:51
by studiocascade
Thanks! That did the trick
Re: Get ZWave devices visible in Domoticz (Zwave JS UI / MQTT)
Posted: Wednesday 12 June 2024 9:29
by tlfriend1
Re: Get ZWave devices visible in Domoticz (Zwave JS UI / MQTT)
Posted: Thursday 21 November 2024 21:02
by donverweij
tlfriend1 wrote: ↑Wednesday 12 June 2024 9:29
solarboy wrote: ↑Thursday 04 January 2024 17:07
You need to make sure that you have the Auto Discovery prefix the same in Domoticz ( in "MQTT Auto Discovery Client Gateway with LAN interface" settings under "Auto discovery prefix") and also in Zwave-JS-UI under Settings>Home Assistant.Discovery prefix. People generally put "homeassistant" as this discovery topic.
Can you please explain this in more detail? I am not sure what you mean and I have this issue.
My devices are all visible in the z-wave js ui but not on the Domoticz ui

- Z-Wave JS UI setting prefix 241121 001.jpg (98.64 KiB) Viewed 4301 times
I think In Z-Wave JS UI within settings in Section Home Assistant you find MQTT Discovery. Here is a default setting Discovery setting: homeassistant

- Domoticz Hardware MQTT Auto Discovery Client Gateway with LAN setting prefix 241121 001.jpg (115.56 KiB) Viewed 4301 times
This is the same as in Domoticz within Hardware the default setting for Auto Discovery Prefix: homeassistant
I have the same settings. And in Z-Wave JS UI I see my devices, but they do not show in Devices within Domoticz. As if Domoticz does not communicate with the mosquitto broker. I can not find what I have done wrong, as everything seems to work, but not together.
Any suggestions are welcome.
I am setting up Domoticz 2024.7 in Docker on a Raspberry Pi 4B. I want to migrate an older version of Domotic on Synology to this Raspberry.
Re: Get ZWave devices visible in Domoticz (Zwave JS UI / MQTT)
Posted: Thursday 21 November 2024 22:55
by solarboy
"Remote Address" needs to be the same as the IP of mosquito, and if either domoticz or zwavejsui are in dockers there are more things to confirm. If nothing is in a docker and mosquitto is on the same device you can put "localhost" there.
Re: Get ZWave devices visible in Domoticz (Zwave JS UI / MQTT)
Posted: Thursday 21 November 2024 22:58
by solarboy
Make sure you have "network_mode: host" in your docker-compose.yml or map ports (something I am not familiar with). You also need zwavejsui to have the correct IP settings for mosquitto.
Re: Get ZWave devices visible in Domoticz (Zwave JS UI / MQTT)
Posted: Thursday 21 November 2024 23:06
by solarboy
Code: Select all
version: "3"
services:
mosquitto:
container_name: mosquitto
image: eclipse-mosquitto
volumes:
- ./:/mosquitto/:rw
ports:
- 1883:1883
- 9001:9001
restart: always
I just checked my settings in zwavejsUI and I have "host.docker.internal" as my IP address for mosquito which is also in a docker container. In mosquitto. My mosquitto docker-compose.yaml is
Re: Get ZWave devices visible in Domoticz (Zwave JS UI / MQTT)
Posted: Thursday 21 November 2024 23:08
by solarboy
This is the docker-compose for zwavejsUI
Code: Select all
version: '3.7'
services:
zwave-js-ui:
container_name: zwavejsUI
hostname: zwavejsUI
image: zwavejs/zwave-js-ui: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 instea$
# Available at https://en.wikipedia.org/wiki/List_of_tz_database_time_zon$
- TZ=Europe/Lisbon
networks:
- zwave
extra_hosts:
- "host.docker.internal:host-gateway"
devices:
# Do not use /dev/ttyUSBX serial devices, as those mappings can change ov$
# Instead, use the /dev/serial/by-id/X serial device for your Z-Wave stic$
- '/dev/serial/by-id/usb-0658_0200-if00'
#- '/dev/serial/by-id/insert_stick_reference_here:/dev/zwave'
volumes:
#- zwave-config:/usr/src/app/store
- ./store:/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:
Re: Get ZWave devices visible in Domoticz (Zwave JS UI / MQTT)
Posted: Saturday 23 November 2024 12:51
by donverweij
solarboy wrote: ↑Thursday 21 November 2024 22:55
"Remote Address" needs to be the same as the IP of mosquito, and if either domoticz or zwavejsui are in dockers there are more things to confirm. If nothing is in a docker and mosquitto is on the same device you can put "localhost" there.
Thanks for all your suggestions. I checked the suggestions.
I have Docker Engine and Compose running om my Raspberry Pi 4B.
I gave my Pi a fixed ip address within my network: eg 192.168.10.112
I installed Domoticz 2024.7 in Docker. Domoticz runs without a problem on this fixed ip address 192.168.10.112:8080.
I then installed the mosquitto broker in Docker. Mosquitto has the same ip address 192.168.10.112:1883.
I then installed ZWave-JS-UI client in Docker. ZWave-JS-IU is running on the same fixed ip address 192.168.10.112:8091. ZWave-JS-IU is connected with the mosquitto broker on ip adress 192.168.10.112:1883.
I also installed MQTT-explorer in Docker. MQTT-explorer is running 192.168.10.112:4000. Through MQTT-explorer I can connect with the mosquitto broker on 192.168.10.112:1883.
In the ZWave-JS-IU I see the Devices I included.
In MQTT-explorer I can connect to the mosquitto broker with the right user name and password. These are the same I provided in Domoticz for Hardware MQTT Auto Discovery Client Gateway with LAN. So no authorization issue I would say.
In Domoticz I reinstalled MQTT Auto Discovery Client Gateway with LAN. With Remote Address: 192.168.10.112 and Port: 1883
Still no devices to be shown in Domoticz.
I changed the ZWave-JS-IU docker-compose.yml
adding
extra_hosts:
- "host.docker.internal:host-gateway"
I rebuild ZWave-JS-IU and restarted Domoticz, but no devices shown in Domoticz.
Do I need to change the settings in docker-compose.yml
# - "/dev/serial/by-id/usb-0658_0200-if00-port0:/dev/ttyACM0"
into
- '/dev/serial/by-id/usb-0658_0200-if00:/dev/zwave'
or uncomment
# - "/dev/serial/by-id/usb-0658_0200-if00-port0:/dev/ttyACM0"
Re: Get ZWave devices visible in Domoticz (Zwave JS UI / MQTT)
Posted: Saturday 23 November 2024 20:14
by solarboy
If you already have your devices in zwaveJSUI then your USB device must be correctly set.
When you connect with MQTT explorer, can you see you devices populated there ? If not make sure the mosquitto docker container has port 1883 (and 9001) mapped with the line
If so then it must be the connection between Domoticz and mosquitto. Double check your Discovery topic is the same in ZwaveJSUI and in Domoticz. I don't run Domoticz in a docker but you need to make sure it has access to port 1883, probably by altering the docker-compose.yml file for Domoticz and adding
Re: Get ZWave devices visible in Domoticz (Zwave JS UI / MQTT)
Posted: Sunday 24 November 2024 10:26
by donverweij
solarboy wrote: ↑Saturday 23 November 2024 20:14
If you already have your devices in zwaveJSUI then your USB device must be correctly set.
When you connect with MQTT explorer, can you see you devices populated there ? If not make sure the mosquitto docker container has port 1883 (and 9001) mapped with the line
If so then it must be the connection between Domoticz and mosquitto. Double check your Discovery topic is the same in ZwaveJSUI and in Domoticz. I don't run Domoticz in a docker but you need to make sure it has access to port 1883, probably by altering the docker-compose.yml file for Domoticz and adding
Thanks,
I have the following mosquitto docker-compose.yaml in which both ports 1883 and 9001 are registered
Code: Select all
services:
mosquitto:
restart: unless-stopped
build:
context: .
volumes:
- type: bind
source: ./config/
target: /mosquitto/config/
- type: bind
source: ./log/
target: /mosquitto/log/
- type: volume
source: data
target: /mosquitto/data/
ports:
- target: 1883
published: 1883
protocol: tcp
mode: host
- target: 9001
published: 9001
protocol: tcp
mode: host
volumes:
data:
name: "mqtt-broker-data"
I will try bychanging the domoticz docker-compose.yml
Code: Select all
- "/dev/serial/by-id/usb-0658_0200-if00-port1883:/dev/ttyACM0"
Re: Get ZWave devices visible in Domoticz (Zwave JS UI / MQTT)
Posted: Sunday 24 November 2024 11:58
by solarboy
When you connect to mosquitto with Mqtt explorer, can you see your devices there ?
Re: Get ZWave devices visible in Domoticz (Zwave JS UI / MQTT)
Posted: Sunday 24 November 2024 20:44
by donverweij
solarboy wrote: ↑Sunday 24 November 2024 11:58
When you connect to mosquitto with Mqtt explorer, can you see your devices there ?
No they do not. I'm am connected to the mosquitto broker, but I do not see any devices.
Re: Get ZWave devices visible in Domoticz (Zwave JS UI / MQTT)
Posted: Monday 25 November 2024 18:53
by solarboy
So I would check that you have the correct port, name and username for mosquitto in zwavejsUI and that you have made those ports available to both docker containers. I use "host.docker.internal" as the host url in zwavejsUI and the prefix "zwave" (not the discovery topic) so all my devices appear under the subheading "zwave" when I view mosquitto with MQTT Explorer. I don't use any authorisation so I have "auth" turned off. Perhaps you could try running your mosquitto without requiring authentication until you resolve the problem.