Here is my use case:
Whenever I install a binding that auto discovers things, I like to create an *.items file that contains all the possible items. I start with many items and once I get a better understanding about what they do, I remove some of the items again.
Is there any way (besides using Visual Studio) to create this file or the content automatically?
Let’s take a look at an example, here a Shelly device:
In this case I’d like to create 4 items.
PS: I started to build a small web application that allows me to select the Thing for which I want to create the items, but I’m confused on how to detect the item type. For example I see values like “Number:Time” which is not allowed for a *.items file. Fun fact: The REST API provides more channels than displayed via PaperUI (see below)
I love this forum and the guys who support Thanks a lot, learned something new.
So far I’ve finalized my own tool, which runs inside openHAB as static html page.It even sets the labels correctly, see screenshot below.
Does it make sense to share it here?
uhm… this goes beyond my expertise I know how to use it as an enduser (clone, create issues etc.) but I need to check how I can create my own repository. would you be willing to help? we can do it in German
It looks like you are basing the Item names off the channel names. How would that work with a second Shelly? You cannot have 2 Items with the same name.
I’ve modified the sample a bit so you can add a “leading” string to the item names. see screenshot. Taking a look at the example I think something like PLUG1_NETWORK_SSID is much better than something like: MIIO_GENERIC_0723B6D1_SSID. Do you have any other suggestion?
Btw: In regards to items names the documentation says
The only characters permitted in an Item name are letters, numbers and the underscore character. Names must not begin with numbers. Spaces and special characters are not permitted.
I tested it with bla, _bla, and 1bla and all of them worked like a charm.
You need to ignore the INFO lines as I was just testing something.
I know I am a little late to the party but there is a HABApp feature which allows just that.
You even can use various fields from the thing as an input for the item name, label, etc…
Additionally you can even set the configuration parameter for all things, so it’s easy to share e.g. z-wave configurations.
It’s really neat - I recently bought 3 more PIR sensors and all I had to do was give them a proper thing name.
The rest happened automatically.
Definitely, I had an idea very similar to this, And at the very least it give people something to spring board from, even if they don’t use it exactly as you designed.
I was planning on writing something VERY close to this in python this weekend, to let me overhaul my item config. This is sooooo close.
js is not a language I work with (yet), I am going to play around with this this weekend tho. I personally will need to also add a leading string to the Label for my use. Dunno if that is something others would want/need. If I do make that change I’ll make it optional and submit a pull request.