Detecting a thing - how to use as item?

Hello guys…
when I discover etc a new hue bulb, I find it in the paperui, and can add it as an item here… but how do I deal with that when programming offline rules? I mean it’s not defined anywhere in my config files, only online…

All Items, no matter where they are defined, are available in Rules, Persistence, and the UIs. Just refer to the Item by name as you would with any Item created in a .items file.

Note, that a Thing is separate from an Item. If you are not using Simple mode, you need to create the Item and link it to one of the Channels in your automatically detected Thing. If you are using Simple mode, an Item was automatically created with the same name as the Thing’s Channel ID with the “:” replaced with “_” (I think).

So if your Channel ID is zwave:device:dongle:node2:switch_binary then the automatically created Item would be zwave_device_dongle_node2_switch_binary.

Okay… I don’t use the simple mode, so when finding the thing, I can pair it to a item or create a new one… if I create a new one - I can’t see it anywhere in my item files?

No. It gets saved to the JSONDB along with all the Things that were autodiscovered or created in PaperUI.

Okay… so basically it’s a little mess then, since it wouldnt be shown in the offline config files - what the names are… But when using the VS code plugin, it should be shown there as a item?

Yes. As long as VSCode is properly configured and connected to your running OH instance then all Items will be shown whether they are defined in .items files or through PaperUI.

Because of the different places and ways that Items can be defined, we usually recommend picking one and sticking with it. If you will be dealing with tags (Google Assistant, Alexa, Hue Emulation) or OH 1.x bindings this means only using .items files for now.

I plan to move on to oh2 bindings mainly, since the knx Addon is updated to version 2…
maybe I should focus on using things as primary, and then secondary use items?

When looking at the documentation, knx items can be added as both a thing and a item - but it’s only nessecary to add them once in the things?
If also adding it in the item file, it just creates a link between them - could be nessecary when “bridging” between different things?

The things can also be used in rules like items? Correct?

I don’t understand this. Things and Items are different. All the UIs, all persistence, and all Rules use Items, not Things. It isn’t an either or situation. You must use Items and Things.

No. Things are how the Binding represents the device to OH. But Items are how you represent the device in your home automation. Things represent the devices. Channels represent each individual control point or sensor data. Items link to Channels to expose that control point it sensor data to the rest of OH.

I recommend reviewing the Concepts section of the docs.

No. Only Items can be used. You need both Things and Items.

Okay… I’ve read the section, and I understand the concept now…
only one thing I find strange, in oh1.x mode for Knx a item was just created in the item file And had the knx Adresse linked there…

Now, it’s much more work? First it must be created in the thing section, and after that linked to an item before etc a binary switch can be used from knx?

I don’t know once but for most bindings it’s much less work because the Things are created automatically through discovery. So all you do is accept the discovered Thing from the Inbox and link it to your Item. You need never have to deal with hardware addresses or anything like that. I don’t know if KNX is unusual in that it doesn’t support discovery but pretty much all of the rest of the 2.x version bindings do and it is a whole lot easier. Things is what makes discovery possible.