I ran into this same problem when wanting to run OH with only the HabPanel ui installed and with editing disabled. I ended up having to (temporarily) install Paper so I could determine how it behaved differently than the console. Here are my findings:
HabPanel UI
HabPanel is fed its configuration from the following file:
$USERDATA/config/org/openhab/habpanel.config
The correct property for locking the editor is:
lockEditing=B"true"
NOTE: The 'B'
- This is how the value is determined to be a json boolean (true
) vs a string ("true"
)
Paper UI
Paper UI’s HabPanel configuration updates habpanel.config
directly, and with the appropriate B
prefix
Console
Although config:edit org.openhab.habpanel
can read settings from habpanel.config
, config:update
actually writes the configuration (even if no modifications are made) to a different file:
$USERDATA/etc/org.openhab.habpanel.cfg
This file stores data in a different format. The edit locking configuration is stored as:
lockEditing = true
The data in this new file is then re-synced over to original habpanel.config
NOTE: The following property is also added to habpanel.config
:
felix.fileinstall.filename="file:/$USERDATA/etc/org.openhab.habpanel.cfg"
I’m guessing this is related to the process that does the syncing, marking the file as being derived by habpanel.cfg
NOTE: You can no longer make changes to habpanel.config
It is always resynced from habpanel.cfg
so any changes will be overridden (well, see below)
The Bug
Now to the bug. The reason the console change doesn’t work is because the process that does the syncing codes booleans incorrectly. Here’s what the value looks like after updating from the console:
lockEditing="true"
This ends up being sent to the HabPanel UI as string "true"
instead of boolean true
.
The Quick Fix
Until the syncing process is fixed to properly encode booleans, you can manually fix this as follows:
- Stop OpenHab
- Remove the
habpanel.cfg
file
- Remove the
felix.fileinstall.filename
property from habpanel.config
- Set the
lockEditing
property to either B"true"
or B"false"
- Restart OpenHab
I tested this multiple times before posting. Let me know if it helps you.
I’ll also try to submit a ticket sometime soon and maybe even dive into the code and see if I help find a solution.
Just thinking out loud: Although the syncing technique is broken, a quick look into the habpanel github suggests the field is only used by the front-end browser code. A quick fix could be to let the code be more relaxed and cast a string to boolean …