MQTT AD - Zigbee2MQTT

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

Moderator: leecollings

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

MQTT AD - Zigbee2MQTT

Post by azonneveld »

[edit]
I've made a short video, demonstrating the following steps:

1. Everything is running fine
2. MQTT AD hardware is restarted
3. Device cannot be controlled (even if I waited a longer time)
4. Name of device is altered in zigbee2mqtt gui (or another trigger, updating the description also works)
5. Device is working again

Here is the video: [offline]

[/edit]

Zigbee 1.33.2 + MQTT 1.5.7* + Domo 2023.2 worked fine.
Zigbee 1.33.2 + MQTT 1.5.7* + Domo 2024.x not fine


*mosquitto version 1.5.7 mosquitto is an MQTT v3.1.1 broker.

I have something weird going on.

After a (hot) reboot of the RPI most of the MQTT AD devices are not working anymore.
When I try to switch fi a lightbulb, domoticz gives the error: "zigbee2MQTT: Switch not found!?"

In the Zigbee2MQTT frontend, the device is present and can be controlled.

Only after renaming the devices, using the zigbee2mqtt frontend (just adding a 1 after its friendly name), it starts working in Domo again.

I don't know where to start to debug this problem.

Suggestions are very welcome!

(raspberry pi, domo 2024.4, zigbee2mqtt 133.2-135.1)
Last edited by azonneveld on Thursday 18 April 2024 21:47, edited 4 times in total.
rpi4 - zigbee2mqtt - roborock - espeasy - rfxcom - homewizard p1 - otgw - homebridge - surveillance station - egardia - goodwe - open weather map - wol - BBQ detection - rsync backup
solarboy
Posts: 320
Joined: Thursday 01 November 2018 19:47
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.6
Location: Portugal
Contact:

Re: MQTT AD - Zigbee2MQTT

Post by solarboy »

You could try stopping Domoticz and clearing all data in your MQTT broker and rebooting.
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
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 »

solarboy wrote: Monday 05 February 2024 23:46 You could try stopping Domoticz and clearing all data in your MQTT broker and rebooting.
I have 4 main topics in MQTT:
  • zigbee2mqtt
    domoticz
    zigbee
    $SYS
Zigbee is used in Domo MQTT AD.

Do I clean them all or only 'zigbee' ? (or mabybe another one)
rpi4 - zigbee2mqtt - roborock - espeasy - rfxcom - homewizard p1 - otgw - homebridge - surveillance station - egardia - goodwe - open weather map - wol - BBQ detection - rsync backup
solarboy
Posts: 320
Joined: Thursday 01 November 2018 19:47
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.6
Location: Portugal
Contact:

Re: MQTT AD - Zigbee2MQTT

Post by solarboy »

If you clean them all and reboot they should be recreated automatically and this may solve your problem. May be to do with message retention.
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
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 »

solarboy wrote: Tuesday 06 February 2024 10:16 If you clean them all and reboot they should be recreated automatically and this may solve your problem. May be to do with message retention.
Cleaned broker, and rebooted.
After reboot, no 'domoticz' topic was recreated, the rest returned as expected.

Almost everything works fine: switched, temperature sensors, push buttons, etc.

Except from dimmable devices (light bulbs), those devices start working after changing the friendly name in de z2m frontend.
Domoticz only gives an error when trying to switch on/off, when changing the dim-value, no error is given.
Also the powermeasurement from Tuya TS0121 stops working. Same applies for this device, renaming makes it work again

Suggestions are very welcome


update:
It seems the non working devices are added in the 'zigbee2mqtt\bridge' topic after renaming.

update2:
After renaming the devices everything works fine, until restarting domoticz using: 'sudo service domoticz restart'

update3:
When I stop Z2M and Domoticz. Clear the broker and then start domo again, and after a while I start Z2M, it all works fine!

Is this any helpful?
rpi4 - zigbee2mqtt - roborock - espeasy - rfxcom - homewizard p1 - otgw - homebridge - surveillance station - egardia - goodwe - open weather map - wol - BBQ detection - rsync backup
solarboy
Posts: 320
Joined: Thursday 01 November 2018 19:47
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.6
Location: Portugal
Contact:

Re: MQTT AD - Zigbee2MQTT

Post by solarboy »

Glad you can get it working. It's a bit out of my league but I'd be sniffing around "retain" settings and "Auto Discovery".
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
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 »

I tried with and without retain on the affected devices, it seems to make no difference.

The best way so far seems to stop all, remove the AD topic, start Domo, followed by Zigbee2MQTT.
But this is not a very nice solution, since it requires manual actions after every reboot/restart/update/etc, or just a restart of the hardware device

After restarting the hardware device:

