[SOLVED] Bundle-Handling with openhabian

I am a fan of openhab and meanwhile quite deep into the whole handling. One thing I’m constantly struggling and haven’t found a consolidated and consistent documentation is regarding the whole bundle-handling even though I guess it is a common task.

I use openhabian with open hab release 2.4.0 stable. That works basically fine but with certain bundles I’d like to use the newest, even snapshot version for several reasons, one is using the newest functionality. These are

The IKEA Tradfri Binding
The ZWave binding
The Amazon Echo binding

I’ve downloaded these and handle them all on the Karaf console (bundle:update etc.).
Now I have two instances of each bundle like shown below. Does this cause any problems? Which one is used? If I try to delete one using bundle:remove it will appear again after a restart. Guess a generic approach on how to use bundles of new versions which are way ahead would be great. Also if its enough to have them installed via bundle:install or if they need to be copied to a specific location etc.

openhab> bundle:list | grep TRÅDFRI
     23 │ Active    │  80 │ 2.5.0.201906210421     │ openHAB Add-ons :: Bundles :: TRÅDFRI Binding
    222 │ Active    │  80 │ 0.10.0.oh240           │ Eclipse SmartHome TRÅDFRI Binding

openhab> bundle:list | grep ZW
     22 │ Active    │  80 │ 2.5.0.201905191822     │ openHAB Add-ons :: Bundles :: ZWave Binding
    247 │ Active    │  80 │ 2.4.0                  │ ZWave Binding

openhab> bundle:list | grep Echo
 21 │ Active    │  80 │ 2.5.0.Beta_07          │ Amazon Echo Control Binding
239 │ Installed │  80 │ 2.4.0                  │ Amazon Echo Control Binding

Did you try clearing the cache :sunglasses: Clear the Cache

Installed? I guess no. Active, I would be worried :slight_smile:

Yes always cleared the cache and afterwards rebooted. Then they appear again, maybe because the initial 2.4.0 bundles were installed by PaperUI which I forgot to mention.

Bye the way, with the first two bindings they both show Active …

The typical process is:

  1. Uninstall the old binding
  2. Download the jar file for the later version of the binding
  3. Place that jar file into the addons folder.

Karaf will take it from there.

If you installed the binding through PaperUI, you should uninstall it from PaperUI. If you are using addons.cfg then remove the entry for the binding from there.

It’s a common task but almost no one uses the Karaf console directly to do it.

One other thing to note is there will frequently be times when a snapshot or milestone version of a binding will no longer work with an older version of OH because there was some change made to the core.

I’m fully aware of the divergent situation of core and bindings. I followed your advice:

  1. Uninstalled the old binding using Paper-UI
  2. Deleted the new versions
  3. Restarted openhab(ian)
  4. Placed the bindings back into addon folder
  5. Now I can’t see the new bindings in PaperUI for configuration, only the old 2.4.0 version with a button “install”

So how should I proceed?

Where are you looking in PaperUI to configure the Bindings? What do you see in the logs when you put the jar file in the addons folder? If you list the bundles in Karaf, what do you see?

Hi Rich, I look in Addons / Bindings to setup the new binding. I put in Amazon Echo, IKEA Tradfri and the ZWave latest version bindings.

Only the Echo works (and I can configure this)

The log says

2019-07-09 22:26:31.913 [WARN ] [org.apache.felix.fileinstall        ] - Error while starting bundle: file:/usr/share/openhab2/addons/org.openhab.binding.tradfri-2.5.0-SNAPSHOT.jar
2019-07-09 22:26:31.940 [WARN ] [org.apache.felix.fileinstall        ] - Error while starting bundle: file:/usr/share/openhab2/addons/org.openhab.binding.zwave-2.5.0-SNAPSHOT.jar
2019-07-09 22:26:32.048 [hingStatusInfoChangedEvent] - 'amazonechocontrol:account:XXXX' changed from UNINITIALIZED to INITIALIZING

Karaf says:

265 │ Active    │  80 │ 2.5.0.Beta_07          │ Amazon Echo Control Binding
266 │ Installed │  80 │ 2.5.0.201906210421     │ openHAB Add-ons :: Bundles :: TRÅDFRI Binding
267 │ Installed │  80 │ 2.5.0.201905191822     │ openHAB Add-ons :: Bundles :: ZWave Binding

When I say

openhab> bundle:start 267
Error executing command: Error executing command on bundles:
        Error starting bundle 267: Could not resolve module: org.openhab.binding.zwave [267]
  Unresolved requirement: Import-Package: org.eclipse.smarthome.io.transport.serial

openhab> bundle:start 266
Error executing command: Error executing command on bundles:
        Error starting bundle 266: Could not resolve module: org.openhab.binding.tradfri [266]
  Unresolved requirement: Import-Package: org.eclipse.californium.core; version="[1.0.0,2.0.0)"

So there seems to be something missing. How do I install these dependencies? By hand? from which source?

That is not where you configure bindings. Go to Configuration > Bindings to find the configuration parameters for installed bindings.

When you manually install a few bindings like Zwave, their dependencies do not get installed and you have to install them by hand.

In the Karaf console you can install it using

feature:install openhab-transport-serial

That worked! Thank you for pointing me to the correct direction.
For Tradfri I need to

feature:install openhab-transport-coap

and then that one works, too.

Just found out that I can’t configure anything here. In case of the ZWave binding: I see a list of supported ZWave Things / Adapters but no way to change e.g. the Serial Port etc. The Security key. etc.

That’s because that isn’t where you enter those settings.

As documented in the binding’s readme:

Before the binding can be used, a serial adapter must be added. This needs to be done manually. Select Serial ZStick , and enter the serial port.

The following section lists the controller configuration.
Serial Port …
Network Security Key…

Thank you Rich. Now I see that it’s configured with the controller not the binding itself. Not very intuitive but it helps reading the manual:-)

It may not be completely intuitive but it’s the only way the binding can support more than one controller.