Installing bindings by REST API

If I install an external binding, it works fine by console command like

openhab> bundle:install github.com/markus7017/myfiles/blob/master/shelly/org.openhab.binding.shelly-5.0.0-SNAPSHOT.jar

but where does the file gets copied to?

However, by REST API call it does not work. Trying to provide the same URL to the API explorer always results in an error

"The given URL is malformed or not valid."

Any idea what the correct syntax is? I remember a while ago it was said the endpoint is not working at all

Somewhere in $OH_USERDATA/cache. I think Marketplace addons get copied to $OH_USERDATA/marketplace but I don’t have installed at the moment and can’t confirm.f

I don’t know about the REST API.

That’s correct. That’s the folder which gets deleted during a clean-cache.

Thanks. That was a good hint. I wasn’t able to find the file by its name in the first instance. The reason is the file gets installed and renamed to

/var/lib/openhab/cache/org.eclipse.osgi/xxx/bundleFile

where xxx is the number of the bundle (Start ID).

I assume that this file also gets uninstalled when performing a clean-cache as the cache folder gets deleted. Will test later on.

However, if somebody could shed some light on how to use the REST API endpoint, tht’ll be great.

Yes, the whole cache folder gets removed when clearing the cache. It gets repopulated when OH starts back up based on whatever was recorded in the $OH_USERDATA/config/org/openhab/addons.config and $OH_USERDATA/jsondb/org.openhab.marketplace.json (for the marketplace installed add-ons.

I don’t know if the bundle you installed using the karaf console gets recorded anywhere. I’d guess in that addons.config file if it is recorded anywhere. If it’s not recorded, you’ll have to install it again manually after clearing the cache.

1 Like