2024-02-06 19:36:58.711 Error: zigbee2MQTT: Switch not found!? (0x000b3cfffefad97e_light_zigbee2mqtt/Lamp Twee)

After changing friendly name in the Zigbee2MQTT GUI:

2024-02-06 19:37:49.693 Status: zigbee2MQTT: discovered: Lamp Twee_dimmer/Lamp Twee_dimmer (unique_id: 0x000b3cfffefad97e_light_zigbee2mqtt)
rpi4 - zigbee2mqtt - roborock - espeasy - rfxcom - homewizard p1 - otgw - homebridge - surveillance station - egardia - goodwe - open weather map - wol - BBQ detection - rsync backup
User avatar
waltervl
Posts: 5384
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: MQTT AD - Zigbee2MQTT

Post by waltervl »

It seems your renumbering in the past mixes up the discovery.
What if you try the following:
1 be sure you have retained/cached discovery topics on in Zigbee2MQTT settings.
2. Delete the problem Zigbee2MQTT devices from Domoticz, make sure you delete them all from from the same ID eg 0x000b3cfffefad97e
3. Rediscover the devices by restarting the mqtt ad gateway in Domoticz menu setup-hardware (click on update) and trigger the switches in Zigbee2MQTT.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
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 »

I have found some cache/retain options on device level, but not on mqtt topic level.
Where can I find/check those settings on topic level?

Image
Attachments
2024-02-06 20_55_09-Clipboard.png
2024-02-06 20_55_09-Clipboard.png (21.88 KiB) Viewed 2606 times
rpi4 - zigbee2mqtt - roborock - espeasy - rfxcom - homewizard p1 - otgw - homebridge - surveillance station - egardia - goodwe - open weather map - wol - BBQ detection - rsync backup
User avatar
waltervl
Posts: 5384
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: MQTT AD - Zigbee2MQTT

Post by waltervl »

In the Zigbee2MQTT manual there are retain/cache options mentioned in the MQTT section
https://www.zigbee2mqtt.io/guide/config ... /mqtt.html
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
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 »

waltervl wrote: Tuesday 06 February 2024 20:26 It seems your renumbering in the past mixes up the discovery.
What if you try the following:
1 be sure you have retained/cached discovery topics on in Zigbee2MQTT settings.
2. Delete the problem Zigbee2MQTT devices from Domoticz, make sure you delete them all from from the same ID eg 0x000b3cfffefad97e
3. Rediscover the devices by restarting the mqtt ad gateway in Domoticz menu setup-hardware (click on update) and trigger the switches in Zigbee2MQTT.
Tried this with one of the problematic devices.
After restarting the mqtt ad the device was not automatically added.
I had to stop zigbee2mqtt, stop mqtt gateway hardware, clear the AD topic, then start zigbee2mqtt, followed by the gateway hardware.
Then the device got added automatically again.
To test the fresh device, I restarted the mqtt gateway hardware. Again, the device was not working.

Getting a bit desperate.
rpi4 - zigbee2mqtt - roborock - espeasy - rfxcom - homewizard p1 - otgw - homebridge - surveillance station - egardia - goodwe - open weather map - wol - BBQ detection - rsync backup
User avatar
waltervl
Posts: 5384
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: MQTT AD - Zigbee2MQTT

Post by waltervl »

There seems to be something wrong in your environment, some setting is incorrect. It is impossible for us to tell what you did wrong. Be sure the normal Zigbee2MQTT topic prefix (default zigbee2mqtt) is different than the discovery prefix (default homeassistant)
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
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 »

Yes, I also think something is wrong, but what is the million dollar question.

The AD topic is different from the zigbee2mqtt topic:
Capture.PNG
Capture.PNG (9.27 KiB) Viewed 2484 times
rpi4 - zigbee2mqtt - roborock - espeasy - rfxcom - homewizard p1 - otgw - homebridge - surveillance station - egardia - goodwe - open weather map - wol - BBQ detection - rsync backup
Kedi
Posts: 563
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 »

Why change the defaults?
The defaults are: zigbee2mqtt (for status and activation of swithes and such) and homeassistant (for config of auto-discovery)
I suppose you changed homeassistant to zigbeeAD? In Domoticz this should be the 'Auto Discovery Prefix'
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 »

Kedi wrote: Thursday 08 February 2024 14:16 Why change the defaults?
The defaults are: zigbee2mqtt (for status and activation of swithes and such) and homeassistant (for config of auto-discovery)
I suppose you changed homeassistant to zigbeeAD? In Domoticz this should be the 'Auto Discovery Prefix'
Correct, I have added ZigbeeAD as the prefix in the hardware
2024-02-08 16_36_29-Hardware - DZ — Mozilla Firefox.jpg
2024-02-08 16_36_29-Hardware - DZ — Mozilla Firefox.jpg (34.15 KiB) Viewed 2448 times
rpi4 - zigbee2mqtt - roborock - espeasy - rfxcom - homewizard p1 - otgw - homebridge - surveillance station - egardia - goodwe - open weather map - wol - BBQ detection - rsync backup
Kedi
Posts: 563
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 »

