How OH process adding/delete channels in updated bundle?

Hi,
I try to create custom binding.
What is correct way to create updated bundle with new channels?
I just copy new jar to addons folder but no new channels in existing thing. I can remove thing and recreate again in dev OH instance but how it should work in production?

OH4 added support for migrations. It is quite basic but there are examples in official addons how to do it.

There is also a standalone migrator which does similar thing but on top of jsondb (AFAIR).

1 Like

@splatch no new channels after installing new bundle it is expected behavior?

New channels can appear, there is dedicated descriptor which allows to update earlier definitions: update-description-1.0.0.xsd. It was provided as part of fixes which address migration strategy in general: Update existing Things for definition changes · Issue #1924 · openhab/openhab-core · GitHub.

If you look closer at descriptor itself you will find that it is fairly generic set of instructions which can amend definitions. They are processed when new version of binding is deployed, so you can keep moving forward your definitions as they grow/mature.
You can find examples in official bindings: https://github.com/search?q=repo%3Aopenhab%2Fopenhab-addons+path%3Aupdate.xml&type=code

Best,
Ɓukasz

1 Like

This was also documented.

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.