OH 4.3.0 problem to edit of one item

Hi,

i have an item which i got out that i cannot edit it any more. Version is 4.3.0. If im clicking the edit button then im getting this:


If switched to code tab:

if not edited the item is visible as this:


The other existing items are normally editable.
Someone has an idea for me how can i fix the item that i can normally edit it like other items?

It looks like something within the item’s configuration is causing the item edit page to crash. I don’t see any immediate issues with the code you posted, but it’s worth checking some things quickly.

There is almost certainly an error that crops up in the browser console when you open that page. What does the error say?

Can you go to the API explorer and use the GET /items/{itemname} endpoint to retrieve the entire json definition of the item and paste that here?

Hi Justin,
here the output of the json:

{
  "link": "http://192.168.2.244:7070/rest/items/Counter_Wasseruhr",
  "state": "195.8390000000002",
  "stateDescription": {
    "pattern": "%.0f",
    "readOnly": false,
    "options": []
  },
  "metadata": {
    "semantics": {
      "value": "Point_Measurement",
      "config": {
        "relatesTo": "Property_Water",
        "isPointOf": "Wasseruhr"
      }
    },
    "stateDescription": {
      "value": " "
    }
  },
  "editable": true,
  "type": "Number",
  "name": "Counter_Wasseruhr",
  "label": "Wasseruhr Liter",
  "category": "iconify:mdi:odometer",
  "tags": [
    "Measurement",
    "Water"
  ],
  "groupNames": [
    "gChange",
    "gRestore",
    "Wasseruhr"
  ]
}

and here the console after trying editing the icon

OK, somehow the state description metadata configuration has been deleted. The basic state description configuration is there, but in a properly formed item, that information should also be stored where you see:

    "stateDescription": {
      "value": " "
    }

in the item’s metadata.

You can try to just redo the metadata. From the working item detail page, click on the State Description metadata item which should take you to the dialog wizard without error. Re-enter your state description pattern and save that.

If that doesn’t work, then you will have to try and update the item json manually. That would entail copying the json you posted above. Editing it so that the stateDescrpition object under the metadata looks like this:

    "stateDescription": {
      "value": " ",
      "config": {
        "pattern": "%.0f"
      }
    }

and then pasting the entire json back into the PUT /items/{itemname} endpoint.

1 Like

Hi Justin,
the first way, going to state description and entering there the pattern ‘%.0f’ and saving worked and now its again correctly editable.

Thank you very much for your fast help!
Best regards, Andreas