azonneveld wrote: Tuesday 06 February 2024 9:20
solarboy wrote: Monday 05 February 2024 23:46 You could try stopping Domoticz and clearing all data in your MQTT broker and rebooting.
I have 4 main topics in MQTT:
  • zigbee2mqtt
    domoticz
    zigbee
    $SYS
Zigbee is used in Domo MQTT AD.

Do I clean them all or only 'zigbee' ? (or mabybe another one)
Here you stated that the topic was zigbee. Did you change the topic in zigbee2mqtt?
The domoticz gives the error: "zigbee2MQTT: Switch not found!? as you stated above might come from the fact that the ID of the device changed. Is it possible to start over again? Leave the discovery topic default ( homeassistant ), clean the topics from the mosquitto server and then delete the MQTT-AD hardware and start over the discovery with new hardware (homeassistant).
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 »

Kedi wrote: Thursday 08 February 2024 18:44 Here you stated that the topic was zigbee. Did you change the topic in zigbee2mqtt?
The domoticz gives the error: "zigbee2MQTT: Switch not found!? as you stated above might come from the fact that the ID of the device changed. Is it possible to start over again? Leave the discovery topic default ( homeassistant ), clean the topics from the mosquitto server and then delete the MQTT-AD hardware and start over the discovery with new hardware (homeassistant).
Yes, I changed the zigbee to zigbeeAD, but that changed nothing.
As per your advices, i changed to the defaults, the results are the same.

Somehow not everything is read correctly from the AD topic.
After I press the submit button in the zigbee2mqtt gui (device>settings>submit), some data seems to be refreshed in the AD topic, and then read correctly.
Next days I will try to isolate one of the devices that often fails (by removing them from the zigbee2mqtt database, this prevents devices from being published).

Image

This is the content of the AD topic for one of the faulty devices (data fetched from the zigbee2mqtt log file).
When it was named 'Ikea_Drukker_031' it was not working, after renaming, it worked:

Code: Select all

