Label are different for Item from .items files or added via Add Items from Textual Definition

  • Platform information:
    • Hardware/OS: Raspi4 installed with Openhabian
    • openHAB version: 3.2M4
  • Issue of the topic:
    so far i have used for certain cases .items files for item defintion.
    As the semantic model has some issues with a mix of items defined via UI and in item files i want to add now the items from the item files via “Add Items from Textual Definition” to the UI.

An item defined in an .items file with " [%.1f %%]" in the label

Number:Dimensionless            Wetterstation_soilmoisture      "WS Außen Bodenfeuchtigkeit [%.1f %%]"       <humidity>       (eq_LokalesWetter, gPersInfluxDB_Wetter, gWeather)             ["Point"]

shows up in the UI as



and the item via the REST-API:

{
  "link": "http://ohshd:8080/rest/items/Wetterstation_soilmoisture",
  "state": "47 %",
  "stateDescription": {
    "pattern": "%.1f %%",
    "readOnly": false,
    "options": []
  },
  "editable": false,
  "type": "Number:Dimensionless",
  "name": "Wetterstation_soilmoisture",
  "label": "WS Außen Bodenfeuchtigkeit",
  "category": "humidity",
  "tags": [
    "Point"
  ],
  "groupNames": [
    "eq_LokalesWetter",
    "gPersInfluxDB_Wetter",
    "gWeather"
  ]
}

Here the input i have used for “Add Items from Textual Definition”:

Number:Dimensionless            Wetterstation_humidity          "WS Außen Feuchtigkeit [%.1f %%]"            <humidity>       (gPersInfluxDB_Wetter, gWeather, eq_WS_Aussen_Temp_Feucht)         ["Measurement", "Humidity"] 

shows up in the UI as



and the item via the REST-API

{
  "link": "http://ohshd:8080/rest/items/Wetterstation_humidity",
  "state": "95",
  "editable": true,
  "type": "Number:Dimensionless",
  "name": "Wetterstation_humidity",
  "label": "WS Außen Feuchtigkeit [%.1f %%]",
  "category": "humidity",
  "tags": [
    "Measurement",
    "Humidity"
  ],
  "groupNames": [
    "gPersInfluxDB_Wetter",
    "gWeather",
    "eq_WS_Aussen_Temp_Feucht"
  ]
}

Using the .items file the label and values are shown/displayed as expected.
After adding the items with “Add Items from Textual Definition” the label and values are shown different and not as expected.

The difference what i can see in the REST-API output is that using the .items file the format from the label is transferred to metadata-state description-pattern.
If you add an item via “Add Items from Textual Definition” the label is untouched and not transferred to metadata-state description-pattern.

Is this a bug and maybe already known?

i think it’s a known issue with a work around

https://community.openhab.org/t/how-to-add-item-pattern-format-via-add-items-via-textual-definition-migrate-from-items-files/111172