Naming Channels

Newby here. I have installed some bindings and attached some things. I selected Simple Mode so channels are automatically created. Now when I want to use the rules engine to create a rule I see that I have 2 devices both called “Switch”. I searched for an answer and it sounds like Simple Mode makes it so I can’t change the names of my channels? Or rather, it names them and once they’re named I can’t change the name?

Also, I see stuff about items but don’t see any place where items are in PaperUI. Is an item the same thing as a channel?

That automatically creates Items linked to Channels. Most everybody here does not use Simple mode. It make the configuration complex and sets unintuitive Item names.

Just set up and link the channels you wish to monitor or manage.

No no no. Things belong to bindings, i.e are models of external devices and services. channels are the link, the data pathway, between Things and Items. Items are openHABs internal models of simple “devices”.

3 Likes

Thanks, so I can turn off simple (not so simple) mode. How do I back out of this? I have only installed a couple of devices. Should I just remove them and start over or can I fix this fairly easily once simple mode is turned off?

When you turn off simple mode an Items menu item will appear. You can delete the Items that simple mode created from that menu. There shouldn’t be that many unless your Things have a ton of Channels. If you have a whole lot of Items, you can edit them out of the JSONDB manually as a last resort. But doing so can be tricky so only consider that approach if you have a whole lot of Items to remove.

  1. stop openHAB
  2. sudo openhab-cli backup
  3. delete /var/lib/openhab2/jsondb/org.eclipse.smarthome.core.thing.link.ItemChannelLink.json
  4. delete /var/lib/openhab2/jsondb/org.eclipse.smarthome.core.items.Item.json
  5. start openHAB

This will delete all the Items and all the Links between the Items and the Channels. You need to get both or else you will have zombie Items hanging around. This will delete ALL of your PaperUI defined Items.

Hi,
Interesting reading.
I’m now running OH 2.5.2-1 on RPi4B with 30 nodes. All nodes were included using PaperUI with Simple Mode enabled. For each node included I made sure to disable all PaperUI generated Items by turning all blue buttons OFF, whereafter I added only required Items to my .Items file using the PaperUI channel IDs.
Question is if I also managed to add zombie items this way, and if so, how can I check that?

One node discovery failed for some reason (probably not known to the database) and info on that node ended up in the “org.eclipse.smarthome.config.discovery.DiscoveryResult.json” file.
Can I just delete the file to remove that Thing from the inbox, or…?
Thanks.

Either you are missing telling us a step or there is a misunderstanding here. The “blue buttons” just show if one or more Items are linked to a Channel. There is no “on or off”. It’s not a toggle. When you click on it you will see the name of the Item linked to it. To remove the link you click on the trash can.

This only removes the link! To remove the Item you then need to go to the Items section of PaperUI and click the trash can icon. Items defined in .items files will not have the trash can icon.

It will probably show back up again next time there is a scan by that binding. Click the eye icon with the line through it to ignore the Things.

Sorry if I am confusing you, but the blue buttons do have a toggle function (just try). If you hit the button it either turns the channel OFF and the item disappear from the PaperUI Control page or vise versa.
So, back to the first topic entry: The two Switch devices discussed there could be caused by not clicking the blue button OFF before adding the same channel to an item in the Items file. If both are active two Switches will appear on the the PaperUI Control page, which could be the case for fullmoonguru if he has put a Switch item in the Items file. I have seen this multiple times.

So to my question: Is there then a chance that I have managed to add zombie items this way, and if so, how can I check if I have?

I did, though I didn’t have to. I’ve been using OH since before there was a PaperUI.

Clicking on the blue button

It just shows the linked Items.

Let’s look at a a channel that doesn’t already have an Item linked to it. There is no toggle.

It brings up a dialog to link an Item to the Channel. There is no enable/disable.

There is no way to enable/disable a Channel in PaperUI. As far as I know, there is no way to disable a Channel at all. It either has an Item linked to it or it does not.

