How to edit rules created in OH3 UI using MS Code


again a stupid question: I have my OH3 setup pretty much completed, with all my blinds, bulbs etc. now being controlled. Everything really nice - big time kudo’s to everyone involved in designing and developing this great system!

By now I have been managing all this using the graphical frontend. But as I am now starting to look into more complex rules etc., I’d rather want to do this using MS Code. Thus, I need access to my existing rules, things etc. via file system.

But both in the mapped drives on my PC and directly on my PI4 the directories for rules, things, items etc. are all empty. Is this due to missing authorisations?

No, it’s because they are empty. When you use the GUI to makes Items, Rules etc.there are no files created, they get stored in internal JSONDB instead.
You can access that via REST API (that’s how the GUI does it) but I doubt MS Code will like that.

aha - that was’nt clear to me, thanks. But I can do both in parallel, right? I mean, I can e.g. maintain my things and items with the UI, but add new rules as files?



If you plan on using Python/Jython check out Ivan’s Helper Libraries - OH3, Python, JavaScript

I’ve also made Python stubs so you can get hints for everything right in VSCode (link in the above post).