Zigbee2mqtt not stable with my installation

Hi,

I am having trouble with zigbee2mqtt with my home assistant installtion. I have set it up as per the documentation. However devices are discovered and removed sporadically. I am trying to troubleshoot the issue by looking at the debug log of mqtt. I found the following:

2020-09-18 08:53:15 INFO (MainThread) [homeassistant.components.mqtt.discovery] Found new component: sensor 0x00158d0003ef175e linkquality
2020-09-18 08:53:15 DEBUG (MainThread) [homeassistant.components.mqtt] Subscribing to zigbee2mqtt/0x00158d0003ef175e
2020-09-18 08:53:15 DEBUG (MainThread) [homeassistant.components.mqtt] Received message on homeassistant/binary_sensor/0x00158d0003ef175e/contact/config: b''
2020-09-18 08:53:15 DEBUG (MainThread) [homeassistant.components.mqtt] Received message on zigbee2mqtt/bridge/state (retained): b'online'
2020-09-18 08:53:15 INFO (MainThread) [homeassistant.components.mqtt.discovery] Component has already been discovered: binary_sensor 0x00158d0003ef175e contact, sending update
2020-09-18 08:53:15 INFO (MainThread) [homeassistant.components.mqtt] Got update for entity with hash: ('binary_sensor', '0x00158d0003ef175e contact') '{}'
2020-09-18 08:53:15 INFO (MainThread) [homeassistant.components.mqtt] Removing component: binary_sensor.0x00158d0003ef175e_contact
2020-09-18 08:53:15 DEBUG (MainThread) [homeassistant.components.mqtt] Subscribing to zigbee2mqtt/0x00158d0003ef175e
2020-09-18 08:53:15 DEBUG (MainThread) [homeassistant.components.mqtt] Received message on homeassistant/sensor/0x000d6ffffe9cbcd6/linkquality/config: b'{"availability_topic":"zigbee2mqtt/bridge/state","device":{"identifiers":["zigbee2mqtt_0x000d6ffffe9cbcd6"],"manufacturer":"IKEA","model":"TRADFRI signal repeater (E1746)","name":"0x000d6ffffe9cbcd6","sw_version":"Zigbee2MQTT 1.14.4"},"icon":"mdi:signal","json_attributes_topic":"zigbee2mqtt/0x000d6ffffe9cbcd6","name":"0x000d6ffffe9cbcd6_linkquality","state_topic":"zigbee2mqtt/0x000d6ffffe9cbcd6","unique_id":"0x000d6ffffe9cbcd6_linkquality_zigbee2mqtt","unit_of_measurement":"lqi","value_template":"{{ value_json.linkquality }}"}'
2020-09-18 08:53:16 DEBUG (MainThread) [homeassistant.components.mqtt] Subscribing to zigbee2mqtt/bridge/state
2020-09-18 08:53:16 DEBUG (MainThread) [homeassistant.components.mqtt] Received message on homeassistant/sensor/0x00158d0003ef175e/battery/config: b''
2020-09-18 08:53:16 INFO (MainThread) [homeassistant.components.mqtt.discovery] Found new component: sensor 0x000d6ffffe9cbcd6 linkquality
2020-09-18 08:53:16 INFO (MainThread) [homeassistant.components.mqtt.discovery] Component has already been discovered: sensor 0x00158d0003ef175e battery, sending update
2020-09-18 08:53:16 DEBUG (MainThread) [homeassistant.components.mqtt] Received message on homeassistant/binary_sensor/0x000d6ffffe9cbcd6/update_available/config: b'{"availability_topic":"zigbee2mqtt/bridge/state","device":{"identifiers":["zigbee2mqtt_0x000d6ffffe9cbcd6"],"manufacturer":"IKEA","model":"TRADFRI signal repeater (E1746)","name":"0x000d6ffffe9cbcd6","sw_version":"Zigbee2MQTT 1.14.4"},"json_attributes_topic":"zigbee2mqtt/0x000d6ffffe9cbcd6","name":"0x000d6ffffe9cbcd6_update_available","payload_off":false,"payload_on":true,"state_topic":"zigbee2mqtt/0x000d6ffffe9cbcd6","unique_id":"0x000d6ffffe9cbcd6_update_available_zigbee2mqtt","value_template":"{{ value_json.update_available}}"}'
2020-09-18 08:53:16 DEBUG (MainThread) [homeassistant.components.mqtt] Received message on homeassistant/sensor/0x00158d0003ef175e/linkquality/config: b''
2020-09-18 08:53:16 DEBUG (MainThread) [homeassistant.components.mqtt] Received message on homeassistant/binary_sensor/0x00158d00041a3afa/contact/config: b'{"availability_topic":"zigbee2mqtt/bridge/state","device":{"identifiers":["zigbee2mqtt_0x00158d00041a3afa"],"manufacturer":"Xiaomi","model":"Aqara door & window contact sensor (MCCGQ11LM)","name":"0x00158d00041a3afa","sw_version":"Zigbee2MQTT 1.14.4"},"device_class":"door","json_attributes_topic":"zigbee2mqtt/0x00158d00041a3afa","name":"0x00158d00041a3afa_contact","payload_off":true,"payload_on":false,"state_topic":"zigbee2mqtt/0x00158d00041a3afa","unique_id":"0x00158d00041a3afa_contact_zigbee2mqtt","value_template":"{{ value_json.contact }}"}'
2020-09-18 08:53:16 DEBUG (MainThread) [homeassistant.components.mqtt] Received message on homeassistant/sensor/0x000d6ffffe9cbcd6/linkquality/config: b''
2020-09-18 08:53:16 DEBUG (MainThread) [homeassistant.components.mqtt] Received message on zigbee2mqtt/bridge/state (retained): b'online'
2020-09-18 08:53:16 INFO (MainThread) [homeassistant.components.mqtt] Got update for entity with hash: ('sensor', '0x00158d0003ef175e battery') '{}'
2020-09-18 08:53:16 INFO (MainThread) [homeassistant.components.mqtt] Removing component: sensor.0x00158d0003ef175e_battery

I am not sure if I found it, but what does “Removing component: binary_sensor.0x00158d0003ef175e_contact” mean? Why did it remove it? can someone explain?

It seems I solved the issue, but not sure. Can someone confirm I cannot use two zigbee2mqtt connecting to one broker using one base topic?
I am using on both zigbee2mqtt
base_topic: zigbee2mqtt

You can’t. Each zigbee2mqtt instance needs it own base topic and panid. If you use the same base topic, incoming messages get relayed to both coordinators, which causes unpredictable behavior.

Thanking for confirming the issue. This is exactly what was happening.