Rename database table base on the lable instead of the item name?

So I am using JCDB persistance table and the problem is that it name the tables something like binarysensor_0001 instead of the lables I gave each device.

so now I am confused which device is which. is there a way to name those tables based on the labels I gave them?

Do you have simple mode turned on in PaperUI and how did you create your items?

No I don’t have simple mode turned on. never tried. also I normally don’t use PaperUi anyway.
however even if I do, there is an option to give the “thing” a lable and would like to use that to name the tables.

the config file says ui = paper,basic

You can not use both files and PaperUI for the same Thing and you should have seen an error msg when trying to edit a thing in PaperUI after having created it via files.

which file? can you give me the path
I use the Command-line and the rest API to add things.
also all I want is to heave JCDB name the tables as the “lable” instead of the “device name”

/etc/openhab2/things but if you didn’t know that I wouldn’t think you have the Thing created via files.

Not sure what OS your running OH on but you can also check in /var/lib/openhab2/jsondb/org.eclipse.smarthome.core.items.Item.json for items and same for things. If you edit any of these files stop OH first.

I see, I never used those files. however I am interested on how to make the JCDB name those tables based on the labels instead of the itemName

From the documentation:
“openHAB persists Item states in a database, and most popular databases are supported.”

You will need to use the items name for persists and not the Thing or Thing label. If the issue is each item has an odd name then you can create the item in files and give it whatever name you choose. The location for item files is /etc/openhab2/items You will need to unlink the item via PaperUI then copy the channel syntax to use in item file. BTW, using item files is recommended by most users as you can give meaningful names to your items.

my /etc/openhab2/items is empty
is it the same as /var/lib/openhab2/jsondb/sudo nano org.eclipse.smarthome.core.items.Item.json

also I need to know the node and everything beforehhand to use the item file ?

As you said yourself, you used REST API to create your objects. Same way PaperUI does it, and there won’t be any xxx.items files.

Persistence is about Items, not Things. If you are persisting in tables like sensorid1_binarysensor_0001 then that is because you chose to name your Item sensorid1_binarysensor_0001

You can’t use labels for persistence, it works with Item names.