Page 1 of 2

MQTT Auto do not discover all devices

Posted: Friday 26 January 2024 13:02
by Varazir
Hello,

I have had the MQTT Auto Discovery Client Gateway with LAN running since it came out and it has been working okay.
But few weeks ago it stopped discover all devices. I can't understand why. It's not that it's all new devices.

If I check Zigbee2MQTT I can see all devices and control them just fine.

Anyone knows what I should look for ?

This is my hardware
Image

Re: MQTT Auto do not discover all devices

Posted: Friday 26 January 2024 14:52
by waltervl
Do you use different discovery topics for zigbee2MQTT and Zwavejs (default homeassistant)? And are they configured correctly in your MQTT AD gateways?
Also they should not be the same as the device topic prefix.

So in mqtt explorer you should see by default something like

Code: Select all

zigbee2mqtt
- bridge
- device1
- device2
homeassistant
- switch
   -deviceA
   -device1
-sensor
   -deviceB
   -device2
Zwave
- bridge
- Node1
- Node2
But in your case it should be something like

Code: Select all

zigbee2mqtt
- bridge
- device1
- device2
homeassistantZ2M
- switch
   -device1
-sensor
   -device2
homeassistantZWJS
- switch
   -deviceA
-sensor
   -deviceB
Zwave
- bridge
- Node1
- Node2

Re: MQTT Auto do not discover all devices

Posted: Friday 26 January 2024 14:56
by Varazir
waltervl wrote: Friday 26 January 2024 14:52 Do you use different discovery topics for zigbee2MQTT and Zwavejs (default homeassistant)? And are they configured correctly in your MQTT AD gateways?
Also they should not be the same as the device topic prefix.
Yes

Image

Image

Re: MQTT Auto do not discover all devices

Posted: Friday 26 January 2024 15:01
by Varazir
the zwave devices works great. Both has work at the same time as well.

Re: MQTT Auto do not discover all devices

Posted: Friday 26 January 2024 15:02
by Varazir
correctly in your MQTT AD gateways,

how do I check that ?

Re: MQTT Auto do not discover all devices

Posted: Friday 26 January 2024 15:04
by waltervl
What do you see in MQTT explorer?
What is the discovery prefix in Zwave-JS-UI? https://www.domoticz.com/wiki/Zwave-JS- ... r_Domoticz
It should not be zwave.

Re: MQTT Auto do not discover all devices

Posted: Friday 26 January 2024 16:23
by Varazir
hehe ya I changed to zwave when I set it up.

Image

Re: MQTT Auto do not discover all devices

Posted: Friday 26 January 2024 16:26
by waltervl
Change it eg zwaveAD both in Zwave-JS-UI and Domoticz.

Re: MQTT Auto do not discover all devices

Posted: Friday 26 January 2024 21:23
by Varazir
Changed both but didn't create any new nodes when I Checked with MQTT Explorer so I switched back and now my zwave stopped working......

Re: MQTT Auto do not discover all devices

Posted: Friday 26 January 2024 21:47
by Varazir
Hmm, I don't see any update from any of the services.

Re: MQTT Auto do not discover all devices

Posted: Friday 26 January 2024 21:49
by Varazir
I see this in the /var/log/mosquitto/mosquitto.log file

Code: Select all

1706301852: Outgoing messages are being dropped for client Domoticz-MQTT-AutoDiscoverff038b5a-afb1-4232-9ac3-14593f4debef15.

Re: MQTT Auto do not discover all devices

Posted: Monday 29 January 2024 20:32
by rutgercjonaker
I have exactley the same problem.
I have both zwavejs2mqtt and zigbe2mqtt working since a long time Domoticz.
After upgrading all my IKEA led driver device stopped working with the same error message,
"Error sending switch command, check device/hardware (idx=xxxx) !".
All other zigbee devices, IKEA switches and in wall mounted dimmers of other brands, still work.
All devices are working fine in zigbee2mqtt gui.

Re: MQTT Auto do not discover all devices

Posted: Monday 29 January 2024 23:17
by waltervl
So what have you investigated already from the tips in this topic?

Re: MQTT Auto do not discover all devices

Posted: Wednesday 31 January 2024 19:27
by rutgercjonaker
I did check in MQTT Explorer that when using zigbee2mqtt I saw that there were messages transmitted, none when using Domoticz and it was reporting the error message.
I did try and exlude my devices and inlude them again and then they worked for a short time in Domoticz but then again failed.
But now I think my problem is solved, I updated Domoticz to 2024 . 4 and now the dimmable switches are working again.

Re: MQTT Auto do not discover all devices

Posted: Wednesday 31 January 2024 19:29
by waltervl
It could be a communication issue between mqtt broker and Domoticz.

Re: MQTT Auto do not discover all devices

