I don’t know how it did happen. But I have a situation here with a thing and its Items in openhab2 : Could you please help me delete it and ALL items linked, so I can re-create it cleanly ? (and not, AGAIN delete the whole “userdata” folder … )
In paperUI, I CANNOT unlink one channel, it causes a 404 error (but nothing in the logs) :
In Habmin2, this is all upside down : habmin2 thinks there a linked items, but does not show them. If I create a new item, then suddenly I get a line with the “ghost” item, but I cannot delete it … again, nothing in the logs :
And finally, if I go to Items, I have an item here that I cannot delete too (I think that it is the one I created in a previous test to reveal the ghost item, then I deleted the whole thing and re-added it …) : if I try to delete it from here, I get this line in logs :
2016-06-04 17:49:20.783 [INFO ] [thome.io.rest.core.item.ItemResource] - Received HTTP DELETE request at ‘items/zwave_device_FGSD002_node3_RDC_alarm_smoke’ for the unknown item ‘zwave_device_FGSD002_node3_RDC_alarm_smoke’.
thannnnks (it did delete all “mapdb” (i suppose) items and links, including the ghost ones) ! You’re becoming my hero …
are those commands documented somewhere ? Do you have an Idea of what could have happened ? it’s seems to me that the data (items / things / links) removal via UIs is not “clean”
EDIT : I found myself AGAIN having a mess, this time with duplicate entries when browsing my sitemap (items appearing 2 times).
To recover, I did a “smarthome:items clear” (I am moving my items to text files, more robust, but it appears that openhab tend to duplicate items somehow in the cache, maybe when changing groups names)
Very good question! WIthin the IDE, it is still possible to simply type “smarthome” in the console to get a list of all commands:
smarthome firmware list <thingTypeUID> - lists the available firmwares for a thing type
smarthome firmware status <thingUID> - lists the firmware status for a thing
smarthome firmware update <thingUID> <firmware version> - updates the firmware for a thing
smarthome interpret <command> - interprets the human language command
smarthome update <item> <state> - sends a status update for an item
smarthome send <item> <command> - sends a command for an item
smarthome inbox - lists all current inbox entries
smarthome inbox listignored - lists all ignored inbox entries
smarthome inbox approve <thingUID> <label> - creates a thing for an inbox entry
smarthome inbox clear - clears all current inbox entries
smarthome inbox ignore <thingUID> - ignores an inbox entry permanently
smarthome things list - lists all things
smarthome things clear - removes all managed things
smarthome things remove <thingUID> - removes a thing
smarthome items list [<pattern>] - lists names and types of all items (matching the pattern, if given)
smarthome items clear - removes all items
smarthome items remove <itemName> - removes the given item
smarthome links list - lists all links
smarthome links addChannelLink <itemName> <channelUID> - links an item with a channel
smarthome links removeChannelLink <itemName> <thingUID> - unlinks an item with a channel
smarthome links clear - removes all managed links
smarthome status <item> - shows the current status of an item
smarthome > <script to execute> - Executes a script
smarthome discovery start <thingTypeUID|bindingID> - runs a discovery on a given thing type or binding
smarthome discovery enableBackgroundDiscovery <PID> - enables background discovery for the discovery service with the given PID
smarthome discovery disableBackgroundDiscovery <PID> - disables background discovery for the discovery service with the given PID
smarthome say <text> - speaks a text
On Karaf, we can at least see the main commands through
openhab> help | grep smarthome
smarthome Enter the subshell
smarthome:> Execute scripts
smarthome:discovery Control the discovery mechanism.
smarthome:firmware Manage your things' firmwares.
smarthome:inbox Manage your inbox.
smarthome:interpret Interpret a command by a human language interpreter.
smarthome:items Access the item registry.
smarthome:links Manage your links.
smarthome:say Speak text by a text-to-speech service (TTS).
smarthome:send Send a command to an item.
smarthome:status Get the current status of an item.
smarthome:things Access your thing registry.
smarthome:update Send a state update to an item.
@maggu2810 Is there any way to get the usage displayed for the individual commands?
it appears that openhab tend to duplicate items somehow in the cache, maybe when changing groups names)
I have also seen this when editing and saving item files. A restart usually solves this.
A command like:
does not seem to affect the database for my.openhab.
E.g. smarthome:status zwave_device_48766d53_node2
Error: Item ‘zwave_device_48766d53_node2’ does not exist.
but still shows in my.openhab
What exactly does this do? I have problem with that items belong to the wrong group after updating the item with new group names, they still show up in the old group. So how can I fix this? Thats the only change I would like to do to my setup! I do not want to reconfigure things etc…
[WARN ] [ome.core.thing.internal.ThingManager] - Cannot delegate update ‘CLOSED’ for item ‘Playroom_window_State’ to handler for channel ‘HM-Sec-SCo:c3b1c9f9:NEQ1650195:1#STATE’, because no thing with the UID ‘HM-Sec-SCo:c3b1c9f9:NEQ1650195’ could be found.
Is there another way to clear out these weird duplicates?
You haven’t got some .items etc. files lurking somewhere have you. If the clear command doesn’t work and your sure there are no manual definitions you do at least have the option now of editing the jsondb to tidy things up… at your own peril of course.
I’ve also got these warnings in my log which may be connected as the map transformation service works fine with other items:
[.core.transform.TransformationHelper] - Cannot get service reference for transformation service of type Map
2017-04-09 10:24:46.060 [WARN ] [.core.transform.TransformationHelper] - couldn’t transform value because transformationService of type ‘Map’ is unavailable
2017-04-09 10:24:48.933 [WARN ]
I don’t get any other errors or warnings apart from the duplicate items mentioned above.
I had similar issues and first reverted to the Karaf console to remove the items using
Still, items popped up in habmin and in paper UI. When deleting in paper UI, I had error 404 in bottom right of the screen. When deleting from habmin, nothing happened. In both cases, I had an entry in the log:
Received HTTP DELETE request at 'items/xyz' for the unknown item 'xyz'.
Which is similar to what was reported earlier in this thread.
I finally ended up editing the jsondb. There I noticed that, indeed, the items were not there any more, but the ChannelLinks still existed. After deleting the channel links, the items were no longer visible in the UIs.
Before openhab service restart, I also deleted the tmp and cache directories, just to be sure.
I cannot tell which of my attempts caused the inconsistency in the database (itemchannellink entries still exist for nonexistent items): one of the GUIs or the removal via the Karaf console.