Getting item label or icon in main UI

Hi,

maybe I’m blind. I just want to display an Item with its label and icon, as defined in the items config, in the main ui as part of a custom element.

e.g. here is my simple example

- component: div
  slots:
    default:
      - component: Label
        config:
          style:
            color: white
          text: "=items['gShutters'].label"
      - component: oh-rollershutter
        config:
          item: gShutters

It’s not a particularly extraordinary example. It is a typical case where the oh-* components are too inflexible (e.g. layout, for instance) and you essentially want to implement a custom solution.

is there any special way to get “base” data of an item?

I’m already tried a workaround with the oh-repeater, but it works not with simple items. only with group items and their children.

Unfortunately, no. The oh-repeater is the only way in a widget to get the full item API response.

There are ways to abuse the repeater to get it to return only a single item of interest, but they are not really a good idea because the most general of them involve fetching the entire item list and filtering it down in the repeater. This, obviously, can run into performance issues fairly rapidly.

This is a common enough situation however, that it might be worth starting a discussion on the webui repo about either adding a single item property to the repeater or creating some single item oh-item equivalent. I’m not sure it’ll get any traction, but it’s worth having the discussion.