Page 3 of 4

Re: MQTT AD - Zigbee2MQTT

Posted: Friday 16 February 2024 23:03
by Emil01
No, I'm not using Zigbee2MQTT (yet)

Re: MQTT AD - Zigbee2MQTT

Posted: Saturday 17 February 2024 11:37
by azonneveld
Emil01 wrote: Friday 16 February 2024 23:03 No, I'm not using Zigbee2MQTT (yet)
What type of hardware device are you using in domoticz?
Is it "MQTT Auto Discovery Client Gateway with LAN interface" ?

Re: MQTT AD - Zigbee2MQTT

Posted: Saturday 24 February 2024 13:50
by Lipa
Has anyone found anything about this problem?
I have exactly the same problem.

Domoticz Version: 2024.4
The Zigbee2MQTT settings are:

Zigbee2MQTT version 1.35.3-dev commit: 0ab7390a
Coordinator type zStack3x0
Coordinator revision 20221226
Frontend version 0.6.158
zigbee_herdsman_converters_version 18.32.0
zigbee_herdsman_version 0.33.8

Stats Total 36
By device type
End devices: 24
Router: 12

Re: MQTT AD - Zigbee2MQTT

Posted: Saturday 24 February 2024 14:15
by azonneveld
Lipa wrote: Saturday 24 February 2024 13:50 Has anyone found anything about this problem?
I have exactly the same problem.
Thanks for reporting!
Unfortunately no solution yet.

If anyone else encounters the same problem, I encourage them to report this.

Re: MQTT AD - Zigbee2MQTT

Posted: Thursday 07 March 2024 21:22
by azonneveld
As requested, I have posted the config topics on github* of the malfunctioning devices.
I also posted the configs of the devices that are working.

I grouped the config data per device, and also per type of malfunctioning.

Please note, that after a 'save description' or name change*2, all devices start working again.

*the domoticz forum didn't accept such large posts.
*2 changes made in the Zigbee2MQTT Frontend

Re: MQTT AD - Zigbee2MQTT

Posted: Friday 15 March 2024 21:27
by Joostrwd
Same issue over here.

Domoticz Version: 2024.4 (build 15910)

Re: MQTT AD - Zigbee2MQTT

Posted: Sunday 17 March 2024 17:44
by azonneveld
Joostrwd wrote: Friday 15 March 2024 21:27 Same issue over here.

Domoticz Version: 2024.4 (build 15910)
Did the problems start after upgrading from 2023.x ?

Re: MQTT AD - Zigbee2MQTT

Posted: Thursday 21 March 2024 10:44
by MartjeB
Something simular.
A fresh install to newer linux and switching the dongle gave me a lot of problems.
Finally Zigbee2MQTT frontend runs well. I can switch all devices.

In domoticz some devices won't run at all or I can only switch the device once but the new status won't update.
If I switch off the device in the frontend I can repeat switching once in domoticz.
I used to run the Zigbee2MQTT Plugin (v. 3.1.0-beta) but also tried using the autodiscover via LAN.

A fresh install at a second Pi4 with autodiscover connecting to the broker of the first Pi4, also gives problems with some devices.
Home assistant installed at the second Pi4 also MQTT AD connecting to the broker of the first Pi4,is able to switch all devices.

Even if I re-use the old SSD with linux 8 and domoticz 2024.4 at the second Pi4, some zigbee devices won't work as they should.

Could switching the zigbee coordinator stick somewhere mess-up the commands in domoticz?

Re: MQTT AD - Zigbee2MQTT

Posted: Thursday 21 March 2024 20:48
by MartjeB
Some of my devices were added for a second time. The old ID-units don't respond anymore, but the new ones do.

Re: MQTT AD - Zigbee2MQTT

Posted: Thursday 21 March 2024 22:01
by azonneveld
MartjeB wrote: Thursday 21 March 2024 20:48 Some of my devices were added for a second time. The old ID-units don't respond anymore, but the new ones do.
What happens when you restart the hardware device?
(goto hardware, select your zigbee hardware and press update, this is a shortcut to what happens after a reboot)

Re: MQTT AD - Zigbee2MQTT

Posted: Sunday 31 March 2024 22:13
by azonneveld
Found a workaround, this is working for most devices, except for battery operated devices that don't report often, like pushbuttons or motion sensors.

While domoticz is running:
stop zigbee2mqtt, clear mqtt broker, start zigbee2mqtt.

This can also be done 'automatically':

Im my case the Auto Discovery Prefix is 'homeassistant'
This is the script:

Code: Select all

