Hi community
I have an oh instance with currently >90 things and >300 items. I want to go from UI definitions to text based defnitions, which requires a lot of work if you do it “by hand”. No way - we need automation
(Reason behind: Mass update of item metadata - waaay easier if you have .items instead of JSONDB)
I eventually found JSONDB items to textual config which can convert items from the JSONDB. But it lacks 2 important features (at least for me):
- it cannot convert things (I don’t want to create 90 things by hand…)
- it cannot add item metadata for channels and widgets (I already put a lot of effort in widgets and have a lot of transforms by regex or MAP)
This was reason enough to create my own version of a things/items converter. Since I am a windows guy, it’s written in Powershell. It converts the JSONDB files to PS-usable objects using custom classes. Then it uses class methods to convert these objects to the string format required for .things and .items
If anyone finds it useful, feel free to use it. If you have comments about coding or have suggestions on my parameter selection, feel free to leave feedback upon. And if you are a windows guy like me, be invited to create a pull request
As of now, it fully supports all type of things including bridges and thing configuration. And it fully supports all item data including metadata configuration with all metadata configuration properties (like defaut list/standalone widget parameters, transforms and everything else).
Currently I have 2 quirks I don’t know how to solve:
- Thing channels reporting false default configurations
Until now, I configured everything through the GUI. In the JSONDB things file, I pick up the channel configuration. For one specific homematic device type, after importing my alltings.things I get
23:38:16.166 [WARN ] [nternal.handler.HomematicThingHandler] - Value for datapoint HmDatapoint[name=CONF_BUTTON_TIME,value=255,defaultValue=255,type=INTEGER,minValue=1,maxValue=254,options=null,readOnly=false,readable=true,unit=minutes,description=CONF_BUTTON_TIME,info=null,paramsetType=MASTER,virtual=false,trigger=false] is outside of valid range, using default value for config.
This specific Homematic thing has written this value of 255 on its own to the things JSONDB file for whatever reason… Excerpt from the Thing.json:
"configuration": {
"HMP_-1_CONF_BUTTON_TIME": 255,
It already tells me that the defaultValue seems to be 255 but the maxValue is 254 only
How can I get around that? Stupid implemetation?
- Shelly devices behave weird
I have two Shelly1 in my setup. Both are recognized as ONLINE after importing my custom alltings.things. Setup is kinda like
Thing shelly:shelly1:485519c90a33
In things of the OH UI, both things show up as online. But they also show up in the inbox wih a different ID:
Thing shelly:shellydevice:485519c90a33
If I edit the allthings.things and in the UID replace “:shelly1:” with “:shellydevice:”, the inbox gets empty, but both things now show up as ERROR_HANDLER_MISSING. If I then change back the UID to “:shelly1:”, the inbox stays empty, and both things show up as ONLINE. WTF?!?
Thanks for any hints about those 2 issues - although both are minor, I love code that works “completely”