Removing Items from Karaf console

Hi.
I’m trying to get the hang of the Karaf console, don’t really understand how it works. For example, why can’t I remove Items?

openhab> smarthome:items | grep tellstick_switch_1_13_timestamp
tellstick_switch_1_13_timestamp (Type=DateTimeItem, State=2017-01-26T08:10:05.550+0100, Label=null, Category=null)
openhab> smarthome:items remove tellstick_switch_1_13_timestamp
1 item(s) removed successfully.
openhab> smarthome:items | grep tellstick_switch_1_13_timestamp
tellstick_switch_1_13_timestamp (Type=DateTimeItem, State=2017-01-26T08:10:05.550+0100, Label=null, Category=null)

It seems to me that it says that it’s removed the item but then it hasn’t. Am I misunderstanding how this works?

If your item was defined only in Paper UI, then it will be removed after you issue the smarthome:items remove command
If you are working with *.items files, OH2 will reload the file and recreate the item immediately.

Ok, then something is broken here. All my Tellstick things and items were automatically created (not by Paper UI but by habmin, but that makes no difference, right?). Any idea where to look next? No errors in the log file…

/Daniel

I filed an issue on this: https://github.com/openhab/openhab-core/issues/114

The issue was closed because it’s not related to openhab-core. Then what IS it related to? It definitely doesn’t work…

The simple mode is disabled. Any more ideas? @Kai?

You might have some orphan links - openHAB automatically creates “virtual” items for any link that points to a non-existent item:

openhab> smarthome:links
Weather_Temperature -> yahooweather:weather:berlin:temperature
Sun_Elevation -> astro:sun:home:position#elevation
Sun_Azimuth -> astro:sun:home:position#azimuth
Sunrise_Time -> astro:sun:home:rise#start
Sunset_Time -> astro:sun:home:set#start
Moon_Elevation -> astro:moon:home:position#elevation
Moon_Azimuth -> astro:moon:home:position#azimuth
Moon_Phase -> astro:moon:home:phase#name
CurrentDate -> ntp:ntp:demo:dateTime

If you see your tellstick_switch_1_13_timestamp item listed here, go to the linked channel in the Paper UI and unlink it again. Once the link is removed, the item should be gone as well.

2 Likes