info  2024-02-08 21:46:35: MQTT publish: topic 'homeassistant/sensor/0x0c4314fffe4cbf9c/battery/config'	 payload '{"availability":[{"topic":"zigbee2mqtt/bridge/state"}	{"topic":"zigbee2mqtt/Ikea_Drukker_031/availability"}]	availability_mode:"all"	device:{"identifiers":["zigbee2mqtt_0x0c4314fffe4cbf9c"]	manufacturer:"IKEA"	model:"TRADFRI ON/OFF switch (E1743)"	name:"Ikea_Drukker_031"	sw_version:"2.3.079"}	device_class:"battery"	enabled_by_default:true	entity_category:"diagnostic"	json_attributes_topic:"zigbee2mqtt/Ikea_Drukker_031"	object_id:"ikea_drukker_031_battery"	origin:{"name":"Zigbee2MQTT"	sw:"1.33.2"	url:"https://www.zigbee2mqtt.io"}	state_class:"measurement"	state_topic:"zigbee2mqtt/Ikea_Drukker_031"	unique_id:"0x0c4314fffe4cbf9c_battery_zigbee2mqtt"	unit_of_measurement:"%"	value_template:"{{ value_json.battery }}"}'			
info  2024-02-08 21:46:35: MQTT publish: topic 'homeassistant/sensor/0x0c4314fffe4cbf9c/action/config'	 payload '{"availability":[{"topic":"zigbee2mqtt/bridge/state"}	{"topic":"zigbee2mqtt/Ikea_Drukker_031/availability"}]	availability_mode:"all"	device:{"identifiers":["zigbee2mqtt_0x0c4314fffe4cbf9c"]	manufacturer:"IKEA"	model:"TRADFRI ON/OFF switch (E1743)"	name:"Ikea_Drukker_031"	sw_version:"2.3.079"}	enabled_by_default:true	icon:"mdi:gesture-double-tap"	json_attributes_topic:"zigbee2mqtt/Ikea_Drukker_031"	name:"Action"	object_id:"ikea_drukker_031_action"	origin:{"name":"Zigbee2MQTT"	sw:"1.33.2"	url:"https://www.zigbee2mqtt.io"}	state_topic:"zigbee2mqtt/Ikea_Drukker_031"	unique_id:"0x0c4314fffe4cbf9c_action_zigbee2mqtt"	value_template:"{{ value_json.action }}"}'					
info  2024-02-08 21:46:35: MQTT publish: topic 'homeassistant/sensor/0x0c4314fffe4cbf9c/linkquality/config'	 payload '{"availability":[{"topic":"zigbee2mqtt/bridge/state"}	{"topic":"zigbee2mqtt/Ikea_Drukker_031/availability"}]	availability_mode:"all"	device:{"identifiers":["zigbee2mqtt_0x0c4314fffe4cbf9c"]	manufacturer:"IKEA"	model:"TRADFRI ON/OFF switch (E1743)"	name:"Ikea_Drukker_031"	sw_version:"2.3.079"}	enabled_by_default:false	entity_category:"diagnostic"	icon:"mdi:signal"	json_attributes_topic:"zigbee2mqtt/Ikea_Drukker_031"	name:"Linkquality"	object_id:"ikea_drukker_031_linkquality"	origin:{"name":"Zigbee2MQTT"	sw:"1.33.2"	url:"https://www.zigbee2mqtt.io"}	state_class:"measurement"	state_topic:"zigbee2mqtt/Ikea_Drukker_031"	unique_id:"0x0c4314fffe4cbf9c_linkquality_zigbee2mqtt"	unit_of_measurement:"lqi"	value_template:"{{ value_json.linkquality }}"}'		
info  2024-02-08 21:46:35: MQTT publish: topic 'homeassistant/sensor/0x0c4314fffe4cbf9c/click/config'	 payload '{"availability":[{"topic":"zigbee2mqtt/bridge/state"}	{"topic":"zigbee2mqtt/Ikea_Drukker_031/availability"}]	availability_mode:"all"	device:{"identifiers":["zigbee2mqtt_0x0c4314fffe4cbf9c"]	manufacturer:"IKEA"	model:"TRADFRI ON/OFF switch (E1743)"	name:"Ikea_Drukker_031"	sw_version:"2.3.079"}	icon:"mdi:toggle-switch"	json_attributes_topic:"zigbee2mqtt/Ikea_Drukker_031"	name:"Click"	object_id:"ikea_drukker_031_click"	origin:{"name":"Zigbee2MQTT"	sw:"1.33.2"	url:"https://www.zigbee2mqtt.io"}	state_topic:"zigbee2mqtt/Ikea_Drukker_031"	unique_id:"0x0c4314fffe4cbf9c_click_zigbee2mqtt"	value_template:"{{ value_json.click }}"}'						
info  2024-02-08 21:46:35: MQTT publish: topic 'homeassistant/sensor/0x0c4314fffe4cbf9c/update_state/config'	 payload '{"availability":[{"topic":"zigbee2mqtt/bridge/state"}	{"topic":"zigbee2mqtt/Ikea_Drukker_031/availability"}]	availability_mode:"all"	device:{"identifiers":["zigbee2mqtt_0x0c4314fffe4cbf9c"]	manufacturer:"IKEA"	model:"TRADFRI ON/OFF switch (E1743)"	name:"Ikea_Drukker_031"	sw_version:"2.3.079"}	enabled_by_default:false	entity_category:"diagnostic"	icon:"mdi:update"	json_attributes_topic:"zigbee2mqtt/Ikea_Drukker_031"	name:"Update state"	object_id:"ikea_drukker_031_update_state"	origin:{"name":"Zigbee2MQTT"	sw:"1.33.2"	url:"https://www.zigbee2mqtt.io"}	state_topic:"zigbee2mqtt/Ikea_Drukker_031"	unique_id:"0x0c4314fffe4cbf9c_update_state_zigbee2mqtt"	value_template:"{{ value_json['update']['state'] }}"}'				
After renaming:

Code: Select all

