Create item-files from PaperUI

Maybe a strange question, but can I easily create item files from PaperUI items/things?

Before, I used item files (happy with them), and now, I use PaperUI (go with the flow?).

Today, I’ve added ‘Google Home Assistant’ to my installation. And this works with the tag field.
In the item files, this can be added quickly. But with PaperUI not.
Or I should go over RestAPI. And this isn’t working as supposed. Tags are added, but google doesn’t pick them up.

So I’m thinking of going back to the good old item files.
But before creating them manually (not sure if I still have an old backup), you guys don’t have an idea to do this (semi-)automatically?

Not a strange question. You are not the first one to ask.
The tags options in the creation of items in the paperUI is not working
If you intend to use tags for integration with Google or Alexa, I suggest that you stick with text files definitions.

If you are used to text files definitions I suggest that you stay there for several reasons

  • You can arrange them as you like by relevant files and functions
  • Its easy to read, find an item and change it if needed
  • You can use legacy bindings like mqtt or even autoupdate
  • It is overall far more flexible than the paperUI

I only use the paperUI to discover Things with a binding and general config

I know of no way to do this semi-automatically. It shouldn’t be too terribly hard to write a python script to parse the JSONDB files and create Items from that.

The REST API could probably also be used in the same way.

No matter whether you do this automatically or by hand, make sure to use this procedure:

  1. Delete any links on the Item
  2. Delete the Item
  3. Only then recreate the Item in a .items file

Failure to delete the link before deleting the Item will result in the link remaining. Failure to delete the Item will result in two Items with the same name. As a result in PaperUI and OH becoming confused and thinking you have two Items with the same name.

So I understand that I must remove the item from the PaperUI before adding it with the item text files.

What about the thing file? Is it possible to use 2 KNX configs?
As I understand, IP, connection-type… must be in the thing file.
Won’t this create conflicts with the service file?

The reason for my question is that I would like to do it in phases. One or 2 actuators today, some tomorrow, some…

And you must remove the Links on the Item before you remove the Item. If you don’t you will have to edit the JSONDB by hand to clear up “phantom” Items hanging around.

I can’t answer the question about Things. I let OH manage all my Things so don’t use .things files that much. I suspect that as long as you don’t have Things with the same ID you should be OK. But I suspect it will be binding specific on the best way to do this. I don’t use KNX so have no advice.

1 Like

Ahhh, OK. So only item file is necessary?
I thought that I also had to create the thing file with the KNX2 binding.

Just did a test, my first item has been created, validated, and a big succes!

Now the other 183 knx item lines… :sweat:
And afterwards, zwave…

1 Like

Do you think that I must also remove the Parent Groups before I remove the item?
Or only the link from the thing towards the item?