Cant delete/update a thing that created through API

Hello,

I have create a Generic MQTT Thing via REST-API of openhab3. This Thing has 6 channels, which represent 6 sensor data points.

And then, I want to link the channels to the corresponding items. However, the link request has failed, because the Thing is not editabl (I have tried both with REST-API and on Main UI, both not working).

After that I also tried to delete the thing, but it also fails (both in REST-API and Main UI). The response from the API is:

{
    "error": {
        "message": "Cannot update Thing mqtt:topic:de4a7bafe3:djs123test as it is not editable.",
        "http-code": 409
    },
    "entity": {
             ...
    }
}

So my question will be, how can I create an editable thing or make thing editable via REST-API? Or maybe someone can show me the best practice to batch create things and items, and then link them together. :slight_smile:

If it is not editable it’s probably defined in a *.thing file.
If yes you have to edit the thing there. Only things that were added through the Rest API (GUI) are editable through the Rest API.

Query for the Thing through the REST API Explorer and post the contents here.

Also double check your .things files to double check that the Thing isn’t defined there too.

Restart OH and see if the Thing is still marked as read only or can be edited now.

Finally, if all else fails the Thing can be manually removed from the JSONDB. But if this Thing truly was created through the REST API I don’t know of any way that it can become marked as read only. Only Things defined in .things file get that status.

Thank you for the quick answers!

I could actually solve this problem on that day by myself. The problem is that the payload I used is not 100% correct. Therefore, the created Things are “illegal” and then they can not be edited. But after I fix the error in the payload, the created Things are editable.

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.