info  2024-02-08 21:59:42: MQTT publish: topic 'homeassistant/sensor/0x0c4314fffe4cbf9c/battery/config'	 payload '{"availability":[{"topic":"zigbee2mqtt/bridge/state"}	{"topic":"zigbee2mqtt/Ikea_Drukker_03/availability"}]	availability_mode:"all"	device:{"identifiers":["zigbee2mqtt_0x0c4314fffe4cbf9c"]	manufacturer:"IKEA"	model:"TRADFRI ON/OFF switch (E1743)"	name:"Ikea_Drukker_03"	sw_version:"2.3.079"}	device_class:"battery"	enabled_by_default:true	entity_category:"diagnostic"	json_attributes_topic:"zigbee2mqtt/Ikea_Drukker_03"	object_id:"ikea_drukker_03_battery"	origin:{"name":"Zigbee2MQTT"	sw:"1.33.2"	url:"https://www.zigbee2mqtt.io"}	state_class:"measurement"	state_topic:"zigbee2mqtt/Ikea_Drukker_03"	unique_id:"0x0c4314fffe4cbf9c_battery_zigbee2mqtt"	unit_of_measurement:"%"	value_template:"{{ value_json.battery }}"}'			
info  2024-02-08 21:59:42: MQTT publish: topic 'homeassistant/sensor/0x0c4314fffe4cbf9c/action/config'	 payload '{"availability":[{"topic":"zigbee2mqtt/bridge/state"}	{"topic":"zigbee2mqtt/Ikea_Drukker_03/availability"}]	availability_mode:"all"	device:{"identifiers":["zigbee2mqtt_0x0c4314fffe4cbf9c"]	manufacturer:"IKEA"	model:"TRADFRI ON/OFF switch (E1743)"	name:"Ikea_Drukker_03"	sw_version:"2.3.079"}	enabled_by_default:true	icon:"mdi:gesture-double-tap"	json_attributes_topic:"zigbee2mqtt/Ikea_Drukker_03"	name:"Action"	object_id:"ikea_drukker_03_action"	origin:{"name":"Zigbee2MQTT"	sw:"1.33.2"	url:"https://www.zigbee2mqtt.io"}	state_topic:"zigbee2mqtt/Ikea_Drukker_03"	unique_id:"0x0c4314fffe4cbf9c_action_zigbee2mqtt"	value_template:"{{ value_json.action }}"}'					
info  2024-02-08 21:59:42: MQTT publish: topic 'homeassistant/sensor/0x0c4314fffe4cbf9c/linkquality/config'	 payload '{"availability":[{"topic":"zigbee2mqtt/bridge/state"}	{"topic":"zigbee2mqtt/Ikea_Drukker_03/availability"}]	availability_mode:"all"	device:{"identifiers":["zigbee2mqtt_0x0c4314fffe4cbf9c"]	manufacturer:"IKEA"	model:"TRADFRI ON/OFF switch (E1743)"	name:"Ikea_Drukker_03"	sw_version:"2.3.079"}	enabled_by_default:false	entity_category:"diagnostic"	icon:"mdi:signal"	json_attributes_topic:"zigbee2mqtt/Ikea_Drukker_03"	name:"Linkquality"	object_id:"ikea_drukker_03_linkquality"	origin:{"name":"Zigbee2MQTT"	sw:"1.33.2"	url:"https://www.zigbee2mqtt.io"}	state_class:"measurement"	state_topic:"zigbee2mqtt/Ikea_Drukker_03"	unique_id:"0x0c4314fffe4cbf9c_linkquality_zigbee2mqtt"	unit_of_measurement:"lqi"	value_template:"{{ value_json.linkquality }}"}'		
info  2024-02-08 21:59:42: MQTT publish: topic 'homeassistant/sensor/0x0c4314fffe4cbf9c/click/config'	 payload '{"availability":[{"topic":"zigbee2mqtt/bridge/state"}	{"topic":"zigbee2mqtt/Ikea_Drukker_03/availability"}]	availability_mode:"all"	device:{"identifiers":["zigbee2mqtt_0x0c4314fffe4cbf9c"]	manufacturer:"IKEA"	model:"TRADFRI ON/OFF switch (E1743)"	name:"Ikea_Drukker_03"	sw_version:"2.3.079"}	icon:"mdi:toggle-switch"	json_attributes_topic:"zigbee2mqtt/Ikea_Drukker_03"	name:"Click"	object_id:"ikea_drukker_03_click"	origin:{"name":"Zigbee2MQTT"	sw:"1.33.2"	url:"https://www.zigbee2mqtt.io"}	state_topic:"zigbee2mqtt/Ikea_Drukker_03"	unique_id:"0x0c4314fffe4cbf9c_click_zigbee2mqtt"	value_template:"{{ value_json.click }}"}'						
info  2024-02-08 21:59:42: MQTT publish: topic 'homeassistant/sensor/0x0c4314fffe4cbf9c/update_state/config'	 payload '{"availability":[{"topic":"zigbee2mqtt/bridge/state"}	{"topic":"zigbee2mqtt/Ikea_Drukker_03/availability"}]	availability_mode:"all"	device:{"identifiers":["zigbee2mqtt_0x0c4314fffe4cbf9c"]	manufacturer:"IKEA"	model:"TRADFRI ON/OFF switch (E1743)"	name:"Ikea_Drukker_03"	sw_version:"2.3.079"}	enabled_by_default:false	entity_category:"diagnostic"	icon:"mdi:update"	json_attributes_topic:"zigbee2mqtt/Ikea_Drukker_03"	name:"Update state"	object_id:"ikea_drukker_03_update_state"	origin:{"name":"Zigbee2MQTT"	sw:"1.33.2"	url:"https://www.zigbee2mqtt.io"}	state_topic:"zigbee2mqtt/Ikea_Drukker_03"	unique_id:"0x0c4314fffe4cbf9c_update_state_zigbee2mqtt"	value_template:"{{ value_json['update']['state'] }}"}'				
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 »

