I enabled log level âdebugâ for MQTT and found the following odds:
Test system:
2025-02-11 16:49:30.035 DEBUG (MainThread) [homeassistant.components.mqtt.client] Received message on homeassistant/sensor/Klima_Test123/Batterie/config (qos=0): b'{"name":"Batterie","unique_id":"Klima_Test123_Batterie","state_topic":"Klima/Test123/state","unit_of_measurement":"V","device_class":"voltage","force_update":true,"enabled_by_default":true,"value_template":"{{ value_json.batt}}","device":{"manufacturer":"UHU","model":"Klima32_5_C6.ino Feb 11 2025 16:48:44","name":"AHT_Test123","identifiers":["AHT_Test123"]}}'
2025-02-11 16:49:30.038 DEBUG (MainThread) [homeassistant.components.mqtt.discovery] Process component discovery payload {'unique_id': 'Klima_Test123_Batterie', 'state_topic': 'Klima/Test123/state', 'unit_of_measurement': 'V', 'device_class': 'voltage', 'force_update': True, 'enabled_by_default': True, 'value_template': '{{ value_json.batt}}', 'device': {'manufacturer': 'UHU', 'model': 'Klima32_5_C6.ino Feb 11 2025 16:48:44', 'identifiers': ['AHT_Test123'], 'name': 'AHT_Test123'}, 'name': 'Batterie'}
2025-02-11 16:49:30.060 INFO (MainThread) [homeassistant.components.sensor] Setting up mqtt.sensor
2025-02-11 16:49:30.061 INFO (MainThread) [homeassistant.components.mqtt.discovery] Found new component: sensor Klima_Test123 Batterie
2025-02-11 16:49:30.071 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new sensor.mqtt entity: sensor.aht_test123_batterie
2025-02-11 16:49:30.075 DEBUG (MainThread) [homeassistant.components.mqtt.discovery] Pending discovery for ('sensor', 'Klima_Test123 Batterie'): deque([])
2025-02-11 16:49:30.175 DEBUG (MainThread) [homeassistant.components.mqtt.client] 192.168.11.200: register write 38
2025-02-11 16:49:30.176 DEBUG (MainThread) [homeassistant.components.mqtt.client] Subscribing with mid: 67 to topics with qos: [('Klima/Test123/state', 0)]
2025-02-11 16:49:30.181 DEBUG (MainThread) [homeassistant.components.mqtt.client] 192.168.11.200: unregister write 38
Production system:
2025-02-11 16:21:10.982 DEBUG (MainThread) [homeassistant.components.mqtt.client] Received retained message on homeassistant/sensor/Klima_Test123/Batterie/config (qos=0): b'{"name":"Batterie","unique_id":"Klima_Test123_Batterie","state_topic":"Klima/Test123/state","unit_of_measurement":"V","device_class":"voltage","force_update":true,"enabled_by_default":true,"value_template":"{{ value_json.batt}}","device":{"manufacturer":"UHU","model":"Klima32_5_C6.ino Feb 11 2025 16:09:04","name":"AHT_Test123","identifiers":["AHT_Test123"]}}'
2025-02-11 16:21:10.983 DEBUG (MainThread) [homeassistant.components.mqtt.discovery] Process component discovery payload {'unique_id': 'Klima_Test123_Batterie', 'state_topic': 'Klima/Test123/state', 'unit_of_measurement': 'V', 'device_class': 'voltage', 'force_update': True, 'enabled_by_default': True, 'value_template': '{{ value_json.batt}}', 'device': {'manufacturer': 'UHU', 'model': 'Klima32_5_C6.ino Feb 11 2025 16:09:04', 'identifiers': ['AHT_Test123'], 'name': 'AHT_Test123'}, 'name': 'Batterie'}
2025-02-11 16:21:10.983 INFO (MainThread) [homeassistant.components.mqtt.discovery] Found new component: sensor Klima_Test123 Batterie
2025-02-11 16:21:10.985 DEBUG (MainThread) [homeassistant.components.mqtt.discovery] Pending discovery for ('sensor', 'Klima_Test123 Batterie'): deque([])
The msg âSetting up mqtt.sensorâ is missing and the discovery stalls. Honestly I expected more information from a level âdebugâ. But thatâs what I got.
Now I removed for a test all âmanualâ MQTT definitions from mqtt.yaml, but the problem remains.
But I found something interresting: On my test system, the device is being removed from HA when I delete the discovery packet from the MQTT broker. This does not happen on the produktion system.