I made a small tool which can convert JSONDB items into textual config items: JSON2Config
Why not use the REST API as a basis?
Correct me if iām wrong, but the REST API returns all Items - including the ones already present in textual config files. Itās intended to just convert the items from the JSONDB.
I thought they were all present in JSONDb too but I could be wrong.
Your not wrong .
All items are stored in org.eclipse.smarthome.core.items.Item.json
, no matter how they are defined.
I, for example, use only .items files currently (waiting for OH3 to switchā¦), and they all show up in the ādatabaseā as well.
OK, what is the purpose of this then?
Major point of doing this I would see in making a versioned configuration in a file which fits into SCM.
To be fair I was thinking about similar functionality as my laziness is telling me that I do not want to write by hand results of discovery just to have a full control over cfg.
Good job @voruti!
Perfect timing.
Iāve got an issue wth something, somewhere that is causing my OH2 to restart erratically.
So Iām going to export everything.
Wipe the whole machine and start again.
(I want to swap OS anyway)
Thanks for taking the time to create this.
Have you checked for invalid addons in addons.config
? That causes addons to reload every minute.
Thanks Bruce
I hadnāt, but I will.
Something causes a problem very randomly.
Iām leaning towards it being the HEOS or ChromeCast bindingā¦
But after playing with the settings for over 2 weeks, I think a complete wipe is the order of the day.
As the same core configuration has been running since the 2.3.x days
Are we talking about the same configuration file sftp://openhabian:@openhabianpi.fritz.box/var/lib/openhab2/jsondb/org.eclipse.smarthome.core.items.Item.json
(in my setup)?
Before I converted them; the items in this file were only those, which I created with PaperUI, not the ones from the .items files.
In the .items files for example I created a group for every room in the house. These do not show up in the JSONDB.
My badā¦ I had a quick look at the jsondb file and saw a lot of Items. I never used PaperUI, so I jumped to the conclusion that the items are mirrored there.
However, I forgot that I recently started creating a lot of Items dynamically (in Jython rules/scripts). And that are the ones that show up in the json db file, not the āstaticā ones in .items
files.
Sorry for the confusionā¦
This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.