Posted: Wednesday 31 January 2024 21:46
by rutgercjonaker
Restarting domoticz, zigbee2mqtt and mosquitto in different orders did not solve my issue. Tried many times, many orders.
Rebooting the Raspberry pi that is hosting my domoticz setup and after that restarting the different services did not solve my problem.

Re: MQTT Auto do not discover all devices

Posted: Friday 02 February 2024 21:19
by Varazir
waltervl wrote: Wednesday 31 January 2024 19:29 It could be a communication issue between mqtt broker and Domoticz.
That is my conclusion.

Re: MQTT Auto do not discover all devices

Posted: Friday 02 February 2024 21:47
by waltervl
Check the MQTT settings in mqtt broker and Domoticz. Be sure you use the real IP instead of localhost or 127.0.0.1 when you use docker containers. See also the wiki https://www.domoticz.com/wiki/MQTT

Re: MQTT Auto do not discover all devices

Posted: Sunday 04 February 2024 20:11
by Varazir
Hmm, the HW is setup with the IP adress of my PI.

Code: Select all

2024-02-04 19:51:22.927 Status: MQTT zwavejsAD: discovered: 3D Printer (3D Printer_switch)/3D Printer (3D Printer_switch) (unique_id: zwavejs2mqtt_0xf0539677_8-37-0-currentValue)
2024-02-04 19:51:23.234 Status: MQTT zwavejsAD: discovered: 3DPrinter2 (3DPrinter2_switch)/3DPrinter2 (3DPrinter2_switch) (unique_id: zwavejs2mqtt_0xf0539677_4-37-0-currentValue)
2024-02-04 19:51:25.879 Status: MQTT zwavejsAD: discovered: 3DPrinter2 (3DPrinter2_scene_state_sceneid)/3DPrinter2 (3DPrinter2_scene_state_sceneid) (unique_id: zwavejs2mqtt_0xf0539677_4-43-0-sceneId)
2024-02-04 19:51:25.981 Status: MQTT zwavejsAD: discovered: 3DPrinter2 (3DPrinter2_scene_state_dimmingduration)/3DPrinter2 (3DPrinter2_scene_state_dimmingduration) (unique_id: zwavejs2mqtt_0xf0539677_4-43-0-dimmingDuration)
2024-02-04 19:51:26.082 Status: MQTT zwavejsAD: discovered: 3DPrinter2 (3DPrinter2_electric_kwh_value)/3DPrinter2 (3DPrinter2_electric_kwh_value) (unique_id: zwavejs2mqtt_0xf0539677_4-50-0-value-65537)
2024-02-04 19:51:26.183 Status: MQTT zwavejsAD: discovered: 3DPrinter2 (3DPrinter2_electric_w_value)/3DPrinter2 (3DPrinter2_electric_w_value) (unique_id: zwavejs2mqtt_0xf0539677_4-50-0-value-66049)
2024-02-04 19:51:26.285 Status: MQTT zwavejsAD: discovered: 3DPrinter2 (3DPrinter2_electric_v_value)/3DPrinter2 (3DPrinter2_electric_v_value) (unique_id: zwavejs2mqtt_0xf0539677_4-50-0-value-66561)
2024-02-04 19:51:26.386 Status: MQTT zwavejsAD: discovered: 3DPrinter2 (3DPrinter2_electric_a_value)/3DPrinter2 (3DPrinter2_electric_a_value) (unique_id: zwavejs2mqtt_0xf0539677_4-50-0-value-66817)
2024-02-04 19:51:26.488 Status: MQTT zwavejsAD: discovered: 3DPrinter2 (3DPrinter2_electric_v_value_0)/3DPrinter2 (3DPrinter2_electric_v_value_0) (unique_id: zwavejs2mqtt_0xf0539677_4-50-0-value-66560)
2024-02-04 19:51:26.589 Status: MQTT zwavejsAD: discovered: 3DPrinter2 (3DPrinter2_electric_a_value_0)/3DPrinter2 (3DPrinter2_electric_a_value_0) (unique_id: zwavejs2mqtt_0xf0539677_4-50-0-value-66816)
2024-02-04 19:51:26.691 Status: MQTT zwavejsAD: discovered: 3DPrinter2 (3DPrinter2_electric_w_value_0)/3DPrinter2 (3DPrinter2_electric_w_value_0) (unique_id: zwavejs2mqtt_0xf0539677_4-50-0-value-66048)
2024-02-04 20:06:00.916 Status: User:  (IP: xxxx) initiated a switch command (3/3D printer/Off)
Nothing happens

Image

If I open up the WEB GUI for zwavejsad I can control the device.

mosquitto -h | grep version
mosquitto version 1.5.7

OS Version: buster

Re: MQTT Auto do not discover all devices

Posted: Monday 05 February 2024 9:11
by waltervl
This could be related to the templates used in the state topics (eg if then). Some Integrations make those unnecessary complex and Domoticz does not support those.