How to add blockly libraries


I try to add some blochy libraries to openHAB3.
In the manual it is sayd to be done via ‘settings’ → ‘automation’ → scroll down to blocky lybraries.

But under the automation tab I only have 3 options:

  • JSScripting
  • Groovy Scripting
  • JRuby Scripting

So is there an other way to download extra blocky lybraries?

These features have been added over time. You probably are not using a recent enough version. Which version of OH3 are you using?

I think the newest: 3.3.0 (windows 10)

It is under Settings → Addons → Automation

I recently wrote some docs about the settings which you can find here:

Settings->Addons 3.4.0

@stefan.hoehn : Do you know why some community threads appear as blockly libraries? They only appear if unpublished add-ons is enabled. (see below: The last one is just this thread)

It actually doesn’t happen on my side - I am on 3.4.0 RC1 . Maybe it was fixed lately?

My guess that it somehow filtered by the entries provide at Block Libraries - openHAB Community

where normal threads shouldn’t be…

@ysc Do you have an idea?

These threads are improperly placed in the Add-on Marketplace category. I missed that mistake initially on this thread, but I’ll fix it now. Any topic in the Add-on Marketplace sub-categories is assumed to be something that should be available in the UI. These extraneous ones, don’t have the correct tag so they are not “published” and only appear if you have the show unpublished option set.

Edit: I’ve fixed the other one too. Both of those should now not appear in your marketplace.

just read the reply of @JustinG and checked with and without unpublished add-ons: Everything looks fine now.

Good to know, Justin, can you point me to the UI code where this is being queried? I tried to find it but couldn’t.

Most of the marketplace implementation is in the core code:

But the UI implementation of it is on the addon-store page:

1 Like

Thanks, found it!

I’ve just installed and tested some block libraries and now I want to remove them. How can I do this?
I cannot see any ‘Remove’ or ‘Delete’ button in the openHAB menu.

Go to Settings->Automation, scroll down to “Block Libraries” and click on remove to remove the block library:

or click on Developer-Tools → Block Libraries, click on "Select! on the upper right corner, click the checkbox of the library you want to remove


and then “remove” on the lower left corner.

Thanks, but I didn’t install my block library this way. I used “Developer Tools > Block Libraries > Add”, so your suggestion won’t work for me.

Did you try out the second option I described above? I just added a lib via “Developer Tools > Block Libraries > Add” and then removed it again without a problem with the second option I described above.

Yes, but I don’t have any “Select” checkbox next to the library name. Believe me, I tried to find this checkbox for a very long time, but it is simply not there. I even looked at the raw HTML code with the same result.

However I’ve just found the solution to my problem.
I used this method: “Developer tools > API Explorer > ui > DELETE”

By the way:
I know that this particular block library can be installed from Settings > Automation > Block Libraries, but I did it another way, so when I tried to re-install it from the Settings > Automation > Block Libraries I received an error message:
[ity.CommunityBlockLibaryAddonHandler] - Block library from marketplace is invalid: Cannot add UI component to namespace ui:blocks, because a component with same UID (deibich:blockly:dateTime) already exists.

I like to investigate it:

Can you please show me the same screen like mine above with all entries below:

First with the SELECT label and then when the select has been pressed. Are there any checkboxes beside other libs?

Unfortunately, I’ve already removed it, so my block libraries list is empty. When I add a new library it works fine now, so I cannot replicate the problem.
However I might have a clue of the root cause: when I deleted the block library using API Explorer one of my rules stopped working. I was sure I cleaned my rules from that library, but it looks like I was wrong.

By the way, I think the “Select” link in the upper right corner is very unintuitive and I must have spent some time trying to display the checkboxes for the first time. IMHO all checkboxes should be visible all the time. Maybe you can consider this change in the next release :slight_smile:

I agree that the “Select” approach in to right corner can be easily overlooked. However, this is a central mechanism on many pages and therefore would mean a general change on the UI (which I haven’t implemented). I new approach would probably need a bit more of a discussion how to better do it. I would recommend to open an issue for that (but not related to this page but in general on github).

You can also start the selection process by ctrl + click on any element when on any of the list pages. I don’t use the blockly libraries, but it is true on all the other pages so I assume it is true there as well.