Display of switches in Basic UI

Hi there,

i am working with the latest nightly and found in the Baisic UI a strange behaviour.

I defined two switch items. One is connected to a mqtt channel and the other to a zwave channel.

This is the zwave one

and this is the mqtt one

The state decription is for both devices the same

I put these two items in a sitemap for Basic UI generated within the Main UI. The definition is like this:

The difference i found is that one switch displays ON/OFF and the other doesn’t

I don’t see any reason on this behaviour. Has someone an idea on why this happens?

Thomas

I’ll bet your zwave Item has further options in the metadata (placed there by the binding).

If you do want to display state, you can ask explicitly
... label="some text [%s]" ...
or if you want to suppress it, you can do that too
... label="some text []" ...

Thanks for your reply. I am aware of [] and [%s]. If i check the metadat in Main UI it is almost identical (Naming for Google is different)

But i will try to read the metadata later directly from the JSON-DB file.

The night light has the following metadata areas (mqtt item)

"stateDescription:RH_GF_BR_NightLight01_State": {
    "class": "org.openhab.core.items.Metadata",
    "value": {
      "key": {
        "segments": [
          "stateDescription",
          "RH_GF_BR_NightLight01_State"
        ],
        "uid": "stateDescription:RH_GF_BR_NightLight01_State"
      },
      "value": " ",
      "configuration": {
        "options": "ON\u003dein,OFF\u003daus"
      }
    }
  }
"ga:RH_GF_BR_NightLight01_State": {
    "class": "org.openhab.core.items.Metadata",
    "value": {
      "key": {
        "segments": [
          "ga",
          "RH_GF_BR_NightLight01_State"
        ],
        "uid": "ga:RH_GF_BR_NightLight01_State"
      },
      "value": "Light",
      "configuration": {
        "name": "Thomas Nachttischlampe",
        "roomHint": "Schlafzimmer"
      }
    }
  }

and the window light these ones

"stateDescription:RH_GF_BR_WindowLight_State": {
    "class": "org.openhab.core.items.Metadata",
    "value": {
      "key": {
        "segments": [
          "stateDescription",
          "RH_GF_BR_WindowLight_State"
        ],
        "uid": "stateDescription:RH_GF_BR_WindowLight_State"
      },
      "value": " ",
      "configuration": {
        "options": "ON\u003dein,OFF\u003daus"
      }
    }
  }
"ga:RH_GF_BR_WindowLight_State": {
    "class": "org.openhab.core.items.Metadata",
    "value": {
      "key": {
        "segments": [
          "ga",
          "RH_GF_BR_WindowLight_State"
        ],
        "uid": "ga:RH_GF_BR_WindowLight_State"
      },
      "value": "Light",
      "configuration": {
        "name": "Japanische Lampe",
        "roomHint": "Schlafzimmer"
      }
    }
  }

These are all metadata entries for the items

When a binding supplies hints for how to display an Item I don’t think those hints actually get saved to the metadata database. So you wouldn’t find it there. But in Basic UI at least defining the label, either on the Sitemap or the Site Description metadata should give you back control over the appearance. I think there is an issue for MainUI though where the binding supplied hints override those you define.

@rlkoshak Thanks for the hint. So maybe the binding give a hint or not and this is beyond any documentation :frowning:

What is the “Site Description” Metadata?

It’s special metadata you can set on any Item and it largely replaces defining the [ ] in the label everywhere except for sitemaps.

To suppress the state from being printed you would set the Pattern to a space (or open the code tab and set it to the empty String.

As you can see, you can provide a lot more than just the label config including being able to define a Map transform right there on the Item instead of needing a separate .map file (which is a good choice if there is only one Item that needs a given map).

Ah State Description. As shown in my first post there is no pattern on both items. I use the options for mapping.