I had some luck a day ago seeing some of this auto discovery working. Now I even configured the System MQTT Broker (which btw has the encryption flag broken in the UI) but nothing in the logs and no sign of discovery. I have trace enabled in the discovery.
Also there is no warning or error related to the discovery in the logs
Ok I think I figured out how to get rid of the system broker but that hasn’t solved the discovery.
Something seems to be missing but I don’t have any clues because there is nothing else beside these warnings at shutdown
openhab.log.1:2021-08-03 12:11:56.066 [WARN ] [g.mqtt.handler.AbstractBrokerHandler] - Tried to unsubscribe org.openhab.binding.mqtt.homie.internal.discovery.Homie300Discovery@2de52cc4 from discovery topic homeassistant/# on broker mqtt:broker:6f8979a9 but topic not registered for listener. Check discovery logic!
openhab.log.1:2021-08-03 12:11:56.068 [WARN ] [g.mqtt.handler.AbstractBrokerHandler] - Tried to unsubscribe org.openhab.binding.mqtt.homie.internal.discovery.Homie300Discovery@2de52cc4 from discovery topic milight/states/# on broker mqtt:broker:6f8979a9 but topic not registered for listener. Check discovery logic!
openhab.log.1:2021-08-03 12:11:56.207 [WARN ] [g.mqtt.handler.AbstractBrokerHandler] - Tried to unsubscribe org.openhab.binding.mqtt.homeassistant.internal.discovery.HomeAssistantDiscovery@2448ff2e from discovery topic +/+/$homie on broker mqtt:broker:6f8979a9 but topic not registered at all. Check discovery logic!
openhab.log.1:2021-08-03 12:11:56.209 [WARN ] [g.mqtt.handler.AbstractBrokerHandler] - Tried to unsubscribe org.openhab.binding.mqtt.homeassistant.internal.discovery.HomeAssistantDiscovery@2448ff2e from discovery topic milight/states/# on broker mqtt:broker:6f8979a9 but topic not registered for listener. Check discovery logic!
openhab.log.1:2021-08-03 12:11:56.234 [WARN ] [g.mqtt.handler.AbstractBrokerHandler] - Tried to unsubscribe org.openhab.binding.mqtt.homeassistant.internal.discovery.HomeAssistantDiscovery@2448ff2e from discovery topic homeassistant/# on broker mqtt:broker:6f8979a9 but topic not registered at all. Check discovery logic!
openhab.log.1:2021-08-03 12:11:56.234 [WARN ] [g.mqtt.handler.AbstractBrokerHandler] - Tried to unsubscribe org.openhab.binding.mqtt.homeassistant.internal.discovery.HomeAssistantDiscovery@2448ff2e from discovery topic +/+/$homie on broker mqtt:broker:6f8979a9 but topic not registered at all. Check discovery logic!
openhab.log.1:2021-08-03 12:11:56.235 [WARN ] [g.mqtt.handler.AbstractBrokerHandler] - Tried to unsubscribe org.openhab.binding.mqtt.homeassistant.internal.discovery.HomeAssistantDiscovery@2448ff2e from discovery topic milight/states/# on broker mqtt:broker:6f8979a9 but topic not registered for listener. Check discovery logic!
openhab.log.1:2021-08-03 12:11:56.561 [WARN ] [g.mqtt.handler.AbstractBrokerHandler] - Tried to unsubscribe org.openhab.binding.mqtt.espmilighthub.internal.discovery.EspMilightHubDiscoveryService@3478bb29 from discovery topic homeassistant/# on broker mqtt:broker:6f8979a9 but topic not registered at all. Check discovery logic!
openhab.log.1:2021-08-03 12:11:56.562 [WARN ] [g.mqtt.handler.AbstractBrokerHandler] - Tried to unsubscribe org.openhab.binding.mqtt.espmilighthub.internal.discovery.EspMilightHubDiscoveryService@3478bb29 from discovery topic +/+/$homie on broker mqtt:broker:6f8979a9 but topic not registered at all. Check discovery logic!
openhab.log.1:2021-08-03 12:11:57.274 [WARN ] [ROOT ] - bundle org.openhab.ui.habot:3.2.0.M1 (311) BundleComponentActivator is not active; not scheduling Async Deactivate: org.openhab.ui.habot.notification.internal.WebPushNotificationModuleHandlerFactory id: 2
If you’re confident your discovery is being published, you can create an ordinary string type channel with stateTopic homeassistant/# as well and see if the message arrives.
I can see the subscribe in mosquitto and see my message being dispatched from mosquitto to openhab but I’m more worried about a osgi subscription issue… From what I can see, homeassistant message never gets dispatched to the discovery class although all the MQTT subscriptions are fine. Also looking at few other messages, other people have experienced similar issues since OH 3.0 with the discovery services. There is not that much logging in the discovery classes, so I’m worried there is more stuff failing silently. Is there any easy way to debug all that code?