I’m developing a binding, so I add and remove the same thing very often. I currently face a problem that the discovery stopped working. I can add the thing manually and it works as expected. I confirmed that the devices (4 AC units) are responding to the discovery query - I have a standalone python script for that.
I suspect there are some “leftovers” in the openhab config that are blocking the discovery. It’s a guess only.
I didn’t change the discovery code, there is nothing suspicious in the log, yet it doesn’t work
What I tried:
update of the binding (I do it every 5 minutes anyway)
uninstalling and re-installing the binding
removing anything (things, points) from openhab GUI related to my binding
purged all orphaned links related to my binding
Edit: I’m compiling for the 4.1.3 now, after removing ~/.m2 maven cache
I added logger entries everywhere in the discovery class and I see some activity, but there is nothing happening beside this 22:10:03.938 [DEBUG] [scovery.MHIairconDiscoveryParticipant] - MHI Air Conditioner getSupportedThingTypeUIDs 22:10:04.594 [DEBUG] [scovery.MHIairconDiscoveryParticipant] - MHI Air Conditioner getSupportedThingTypeUIDs 22:10:04.602 [DEBUG] [scovery.MHIairconDiscoveryParticipant] - MHI Air Conditioner getSupportedThingTypeUIDs 22:10:04.611 [DEBUG] [scovery.MHIairconDiscoveryParticipant] - MHI Air Conditioner getSupportedThingTypeUIDs 22:10:04.620 [DEBUG] [scovery.MHIairconDiscoveryParticipant] - MHI Air Conditioner getSupportedThingTypeUIDs 22:10:04.620 [DEBUG] [scovery.MHIairconDiscoveryParticipant] - MHI Air Conditioner getServiceType 22:10:04.631 [DEBUG] [scovery.MHIairconDiscoveryParticipant] - MHI Air Conditioner getServiceType 22:10:09.620 [DEBUG] [scovery.MHIairconDiscoveryParticipant] - MHI Air Conditioner getSupportedThingTypeUIDs
My code is based on 4.2.0 and it’s here (WARNING, use gloves, DIRTY code)
I had some compilation problems (and git management problems as well) - I’m not sure how compiling for different version affects the discovery. It was working OK on 4.3.0, so I guess 4.2.0 should be fine.
More info. Binding compiled for 4.1.3. After installation is shows Installes State instead of Active, but update (with the same jar!) changes is to Resolved. Can someone help me to understand what’s happening? Both classes in the diag message are present in the code.
Hello Przemo,
Discovery results might be cached, also you rely on MDNS discovery participant interface which might result in different behavior.
I’d advise checking if org.openhab.core.config.discovery.mdns.internal.MDNSDiscoveryService#scan is called at all.
You can pull sources into IDE of your choice and make a breakpoints across methods there. This way you can check if “scan” click within main ui results in interaction with discovery service.
The binding is visible, scan works (I didn’t even have to start it, 4 units added to the inbox immediately)
So somewhere in the guts of my OH4 installation is corrupted information about mhiaircon binding. Is there a database somewhere inside? I might have to do a surgery…
Thank you very much for the help, suggestions and the admin work!