#!/bin/bash
sudo systemctl stop zigbee2mqtt
mosquitto_sub -h localhost -W 1 -F '%t' -t '#' | grep '^homeassistant' | while read i ; do  mosquitto_pub -h localhost -r -t "$i" -n; done
sudo systemctl start zigbee2mqtt
exit 0
use button"clear_mqtt", to call the script:
(calling the script directly from the button gives error 512)

Code: Select all

    
    if (deviceName=='clear_mqtt') then
		 os.execute('(bash /home/pi/domoticz/scripts/clear_mqtt.sh > /dev/null)&')
    end
Also create a dzVents script to trigger the cleaning on Domoticz start (not tested):

Code: Select all

return {
	on = {
		system = {
			'start',
		},
	},
	logging = {
		level = domoticz.LOG_INFO,
		marker = 'FirstScan',
	},
	execute = function(domoticz, triggeredItem)
	    local mqttrestart = domoticz.devices('clear_mqtt')
		mqttrestart.switchON()
	end
}

Re: MQTT AD - Zigbee2MQTT

Posted: Monday 01 April 2024 10:31
by Kedi
This one might be quicker

Code: Select all

mosquitto_pub -h <hostname> -p <port> -u <user> -P <password> -t 'homeassistant/#' -n -r

Re: MQTT AD - Zigbee2MQTT

Posted: Monday 01 April 2024 13:02
by Kedi
MartjeB wrote: Thursday 21 March 2024 20:48 Some of my devices were added for a second time. The old ID-units don't respond anymore, but the new ones do.
Beter delete all the zigbee device in Domoticz and start over again, because my ID's look different.
01.04.2024_13.01.28_REC.png
01.04.2024_13.01.28_REC.png (11.44 KiB) Viewed 1479 times

Re: MQTT AD - Zigbee2MQTT

Posted: Sunday 07 April 2024 20:49
by azonneveld
The problem is 'solved'.

I took a clean image, and reinstalled everything.
Now MQTT is recovering after a restart.
Battery operated devices also recover, but only after being actuated, first signal/command/data is lost.

I'm running Bullseye now, because some plugins didn't work on Bookworm. (32 bit)
The MQTT version is now 2.0.11 instead of 1.5.7.

The issue still dazzles me, but I'm not able to do any further testing.

Thanks for the support and your efforts to help me out.

In case you are using DD for backup, this is not working well on Bullseye (system hangs during the process).
I switched to rsync for backup.

Re: MQTT AD - Zigbee2MQTT

Posted: Wednesday 10 April 2024 15:54
by nonolk
@azonneveld,

Could you please eleaborate on what you mean by i took a clean image ?

As I'm facin the same issue and some others too, it could also help us to find a solution.

Best regards,

Re: MQTT AD - Zigbee2MQTT

Posted: Wednesday 10 April 2024 16:48
by azonneveld
nonolk wrote: Wednesday 10 April 2024 15:54 Could you please eleaborate on what you mean by i took a clean image ?
format drive, start from scratch.

Re: MQTT AD - Zigbee2MQTT

Posted: Thursday 11 April 2024 13:57
by nonolk
@azonneveld,

So you mean everythings, Domotics and Zigbee2mqtt. I though you were speaking only about the zigbee2mqtt container.

Iwill have to find another solution than this.

best regards,

Re: MQTT AD - Zigbee2MQTT

Posted: Thursday 11 April 2024 14:12
by azonneveld
nonolk wrote: Thursday 11 April 2024 13:57 So you mean everythings, Domotics and Zigbee2mqtt.
Yes, everything.
But using the old installation(data) as a backup, it only took me a couple of hours, which is less time than spend on 'debugging'.

Re: MQTT AD - Zigbee2MQTT

Posted: Friday 12 April 2024 12:50
by peteralm
nonolk wrote: Friday 09 February 2024 13:26
azonneveld wrote: Friday 09 February 2024 11:40 Is this the same in your experience?
yes exactly, starting from the 2024.01 version.
Yup me too.

Re: MQTT AD - Zigbee2MQTT

Posted: Saturday 20 April 2024 12:07
by peteralm
I will investigate further today, but over the last couple of days I have lost pretty much all ability to communicate with zigbee things.
All it takes is to go to the device in zigbee2mqtt-ui and click settings and then submit (i.e. not change anything) and then domoticz discovers them and then everything works again. I can't do this every couple of days...
I can't see if this is domoticz forgetting or zigbee2mqtt forgetting... But surely once something is discovered it should stay discovered?

Peter