Kedi wrote: Thursday 08 February 2024 18:44 Here you stated that the topic was zigbee. Did you change the topic in zigbee2mqtt?
The domoticz gives the error: "zigbee2MQTT: Switch not found!? as you stated above might come from the fact that the ID of the device changed. Is it possible to start over again? Leave the discovery topic default ( homeassistant ), clean the topics from the mosquitto server and then delete the MQTT-AD hardware and start over the discovery with new hardware (homeassistant).
Yes, I changed the zigbee to zigbeeAD, but that changed nothing.
As per your advices, i changed to the defaults, the results are the same.

Somehow not everything is read correctly from the AD topic.
After I press the submit button in the zigbee2mqtt gui (device>settings>submit), some data seems to be refreshed in the AD topic, and then read correctly.
Next days I will try to isolate one of the devices that often fails (by removing them from the zigbee2mqtt database, this prevents devices from being published).

Image

This is the content of the AD topic for one of the faulty devices (data fetched from the zigbee2mqtt log file).
When it was named 'Ikea_Drukker_031' it was not working, after renaming, it worked.
Don't stare at the renaming, as far as I know now it is just the updated topic that counts, which probably triggers Domo to re-read that topic.

I don't see any other difference than the name (and time of course)

Code: Select all

info  2024-02-08 21:46:35: MQTT publish: topic 'homeassistant/sensor/0x0c4314fffe4cbf9c/battery/config'	 payload '{"availability":[{"topic":"zigbee2mqtt/bridge/state"}	{"topic":"zigbee2mqtt/Ikea_Drukker_031/availability"}]	availability_mode:"all"	device:{"identifiers":["zigbee2mqtt_0x0c4314fffe4cbf9c"]	manufacturer:"IKEA"	model:"TRADFRI ON/OFF switch (E1743)"	name:"Ikea_Drukker_031"	sw_version:"2.3.079"}	device_class:"battery"	enabled_by_default:true	entity_category:"diagnostic"	json_attributes_topic:"zigbee2mqtt/Ikea_Drukker_031"	object_id:"ikea_drukker_031_battery"	origin:{"name":"Zigbee2MQTT"	sw:"1.33.2"	url:"https://www.zigbee2mqtt.io"}	state_class:"measurement"	state_topic:"zigbee2mqtt/Ikea_Drukker_031"	unique_id:"0x0c4314fffe4cbf9c_battery_zigbee2mqtt"	unit_of_measurement:"%"	value_template:"{{ value_json.battery }}"}'			
info  2024-02-08 21:46:35: MQTT publish: topic 'homeassistant/sensor/0x0c4314fffe4cbf9c/action/config'	 payload '{"availability":[{"topic":"zigbee2mqtt/bridge/state"}	{"topic":"zigbee2mqtt/Ikea_Drukker_031/availability"}]	availability_mode:"all"	device:{"identifiers":["zigbee2mqtt_0x0c4314fffe4cbf9c"]	manufacturer:"IKEA"	model:"TRADFRI ON/OFF switch (E1743)"	name:"Ikea_Drukker_031"	sw_version:"2.3.079"}	enabled_by_default:true	icon:"mdi:gesture-double-tap"	json_attributes_topic:"zigbee2mqtt/Ikea_Drukker_031"	name:"Action"	object_id:"ikea_drukker_031_action"	origin:{"name":"Zigbee2MQTT"	sw:"1.33.2"	url:"https://www.zigbee2mqtt.io"}	state_topic:"zigbee2mqtt/Ikea_Drukker_031"	unique_id:"0x0c4314fffe4cbf9c_action_zigbee2mqtt"	value_template:"{{ value_json.action }}"}'					
info  2024-02-08 21:46:35: MQTT publish: topic 'homeassistant/sensor/0x0c4314fffe4cbf9c/linkquality/config'	 payload '{"availability":[{"topic":"zigbee2mqtt/bridge/state"}	{"topic":"zigbee2mqtt/Ikea_Drukker_031/availability"}]	availability_mode:"all"	device:{"identifiers":["zigbee2mqtt_0x0c4314fffe4cbf9c"]	manufacturer:"IKEA"	model:"TRADFRI ON/OFF switch (E1743)"	name:"Ikea_Drukker_031"	sw_version:"2.3.079"}	enabled_by_default:false	entity_category:"diagnostic"	icon:"mdi:signal"	json_attributes_topic:"zigbee2mqtt/Ikea_Drukker_031"	name:"Linkquality"	object_id:"ikea_drukker_031_linkquality"	origin:{"name":"Zigbee2MQTT"	sw:"1.33.2"	url:"https://www.zigbee2mqtt.io"}	state_class:"measurement"	state_topic:"zigbee2mqtt/Ikea_Drukker_031"	unique_id:"0x0c4314fffe4cbf9c_linkquality_zigbee2mqtt"	unit_of_measurement:"lqi"	value_template:"{{ value_json.linkquality }}"}'		
info  2024-02-08 21:46:35: MQTT publish: topic 'homeassistant/sensor/0x0c4314fffe4cbf9c/click/config'	 payload '{"availability":[{"topic":"zigbee2mqtt/bridge/state"}	{"topic":"zigbee2mqtt/Ikea_Drukker_031/availability"}]	availability_mode:"all"	device:{"identifiers":["zigbee2mqtt_0x0c4314fffe4cbf9c"]	manufacturer:"IKEA"	model:"TRADFRI ON/OFF switch (E1743)"	name:"Ikea_Drukker_031"	sw_version:"2.3.079"}	icon:"mdi:toggle-switch"	json_attributes_topic:"zigbee2mqtt/Ikea_Drukker_031"	name:"Click"	object_id:"ikea_drukker_031_click"	origin:{"name":"Zigbee2MQTT"	sw:"1.33.2"	url:"https://www.zigbee2mqtt.io"}	state_topic:"zigbee2mqtt/Ikea_Drukker_031"	unique_id:"0x0c4314fffe4cbf9c_click_zigbee2mqtt"	value_template:"{{ value_json.click }}"}'						
info  2024-02-08 21:46:35: MQTT publish: topic 'homeassistant/sensor/0x0c4314fffe4cbf9c/update_state/config'	 payload '{"availability":[{"topic":"zigbee2mqtt/bridge/state"}	{"topic":"zigbee2mqtt/Ikea_Drukker_031/availability"}]	availability_mode:"all"	device:{"identifiers":["zigbee2mqtt_0x0c4314fffe4cbf9c"]	manufacturer:"IKEA"	model:"TRADFRI ON/OFF switch (E1743)"	name:"Ikea_Drukker_031"	sw_version:"2.3.079"}	enabled_by_default:false	entity_category:"diagnostic"	icon:"mdi:update"	json_attributes_topic:"zigbee2mqtt/Ikea_Drukker_031"	name:"Update state"	object_id:"ikea_drukker_031_update_state"	origin:{"name":"Zigbee2MQTT"	sw:"1.33.2"	url:"https://www.zigbee2mqtt.io"}	state_topic:"zigbee2mqtt/Ikea_Drukker_031"	unique_id:"0x0c4314fffe4cbf9c_update_state_zigbee2mqtt"	value_template:"{{ value_json['update']['state'] }}"}'				
After renaming:

