Hardware: Fujitsu Futro S920, Proxmox and OH is running on LXC, NO openhabian
OS: Debian 11 “Bullseye”
Java Runtime Environment: openjdk version “11.0.18” 2023-01-17 LTS
openHAB version: 3.4.2
Issue of the topic:
I have been trying to edit my script files via VSC for several hours now, as I find it is much easier to program and access.
My approach so far:
Samba installed, user added, folder shared: works
Folder mounted in Windows as network drive: works
In VSC installed the extension Openhab, API setup etc: works, I have access to all Items and hings in the VSC.
What does not work is I do not have access to my files because the folder /etc/openhab all exist but are empty. Where are my scripts, page settings etc saved?
Blockquote I think he meant the file based scripts, since he mentioned VSC.
It depends on where your OPENHAB_CONF directory is.
That is also empty. All folders in openhab_conf are empty (only readme.txt), but my openhab is running. I would like to change my existing scripts or design them with VSC. See here:
The items and my model are recognised by VSC (it works)
As you mentioned page settings as well, I assume you are talking about exising scripts created in MainUI, loke your page settings.
Those are stored in JSONDB under userdata and cannot be edited via external tools like VSC. At least, not while openHAB is running.
I think some clarification is required. You’ve found the right folder, but as @glhopital and @hmerk noted, anything created in the UI is stored in JSONDB and can’t be edited with VSC.
If you want to use VSC, then you have to create text files that have the appropriate extensions (.items, .rules, etc.). You haven’t done that, so the folders are empty.
Note that you can’t create Pages with text files. You can only create the older BasicUI sitemaps.
You can use both text-based and UI-based configs at the same time, but that can get confusing. We generally recommend that new users try the UI at first to explore its functionality, and switch to text-based config if they find the UI too limiting.
Note that we have experienced developers who have completely switched to UI configuration, in part because of something you mentioned earlier: “easier to program and access”. While VSC is a familiar environment for many developers, Blockly is a very friendly visual interface and is regularly gaining new functionality (because developers with advanced needs are using it). Perhaps more importantly, you can make edits to the UI from any web browser and from any location (via myopenHAB cloud access).
And they are actually saved in userdata/jsondb/ this is not locate inside conf. Feel free to look but as others have mentioned, don’t modify this while OH is running. You can commit this to git for versioning / history, if you like.