Cannot create handler for bridged Things

I have a bridge with several things connected to the bridge.
My device discovery works as far as finding new Things (through the bridge) and creating a DiscoveryResult. After that, openHAB does the following steps:

  1. the core calls the HandlerFactory>supportsThingType() for the new thingTypeUID (my Handler answers yes)
  2. the core calls HandlerFactory>createThing() (my Handler does a super())
  3. the core calls the HandlerFactory>supportsThingType() for the new thingTypeUID (same as in 1., my Handler still answers yes)
  4. … nothing more. Here, the core should call HandlerFactory>createHandler(), but it doesn’t.

I can’t find the reason for that. In the source of the core’s ThingFactory, I see in line 100 that it should call the createHandler() right away after supportsThingType(), but it doesn’t happen. No error message or anything.

Any idea what might block the core from calling createHandler()? createHandler() is called properly when I create the bridge Thing.

What is in you thing xml definition? Maybe there is a typo in the naming.

Thank you @hilbrand . There was no typo, but I compared the thing xml definition with other handlers with a bridge. I solved the issue with those two corrections:

  • In the .xml, the bridge must have the type bridge-type and not thing-type
  • The Bridge handler must inherit BaseBridgeHandler and not BaseThingHandler
1 Like