Custom icon issue with List Item Widget

Hi all,

just want to check if I’m doing something wrong or what.

  • Openhab 3.4
  • All the items configured via item file
  • I’ve configured a custom icon/category for one item using <"if:mdi:toggle-switch-off">

The item is displayed correctly in the semantic model but, when the item uses a list item widget the icon won’t work.
If i try to add metadata from Openhab interface to “Default List Item Widget” I find that by default the icon field value is inherited but is the following: oh:if:mdi:toggle-switch-off.

“oh” prefix is added to the field value and hence, the valeu became invalid.

If I override via item file or via interface the value removing “oh” the icon works but, I suppose this can be a bug.

Any suggestion?

Thanks,
Marco

Hope this is not too pushing…

As suggested in the bug report guide, I’ve opened this topic to check whether I’m doing something wrong or if a bug exists.

Any suggestion? Should I add more details on the platform, configuration, other or the best way is to file an issue?

Thanks again,
Marco

I’d say this somewhere in that gray area between bug report and enhancement request. The system is working as intended. The issue you’re having comes from here:

The expectation is that non-OH icons are explicitly specified in the icon configuration, and if no non-standard icon is specified, then the category which the UI uses to determine an oh specific icon is used instead, but because in the UI it would be less user friendly to have all the categories be listed as oh:lightbulb and oh:whitegood etc., the UI uses only the actual icon name and prepends oh: during creation of the widget instead.

There are workarounds of course, including overriding the inherited icon property or even creating your own custom list widget. But you also can certainly post this as an issue to the UI repo to get it some attention. It’s an unusual case but one that may become more frequent as the icon options have grown.

Thanks, issue opened: Custom icon issue with List Item Widget · Issue #1663 · openhab/openhab-webui · GitHub