Are the demo configs source controlled in Github?

While helping on another thread I went looking for the demo config files. I thought I found them at https://github.com/openhab/openhab-distro/tree/main/distributions/openhab-demo but there are no JSON files there meaning at a minimum the MainUI stuff is missing. But the demo shows other stuff like Items are managed so I don’t think those files are relevant at all.

So I’ve two questions:

  1. Is the demo config on gitHub somewhere and I just can’t find it? Or is it maintained independently?

  2. Are the demo files I found still relevant? If not shouldn’t they be removed?

The idea was to also add the content used on the demo server to the archive.

See:

1 Like

OK, but the MainUI Pages are not in there, at least not yet? All that’s in the demo distro now is the conf folder.

Thanks!

Yes if someone provides the files used on https://demo.openhab.org/, then we can add them to the archive. Perhaps @ysc can help with that? :slight_smile:

You mean the JSONDB? Because the main UI pages and HABPanel config are there, so I’m not sure how that works (which reminds me I still have to update the HABPanel docs…). The rules I added including the Blockly one and I think even the items are now managed in the JSONDB.

I never did the markers on the first floor of the demo floorplan page, and maybe there would be some changes required for the demo scripts as well.

Yes.

The way I do is is I capture both my conf folder (which has almost nothing in it any longer) as well as relevant folders from userdata in my git repo (the rest added to the .gitignore). For the demo I suspect that all that would need to be captured are the JSONDB files and perhaps what ever file the demo user is defined in.

Before I ran OH in Docker what I would do is clone this repo and then softlink the conf folder to /etc/openhab and the userdata to /var/lib/openhab but now with docker I just mount the two folders to the right place as volumes.

Editing and updating is a little awkward for sure but it seems better to suffer a little awkwardness than to not have the demo source controlled at all. To do it properly you’d have to spin up an OH instance with the configs supplied, edit through MainUI or the REST API, save and then commit. But openhab-core was updated so it preserves the order of entries now so the diffs between versions will make sense and not get cluttered with a ton of “fake” changes because the file got saved in a different order.

Thanks Rich, this is a very valuable insight as ever. The demo server doesn’t use Docker rather the DEB/APT packages but I would suggest something like this going forward:

  • create an official demo repository (openhab-demo) containing all necessary configuration, so everyone can contribute to the demo, without figuring out it actually being buried In the distributions files to work
  • do some script magic to apply this version-controlled configuration (the official one described above or anyone else’s, really) to a (cold, ie. not running) instance, checking versions and compatibility etc.
  • do that regularly on the demo server (demo.openhab.org) - note that this server is not managed by the openHAB project itself, rather by the openHAB Foundation non-profit which still accepts memberships and donations.
1 Like

In the meantime, I finally SSHed to the demo server and zipped up the pages & widgets from the JSONDB, you’ll find them here: https://demo.openhab.org/static/uicomponents-20230722.zip

Just unzip them in your userdata’s jsondb folder (on a fresh instance as it will replace your existing ones).

3 Likes

Awesome! Thanks! With this we can start to figure out a structure for a new demo repo as suggested above.