Howto publish some Block Library?

Hi, just wrote some Block Library to use the NSPanel Lovelace UI with openhab. How to share this library? I have found some information about how to write some Block Library, but none about howto share these. Please point me to the right documentation source or give me some hints…

all the best, Rene

I guess you need a new topic in the Marketplace Block libraries category, attach the library’s YAML code at the end of the initial post and add tag
published.

E.g. Astro Events

Hey… do you check About the Add-on Marketplace category ? As example… this is my lib post: Block Libraries - openHAB Community And the related Git Repository: GitHub - lochmueller/openhab-block-libraries

Perhaps this helps,
Tim

One of the topics in this category is an annotated example:

Thank you all for your input. Some of the resources had been new to me, but still only the Tutorial suggested by @JustinG contains some sparse information. Some questions are still open:

  • is the publication of an BlockLibrary some automated process or is the forum entry checked manually by some Admin and copied somewhere else?
  • maybe related: how are code updates handled? If I provide the code via a " direct link to a *.yaml file hosted by [my] preferred service", will the (openhab marketplace) accessible version of the published file immediately change when I change the hosted file?
  • How to release a bundle of multiple BlockLibrary files, which are required to be used together?

Thanks for your help, best regards, Rene

As long as the post is formatted properly, given the correct tags, and in the correct category it will get automatically parsed and added to the Add-on store.

There seems to be very little lag in this process, so changes made to the original post will be re-read fairly quickly and, in my experience modifications either of the code in code fences or the directly linked resource will be available shortly after the post is modified.

I don’t use block libraries, so I don’t know what capability there is for combining them into one file, but right now all such marketplace contributions are limited to one file. There are several discussions about if/how to allow full bundles but right now that is not possible. Your best bet under those circumstances is just to make the initial post as clear as you can about the dependencies and how to ensure they are installed.

On a related note, the actual MarketplaceLibrary category should only be used for posting the actual entries. Discussion such as this should be in a more general category. I’ve moved this one for now.

Hi, thanks for moving this to the right category and for your helpful information.

The limitation of the marketplace contribution to one file per library is a real drawback. Every yaml can only contain the description of one section in the blockly toolbox, therefore any bigger project will require multiple files. Still unsure how to handle this situation, it does not make sense to publish 5 Block Librarys for the required functionality of my add-on (openhab-blockly-nspanel).

Can you point me to some of the mentioned discussions about the option to use bundles?

Best regards, Rene

It was an issue filed on the core repo a while ago. It hasn’t gone anywhere recently.

Hmm, thanks for this link. Seems like I have to publish five blockLibraries than, if that’s the way, that’s the way. Just finishing some documentation, than it will go live. Best regards, Rene

Hi,

published the libraries now as NSPanel Helpers ff. and cross-referenced all of them.

There is still some issue with the icons. I just added these as

logo

![logo](https://raw.githubusercontent.com/absorb-it/openhab-blockly-nspanel/0.2/docs/img/marketplace/nspanel.png)

and the logo is displayed in the post itself, but not in the blockLibrary overview and not in openHAB when searching for the add-on. Any idea what went wrong?

Best regards, Rene

I’m afraid I don’t know. I know that I’ve had no trouble with the marketplace logos I have added, but I always paste the images directly into the post instead of linking to offsite images. Maybe that’s the problem?

Hi,

just replaced the logo with some local uploaded image. Now I can see the logo in the marketplace webpage overview, maybe in a while also in the openHAB application. Thanks for the right idea,

best regards, Rene

And the story continues…

Just realized today, that the addon, which can be found in the openHAB automation section, is not updated at all. I changed the publication post last week to point to some dedicated release in github (instead of main branch), which is still not reflected by any links in openHAB application. The icon is not there, and the current change to a new release is also not shown in openHAB automation results. Seems like the page is not updated at all…

Do I need to set anything or change anything in the publication post to get the page refreshed?

Best regards, Rene

That certainly didn’t used to be the case. In my experience, edits to the marketplace topics get picked up and propagated to the marketplace fairly quickly.

When I look at an entry in my add-on block library section (e.g. your part 1/5) it looks entirely correct. It matches the version on the forum and links to a 0.3 release page not the main branch of your repo.

Are you by chance using firefox? This could be another symptom of the firefox page caching issues that are becoming very common.

Hmm, using Firefox, but the same issue is with Chromium or Opera. The Information page of the add-on says:

  • Created At December 14, 2023 6:41 PM
  • Updated At December 14, 2023 6:58 PM

and the links go to the main section. Same after disabling Firefox cache and after restarting my openHAB instance with cleaning the local squid cache. So still searching for the issue…

Regards, Rene

Strange. It’s definitely local to your system, whatever it is. Mine shows the correct edit date as well as the updates themselves.

Good to hear that - the issue pointing to the main branch instead of the tagged releases was really giving me some headaches. If error reports come in and you have really no idea what in-between version people are using, ohoh…

Ok, I will check what might be the issue on my side and post it here when resolved.

Thanks and regards, Rene

Some things I’ve done with my rule templates might help with this:

  1. Add a comment somewhere that shows the version number. You can tell users to look for that and tell you what version they are running.
  2. Add a debug or trace level log somewhere that logs out the version number or relevant version numbers if there are dependencies (e.g. my rule templates often depend on recent versions of the openhab-js library and openhab-rules-tools library).
  3. Add checks where possible and generate meaningful error messages if version numbers are not up to date.
  4. Religiously keep the version list on the post up to date (with 1 and 2 a lot of users will realize they need to update on their own).

Not all of these are possible for widgets and blockly libraries but some might be useful.

Thanks for all the suggestions. Finally got my add-ons updated and I can see the real version with the right links now. But I had to remove the previous ones again (as I did this afternoon already) and re-add them. Now I even see the Icon, maybe that’s it than.

One thing, how should some update happen? After I release some new version, will this get indicated to the user in any way? Will there be some update-button? Is the Changelog section somehow parsed? Or is removing and re-installing the way to go? The version-information in the JSON retrieved while opening the automation-addon-page for my libraries is empty:

{"uid":"marketplace:152029","id":"152029","label":"NSPanel Lovelace UI Helpers (part 1/5)","version":"","maturity":"beta","compatible":true ...

Best regards, Rene

Unfortunately no, but I’ve opened issues to improve this.

For now users will need to pay attention and manually update by removing and re-adding.

I think that is the intent eventually but not right now.