Advice required for making simple linked items editable

Hello,

I am trying to change the simple linking mode of creating items so that it creates editable items that can be added to groups and able to get custom tags. This change is for practicing the core framework and will be used by me to make my life easier when managing things (I am not a fan of textual configurations).

I traced the code and found that, when the simple linking mode is on, there is a ChannelItemProvider that is responsible for looking for state channels without items and create those items virtually in memory. The items that this provider creates are not editable since they are virtual and don’t exist on disk.

To implement my idea without many modifications, I found 2 options,
1- Modify the ThingLinkManager and make it responsible for creating the items and adding them to the ManagedItemProvider before linking the channel with the item.
2- Modify the ChannelItemProvider and make it store the items in the ManagedItemProvider instead of adding them to the internal virtual list of items.

I chose option 2 since the ChannelItemProvider has better tracking of the lifecycle of items and channels and some edge cases.

The modifications are working as intended until now, but I am not sure if my approach will break things in some cases. Any advice from the core developers would be appreciated.

That’s exactly what I was trying to fix.

The current approach of auto linking seems good to me, and it should be the default option for new installations, no more complexity is needed for this part which is already complex.
IMHO, the only problem with auto linking now is that it create virtual items that are not editable.

My modification is working properly until now, and I hope it will keep functioning as intended.

That is not the only problem. And it’s not even the worst problem. The worst problems are:

  • when simple mode is enabled, there is no evidence that Items even exist in PaperUI since the Items menu option disappears
  • you cannot create Groups nor can you create unbound/unlinked Items
  • you have no control over the names of your Items. You end up with Item names like zwave_device_sadfgr3y_node13_alarm_number. That’s completely meaningless to the person and it requires one to keep going back to PaperUI to look up the name of Items when writing Rules or building the sitemap or setting up persistence.
  • almost everyone eventually decides to turn off Simple Mode at some point and then they have hundreds of these Items with weird names they have to delete and recreate so they can give them a reasonable name. We are doing these users no favors by hiding this complexity. We are just guaranteeing they will have a lot of work later on redoing their Items.
  • and we aren’t even really hiding the complexity because it is not at all intuitive or apparent that you need to replace the : with _ to convert the Channel Name to the Item Name.
  • you can’t use profiles, link one Item to more than one Channel, or link an Item to a Channel and a OH 1.x binding config at the same time

I strongly oppose Simple Mode being the default ever, unless most of the above problems are addressed. I’ve spent hours helping users through these issues created by Simple Mode and those users have spend orders of magnitude more time undoing what Simple Mode has done. I’ll say it again, we are not doing new users any favors with Simple Mode.

Your proposal addresses only part of the problem but not all of the problem.

This should be a simple fix, it is also not related to the simple mode, but to the PaperUI.

You can still create groups, but they need to be created using REST since the UI is dissapeared, and when the items are editable , it is possible to add them to groups (I tested it).

Again, this is a simple problem, it can either be fixed by doing a small change in the naming scheme, or the UI can be improved to show the linked thing name under the item name. Also when the items are editable, it is possible to re-label them so you will have a good identifier for the item.

Since I am a UI guy, and I don’t use the 1.x bindings or the textual configs, I didn’t face these problems before.

I am happy to say that, if you are considering people who prefer using the UI, this simple fix helped me a lot with fixing many of the problems I had with simple mode. I also modified the UIs a bit so that they fit my preference (showing the linked thing name under the items)