I can’t answer your question without first understanding what you did.

That’s OK. Let me try to explain better:
I have an RPi3B+ test setup running OH 2.5.2-1.
I added a Metered Switch using PaperUI with Simple Mode enabled. This caused all channels to be linked, and made the Items visible in the Metered Switch window on the PaperUI Control page.
The Thing page for the Metered Switch shows all blue buttons enabled (inner circle filled white).
If I now click a button (the Switch channel) the inner circle turns blue, and a message in the lower right page corner displays Channel Unlinked for a few seconds. The toggle works and the associated Item disappears from the Control page.
I then toggle it back to white and the lower corner message displays Channel linked.
Keeping it linked I open the .Items file, build an Item linked to the Switch channel and load the file.
The blue button stays white, but the PaperUI Control page now shows 2 Switch Items like Fullmoonguru saw.
Hitting the blue Switch button again keeps it white like you say, but the lower corner message says Channel Unlinked, and the Item linked by Simple Mode disappears from the Control page. So, only 1 Switch Item left. The toggle works, and hitting it again now displays a 404 error message indicating Item locked by the file.

So, to my case:
When installing and setting up all my 30 Things/Nodes I had Simple Mode enabled.
I clicked all blue buttons to unlink the simple mode channels and linked them using my .items file.
I guess using the Simple Mode was kind of stupid, but that’s what I did (new to OH).

Therefore my question: Has my “stupid” method left any simple mode traces behind (in files?) that can affect the functionality and/or stability of my system over time?
It basically boils down to this: Can I trust my current OH setup to take care of my home if I’m away for n days assuming no failing Things?

These are basically incompatible. Simple mode creates Items for you, for everything, wanted or not.

xxx.items files are “manual control”. Nothing you do in PaperUI will affect how these Items are configured.

There are no precautions stopping you (or simple mode) linking a channel to multiple Items, because it is a legitimate thing to do on occasion.

You’ll end up with duplicate Items and much confusion.

OK, that only occurs with simple mode. For a whole host of reasons we strongly recommend against using simple mode.

Click on the blue button doesn’t enable/disable the Channel. It Links/Unlinks the Channel to/from an Item. In simple mode the Item is created for you automatically. This does not delete the Item as far as I can tell. It just eliminates the Link between the Item and the Channel.

Only those Channels that have a Link to an Item appear in the Control tab.

Again, removing the Link does not remove the Item. Those automatically created Item are still there. When you turn OFF simple mode (please do) there will be a new Items entry on the left in PaperUI. Assuming you have unlinked all your Items from the Channels, go through the list of Items an delete any of the automatically created Items. These will be named the same as the Channel ID they were linked to with the : replaced with _.

This isn’t a stability problem but a configuration management problem. You don’t want a bunch of Items hanging around that don’t do anything because you may become confused in the future remembering which one is the “real” one or accidentally start using one that doesn’t do anything.

Wow!
Now we are talking. That was very very enlightening!

I checked my running system and there are no Items in the list with : . They all have _, which should mean no confusion. Hence, my running system should be as healthy as can be (I guess?).

BTW: Here is a quote from the New User Tutorial: “activate the “Simple Mode” slider and click the “SAVE” button”. Was confusing me!

Thanks a million for a Very helpful discussion.

It is not permitted to have colon : in Item names.

Channels will normally have colons in their designation (UID) because it’s defining one of several pathways to a Thing
Items are not channels. Items may be linked with channels.

I think I understand that a Channel ID could be “zwave:device:2cd77553:node2:switch_binary” and the associated Item name generated by Simple Mode would then be “zwave_device_2cd77553_node2_switch_binary”, of which I have none.
In an .items file the Item name could be “Kitchen_Light_ON_OFF” with the above Channel ID.
Am I in line with you?

That’s correct. And please do use reasonable names for your Items like your example, though the _ON_OFF is probably unnecessary and I would omit it.