Developer: Created a "Null" Thing in Inbox => How to manually delete it?

I am posting this under Development since it definitely does not belong in the user fora for regular users :stuck_out_tongue:

I am working on the development of a binding. At some point in the middle of the night I managed to mis-program my Discovery Service so that it created a Thing with null (or empty) strings in it’s name and its Thing UID (see screenshot below).

My question is how to manually delete this Thing from my Inbox? If I press on the waste basket for this Thing in PaperUI, the delete fails (with a little error popup). So I think I need to manually delete or edit an actual file somewhere. I am thinking that org.eclipse.smarthome.config.discovery.DiscoveryResult.json is probably the file; and I tried editing it and removing the JSON for the offending Thing from it; but this doesn’t work; it seems that OH is keeping the JSON data in cache (makes sense), and it is overwriting any changes that I make.

Try installing restdocs and using the REST API?

@Bruce_Osborne cool idea, many thanks. However I tried it, and this also failed (see below). I guess that REST tries to use the same interface as PaperUI, and both fail for the same reason.

 {
  "error": {
    "message": "Thing not found in inbox",
    "http-code": 404
  }
}

Can you add the Thing from the Inbox and then delete it?
I suspect HABmin would have the same issues because they all use the REST API.
If we knew where that is stored, perhaps shut down OH and edit the JSONDb file directly?

When you edit a file in userdata/jsondb, you need to stop openHAB before doing the edit. It’s not clear from your post whether or not you shutdown openHAB.

Tried that too. But didn’t work either…

Aha. I was trying the edit with OH running. So I just need to know how to stop the OH application while keeping the samba share open so I can edit the file. Any suggestions? :rofl:

Are you running openhabian? If so, I’m not sure what to tell you since I don’t use that. In my installation it’s just a matter of stopping the openhab service.

Yes, I am on openHabian, on a headless raspberry pi. So I have to do this via a samba share from another computer.

Perhaps I’m showing my ignorance of openhabian… But, can’t you ssh into the pi, shutdown openHAB, edit the file, then restart openHAB?

As long as they are not ssh into Karaf…

Yes, from ssh terminal use sudo systemctl stop openhab2 make changes then same command except change stop to start.

1 Like

Perfect. That worked to stop/start OH. And then I opened org.eclipse.smarthome.config.discovery.DiscoveryResult.json via samba share folder on my desktop computer and manually cut out the offending JSON element.

3 Likes