Binding not visible after starting OSGi

Hi,

i have a simple embarrassing question about developing binding.

I installed eclipse for debugging a binding (https://next.openhab.org/docs/developer/#develop-a-new-binding)

Now i’m editing pom.xml in org.openhab.demo.app and add my binding and resolve in app.bndrun.

Now i’m able to start openhab with “Debug OSGi”. I set some breakpoint in “supportsThingType” in my thing handlers.

Eclipse now stops at this breakpoint.

To this point all is fine.

Now, if i start the browser my binding is not available and i’m not able two create things for my binding.

I’ve no idea why this problem occurs. Does anyone have any ideas?

Do you develop for 4.0.0-SNAPSHOT? If so, you might run into a similar issue like Cannot add thing from binding dropped as JAR · Issue #3323 · openhab/openhab-core · GitHub which will most likely be fixed after the linked PR is merged.

Yes i’m developing for 4.0.0-SNAPSHOT. Sounds like my problem. I’m waiting for your fix :+1:

If you need further information, let me know

Hi @Christian_Kittel @J-N-K – did the PR Fixes and enhancements for add-on services (#3293) · openhab/openhab-core@6738277 · GitHub (referenced from issue #3323) fix it for you?

I am still experiencing the issue when running the demo app.

Pre-configured things work, and handler is found. But “Add thing” dialog in MainUI does not detect the binding.

What demo app? In Eclipse? Maybe not doesn’t load the new add-on service

Yes demo app and using eclipse. Ok will check if there is a way to load the addon service

Thanks

http://localhost:8080/rest/addons/services returns

[
  {
    "id": "jar",
    "name": "JAR-File add-on service",
    "addonTypes": [
      {
        "id": "automation",
        "label": "Automation"
      },
      {
        "id": "binding",
        "label": "Bindings"
      },
      {
        "id": "misc",
        "label": "Misc"
      },
      {
        "id": "persistence",
        "label": "Persistence"
      },
      {
        "id": "transformation",
        "label": "Transformations"
      },
      {
        "id": "ui",
        "label": "User Interfaces"
      },
      {
        "id": "voice",
        "label": "Voice"
      }
    ]
  },
  {
    "id": "marketplace",
    "name": "Community Marketplace",
    "addonTypes": [
      {
        "id": "automation",
        "label": "Automation"
      },
      {
        "id": "binding",
        "label": "Bindings"
      },
      {
        "id": "misc",
        "label": "Misc"
      },
      {
        "id": "persistence",
        "label": "Persistence"
      },
      {
        "id": "transformation",
        "label": "Transformations"
      },
      {
        "id": "ui",
        "label": "User Interfaces"
      },
      {
        "id": "voice",
        "label": "Voice"
      }
    ]
  },
  {
    "id": "json",
    "name": "Json 3rd Party Add-on Service",
    "addonTypes": [
      {
        "id": "automation",
        "label": "Automation"
      },
      {
        "id": "binding",
        "label": "Bindings"
      },
      {
        "id": "misc",
        "label": "Misc"
      },
      {
        "id": "persistence",
        "label": "Persistence"
      },
      {
        "id": "transformation",
        "label": "Transformations"
      },
      {
        "id": "ui",
        "label": "User Interfaces"
      },
      {
        "id": "voice",
        "label": "Voice"
      }
    ]
  }
]

Looks good. Do you see the add-on when requesting /addons?

Hi,

no it is still not working in demo app. For me i found a solution with adding things via Developer Sidebar “Add thing (quick)”. Bindings are only displayed there.

Also the discovery source code was executed but there are no things in the inbox even though the source code found some.

No, /addons returns empty list ([])

@Christian_Kittel thanks, this workaround seems to do the trick for me as well.

I guess the reason is that there is no add-on service that provides an Addon entry for a bundle that is loaded directly. I’m not sure if there is a good way to fix that, also installing add-ons via bundle:install on the console might suffer the same problem. But we provide already a ton of ways to install add-ons (Distribution, Community Marketplace, JSON 3rd party add-on service, /addons-folder) that we don’t need additional ones with full support. Of course, if someone comes up with a PR that can handle these, I’ll review and merge it.

I think the case of ‘loading directly’ is more important for smooth developer workflow, ability to debug in IDE etc.

For now, I am satisfied with the workaround mentioned above :slight_smile:

Maybe it’s enough to adjust the documentation. For someone who wants to contribute for the first time, this may be important information:

1 Like