Deleting items, links,

Hello,

I want to have the full control of my items and their links to the channels. But after some work openhab2 showed me also “old” or “auto items”. I switched off the “item linking” and tried to delete all items and links with karaf. Only the items in my.items file have to be active in the future. But when I tried out smarthome:items clear or smarthome:links clear the system accepted the command but nothing happened. The items and links are still active.
So what is the trick to have only the values from the my.items file active?

Thanks

Did the 2 karaf console commands provide any feedback?

Example:

openhab> smarthome:links clear
26 links successfully removed.
openhab> smarthome:items clear
161 item(s) removed successfully.
openhab> 

Yes Karaf Displayed this Messages. But when I display this list after it, all items or links are still listed.

openHAB 2 will re-read your .items file(s) and display the info correctly afterwards.
It should not create any new items and/or links that you have not defined manually in your files if you have “Simple Mode” disabled in Paper UI -> Configuration -> System -> Item Linking

Can you post your “my.items” file to check the syntax?
Have you defined links to the channels there?

This is the value of my item file

Group gThermometer <termature>
Group gBatterie <battery>
Group gRauch <fire>
Group gHitze <temperature_hot>
Group gNode2 <groundfloor>
//=================================================================================================
//
// Definition von Variablen
//
//=================================================================================================
// für Variablen Node 2
//=================================================================================================
Number Node_2_Temp 		"Temperatur [%.1f C]"  <temperature>	  (gThermometer, gNode2)	{channel="zwave:device:252cfaa7:node2:sensor_temperature"}
Number Node_2_Batterie 	"Batterie [%d %%]"     <battery>     	  (gBatterie, gNode2)		{channel="zwave:device:252cfaa7:node2:battery-level"}
Switch Node_2_Smoke     "Rauch"				   <fire>      		  (gRauch, gNode2) 			{channel="zwave:device:252cfaa7:node2:alarm_smoke"}
Switch Node_2_Heat      "Hitze"				   <temperature_hot>  (gHitze, gNode2) 			{channel="zwave:device:252cfaa7:node2:alarm_heat"}

And this is the value of paper UI

When I switch the Item Linking to the other side and save this new value, nothing changed when I send the statements in karaf again.

If you want full control, disable "Simple Mode"
You have it currently enabled
Anyway, this setting affects only new Things (not existing) and their associated items and links

The output of your karaf console looks to be ok
After you deleted the already stored items and links, your “my.items” file was re-read and the correct items and links were re-created.

Example: Node_2_Smoke is manually linked to the zwave:device:252cfaa7:node2:alarm_smoke channel
This is what the karaf console shows and it is correct.

I don’t see in your “my.items” file anything related to “RM_2_Temp” and “RM_2_Batterie”…
Do you have them in there or this is the issue? (that these 2 items should have disappeared but they haven’t?)

RM_2_Temp and RM_2_Batterie were old named items. I renamed them to the new one and saved the file. They are not in my.items file anymore - they are renamed in Node_2_Temp and Node_2_Batterie. The question is why does karaf show me the old ones again and again?

I think I solved the problem with a restart of openhab. After it all vales were killed. So I have to restart my system when I use such commands in the future.
Thanks to all

1 Like

hmmm… that’s strange… (and you are running a very recent version of OH2 Snapshot (642)
In my system, when I delete the old items and links from karaf… they go away :slight_smile:

check in your /var/lib/openhab2/jsondb for any stale references of the old items and links…

Hi All,

New openhab user here, just starting to get things going on a test setup, I can confirm the exact same behavior. Stale links are hanging out and are present even after running ‘smarthome:links/items clear’. Restarting my OH service seems to have remedied.

I’m using 2.0.0 Build #743 fwiw.

Hi all
I join in to confirm this (lesser issue):

smarthome:items remove item OG_Bad_Dusche_generic

shows “1 item(s) removed successfully.” but item is still there in karaf as well as paper UI (it’s deleted in all files.item)

smarthome:links removeChannelLink OG_Bad_Dusche_generic zwave:device:15c41dcb25f:node4:switch_binary

shows “Could not remove link OG_Bad_Dusche_generic -> zwave:device:15c41dcb25f:node4:switch_binary”

But after restart, “smarthome:items list” and “smarthome:links list” don’t show the item nor the link any more.

I’m using distro-2.1.0-SNAPSHOT, Build #927 (25.05.2017)