Code: Select all

info  2024-02-08 21:59:42: MQTT publish: topic 'homeassistant/sensor/0x0c4314fffe4cbf9c/battery/config'	 payload '{"availability":[{"topic":"zigbee2mqtt/bridge/state"}	{"topic":"zigbee2mqtt/Ikea_Drukker_03/availability"}]	availability_mode:"all"	device:{"identifiers":["zigbee2mqtt_0x0c4314fffe4cbf9c"]	manufacturer:"IKEA"	model:"TRADFRI ON/OFF switch (E1743)"	name:"Ikea_Drukker_03"	sw_version:"2.3.079"}	device_class:"battery"	enabled_by_default:true	entity_category:"diagnostic"	json_attributes_topic:"zigbee2mqtt/Ikea_Drukker_03"	object_id:"ikea_drukker_03_battery"	origin:{"name":"Zigbee2MQTT"	sw:"1.33.2"	url:"https://www.zigbee2mqtt.io"}	state_class:"measurement"	state_topic:"zigbee2mqtt/Ikea_Drukker_03"	unique_id:"0x0c4314fffe4cbf9c_battery_zigbee2mqtt"	unit_of_measurement:"%"	value_template:"{{ value_json.battery }}"}'			
info  2024-02-08 21:59:42: MQTT publish: topic 'homeassistant/sensor/0x0c4314fffe4cbf9c/action/config'	 payload '{"availability":[{"topic":"zigbee2mqtt/bridge/state"}	{"topic":"zigbee2mqtt/Ikea_Drukker_03/availability"}]	availability_mode:"all"	device:{"identifiers":["zigbee2mqtt_0x0c4314fffe4cbf9c"]	manufacturer:"IKEA"	model:"TRADFRI ON/OFF switch (E1743)"	name:"Ikea_Drukker_03"	sw_version:"2.3.079"}	enabled_by_default:true	icon:"mdi:gesture-double-tap"	json_attributes_topic:"zigbee2mqtt/Ikea_Drukker_03"	name:"Action"	object_id:"ikea_drukker_03_action"	origin:{"name":"Zigbee2MQTT"	sw:"1.33.2"	url:"https://www.zigbee2mqtt.io"}	state_topic:"zigbee2mqtt/Ikea_Drukker_03"	unique_id:"0x0c4314fffe4cbf9c_action_zigbee2mqtt"	value_template:"{{ value_json.action }}"}'					
info  2024-02-08 21:59:42: MQTT publish: topic 'homeassistant/sensor/0x0c4314fffe4cbf9c/linkquality/config'	 payload '{"availability":[{"topic":"zigbee2mqtt/bridge/state"}	{"topic":"zigbee2mqtt/Ikea_Drukker_03/availability"}]	availability_mode:"all"	device:{"identifiers":["zigbee2mqtt_0x0c4314fffe4cbf9c"]	manufacturer:"IKEA"	model:"TRADFRI ON/OFF switch (E1743)"	name:"Ikea_Drukker_03"	sw_version:"2.3.079"}	enabled_by_default:false	entity_category:"diagnostic"	icon:"mdi:signal"	json_attributes_topic:"zigbee2mqtt/Ikea_Drukker_03"	name:"Linkquality"	object_id:"ikea_drukker_03_linkquality"	origin:{"name":"Zigbee2MQTT"	sw:"1.33.2"	url:"https://www.zigbee2mqtt.io"}	state_class:"measurement"	state_topic:"zigbee2mqtt/Ikea_Drukker_03"	unique_id:"0x0c4314fffe4cbf9c_linkquality_zigbee2mqtt"	unit_of_measurement:"lqi"	value_template:"{{ value_json.linkquality }}"}'		
info  2024-02-08 21:59:42: MQTT publish: topic 'homeassistant/sensor/0x0c4314fffe4cbf9c/click/config'	 payload '{"availability":[{"topic":"zigbee2mqtt/bridge/state"}	{"topic":"zigbee2mqtt/Ikea_Drukker_03/availability"}]	availability_mode:"all"	device:{"identifiers":["zigbee2mqtt_0x0c4314fffe4cbf9c"]	manufacturer:"IKEA"	model:"TRADFRI ON/OFF switch (E1743)"	name:"Ikea_Drukker_03"	sw_version:"2.3.079"}	icon:"mdi:toggle-switch"	json_attributes_topic:"zigbee2mqtt/Ikea_Drukker_03"	name:"Click"	object_id:"ikea_drukker_03_click"	origin:{"name":"Zigbee2MQTT"	sw:"1.33.2"	url:"https://www.zigbee2mqtt.io"}	state_topic:"zigbee2mqtt/Ikea_Drukker_03"	unique_id:"0x0c4314fffe4cbf9c_click_zigbee2mqtt"	value_template:"{{ value_json.click }}"}'						
info  2024-02-08 21:59:42: MQTT publish: topic 'homeassistant/sensor/0x0c4314fffe4cbf9c/update_state/config'	 payload '{"availability":[{"topic":"zigbee2mqtt/bridge/state"}	{"topic":"zigbee2mqtt/Ikea_Drukker_03/availability"}]	availability_mode:"all"	device:{"identifiers":["zigbee2mqtt_0x0c4314fffe4cbf9c"]	manufacturer:"IKEA"	model:"TRADFRI ON/OFF switch (E1743)"	name:"Ikea_Drukker_03"	sw_version:"2.3.079"}	enabled_by_default:false	entity_category:"diagnostic"	icon:"mdi:update"	json_attributes_topic:"zigbee2mqtt/Ikea_Drukker_03"	name:"Update state"	object_id:"ikea_drukker_03_update_state"	origin:{"name":"Zigbee2MQTT"	sw:"1.33.2"	url:"https://www.zigbee2mqtt.io"}	state_topic:"zigbee2mqtt/Ikea_Drukker_03"	unique_id:"0x0c4314fffe4cbf9c_update_state_zigbee2mqtt"	value_template:"{{ value_json['update']['state'] }}"}'				
rpi4 - zigbee2mqtt - roborock - espeasy - rfxcom - homewizard p1 - otgw - homebridge - surveillance station - egardia - goodwe - open weather map - wol - BBQ detection - rsync backup
User avatar
waltervl
Posts: 5384
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: MQTT AD - Zigbee2MQTT

Post by waltervl »

If you stop and start the mqtt broker are those topics in homeassistant still there? As they should be retained. If they are not then your renaming triggers Zigbee2MQTT to send new discovery topics and then Domoticz will create the devices again.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
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 »

waltervl wrote: Friday 09 February 2024 0:05 If you stop and start the mqtt broker are those topics in homeassistant still there?
All topics remain when zigbee2mqtt is stopped:

- zigbee2mqtt
- homeassistant (the AD topic)
- $SYS
rpi4 - zigbee2mqtt - roborock - espeasy - rfxcom - homewizard p1 - otgw - homebridge - surveillance station - egardia - goodwe - open weather map - wol - BBQ detection - rsync backup
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests