MQTT AD - Zigbee2MQTT

For devices supporting the Auto Discovery feature. Like ZWaveJS2MQTT, Zigbee2MQTT.

Moderator: leecollings

User avatar
Emil01
Posts: 6
Joined: Tuesday 01 September 2020 20:19
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.4
Location: Netherlands
Contact:

Re: MQTT AD - Zigbee2MQTT

Post by Emil01 »

No, I'm not using Zigbee2MQTT (yet)
--
Domoticz on Raspbery Pi and DeConz Zigbee.
Sonoff wifi (Tasmota) and Sonoff Zigbee. Lot of Ikea Zigbee sensors
azonneveld
Posts: 157
Joined: Wednesday 02 October 2019 7:37
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.4
Location: Netherlands
Contact:

Re: MQTT AD - Zigbee2MQTT

Post 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" ?
rpi4 - zigbee2mqtt - roborock - espeasy - rfxcom - homewizard p1 - otgw - homebridge - surveillance station - egardia - goodwe - open weather map - wol - BBQ detection - rsync backup
Lipa
Posts: 6
Joined: Thursday 12 November 2020 12:50
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.4
Location: Slovenija
Contact:

Re: MQTT AD - Zigbee2MQTT

Post 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
azonneveld
Posts: 157
Joined: Wednesday 02 October 2019 7:37
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.4
Location: Netherlands
Contact:

Re: MQTT AD - Zigbee2MQTT

Post 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.
rpi4 - zigbee2mqtt - roborock - espeasy - rfxcom - homewizard p1 - otgw - homebridge - surveillance station - egardia - goodwe - open weather map - wol - BBQ detection - rsync backup
azonneveld
Posts: 157
Joined: Wednesday 02 October 2019 7:37
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.4
Location: Netherlands
Contact:

Re: MQTT AD - Zigbee2MQTT

Post 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
rpi4 - zigbee2mqtt - roborock - espeasy - rfxcom - homewizard p1 - otgw - homebridge - surveillance station - egardia - goodwe - open weather map - wol - BBQ detection - rsync backup
Joostrwd
Posts: 1
Joined: Friday 15 March 2024 21:26
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: MQTT AD - Zigbee2MQTT

Post by Joostrwd »

Same issue over here.

Domoticz Version: 2024.4 (build 15910)
azonneveld
Posts: 157
Joined: Wednesday 02 October 2019 7:37
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.4
Location: Netherlands
Contact:

Re: MQTT AD - Zigbee2MQTT

Post 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 ?
rpi4 - zigbee2mqtt - roborock - espeasy - rfxcom - homewizard p1 - otgw - homebridge - surveillance station - egardia - goodwe - open weather map - wol - BBQ detection - rsync backup
MartjeB
Posts: 7
Joined: Thursday 21 March 2024 9:57
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024
Contact:

Re: MQTT AD - Zigbee2MQTT

Post 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?
MartjeB
Posts: 7
Joined: Thursday 21 March 2024 9:57
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024
Contact:

Re: MQTT AD - Zigbee2MQTT

Post 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.
Attachments
Screenshot 2024-03-21 204112.jpg
Screenshot 2024-03-21 204112.jpg (114.04 KiB) Viewed 1145 times
azonneveld
Posts: 157
Joined: Wednesday 02 October 2019 7:37
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.4
Location: Netherlands
Contact:

Re: MQTT AD - Zigbee2MQTT

Post 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)
rpi4 - zigbee2mqtt - roborock - espeasy - rfxcom - homewizard p1 - otgw - homebridge - surveillance station - egardia - goodwe - open weather map - wol - BBQ detection - rsync backup
azonneveld
Posts: 157
Joined: Wednesday 02 October 2019 7:37
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.4
Location: Netherlands
Contact:

Re: MQTT AD - Zigbee2MQTT

Post 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
}
rpi4 - zigbee2mqtt - roborock - espeasy - rfxcom - homewizard p1 - otgw - homebridge - surveillance station - egardia - goodwe - open weather map - wol - BBQ detection - rsync backup
Kedi
Posts: 561
Joined: Monday 20 March 2023 14:41
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Somewhere in NL
Contact:

Re: MQTT AD - Zigbee2MQTT

Post by Kedi »

This one might be quicker

Code: Select all

mosquitto_pub -h <hostname> -p <port> -u <user> -P <password> -t 'homeassistant/#' -n -r
Logic will get you from A to B. Imagination will take you everywhere.
Kedi
Posts: 561
Joined: Monday 20 March 2023 14:41
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Somewhere in NL
Contact:

Re: MQTT AD - Zigbee2MQTT

Post 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 1048 times
Logic will get you from A to B. Imagination will take you everywhere.
azonneveld
Posts: 157
Joined: Wednesday 02 October 2019 7:37
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.4
Location: Netherlands
Contact:

Re: MQTT AD - Zigbee2MQTT

Post 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.
rpi4 - zigbee2mqtt - roborock - espeasy - rfxcom - homewizard p1 - otgw - homebridge - surveillance station - egardia - goodwe - open weather map - wol - BBQ detection - rsync backup
nonolk
Posts: 6
Joined: Thursday 08 February 2024 9:06
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: MQTT AD - Zigbee2MQTT

Post 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,
azonneveld
Posts: 157
Joined: Wednesday 02 October 2019 7:37
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.4
Location: Netherlands
Contact:

Re: MQTT AD - Zigbee2MQTT

Post 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.
rpi4 - zigbee2mqtt - roborock - espeasy - rfxcom - homewizard p1 - otgw - homebridge - surveillance station - egardia - goodwe - open weather map - wol - BBQ detection - rsync backup
nonolk
Posts: 6
Joined: Thursday 08 February 2024 9:06
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: MQTT AD - Zigbee2MQTT

Post 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,
azonneveld
Posts: 157
Joined: Wednesday 02 October 2019 7:37
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.4
Location: Netherlands
Contact:

Re: MQTT AD - Zigbee2MQTT

Post 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'.
rpi4 - zigbee2mqtt - roborock - espeasy - rfxcom - homewizard p1 - otgw - homebridge - surveillance station - egardia - goodwe - open weather map - wol - BBQ detection - rsync backup
peteralm
Posts: 31
Joined: Saturday 08 August 2015 0:12
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Oxfordshire, UK
Contact:

Re: MQTT AD - Zigbee2MQTT

Post 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.
peteralm
Posts: 31
Joined: Saturday 08 August 2015 0:12
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Oxfordshire, UK
Contact:

Re: MQTT AD - Zigbee2MQTT

Post 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
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests