What’s the Item’s config? Specifically did you define a default list widget? If not you need to and choose “oh:thermostat” as the icon and toggle “Item icon depends on state” to ON (you may have to toggle Show Advanced to see the toggle).
You’ll have to set the Item metadata on the Item. Probably the easiest way to do it will be to create a test Item, configure the metadata through the UI, and then look at the code tab to see the proper field names and formatting.
I don’t use items files any more and there is enough in OH 3 now that is controlled through metadata that I can’t even imagine trying to do it all in .items files. Each Item would be 20+ lines of code or more to do it all.
In reality, using the text file setting of <myicon> just results in an entry in the JSONDB version of the Item as "category": "myicon"
Are we saying this has been repurposed or ignored in MainUI - but not in the other available UI and apps? Or must we now maintain two completely separate sets of Items properties for display in MainUI and for other UI?
I tried adding { iconUseState="true" } to the item but that did not work.
What I did to get to work was open the Settings -> Model find the item that from the text file and then press the Add Metadata button. As @rlkoshak suggested I added a Default List Item Widget. I selected Show Advanced and checked the Icon depends on state box and Saved.
Category is used by MainUI by default but doesn’t support dynamic icons. If you want dynamic icons or any customizations you have to override the default widgets in metadata.
Click on the code tab.
It’s item metadata. The namespace is listed in the title bar (e.g. listWidget).
Okay, it’s a regression. To have dynamic icons in both UI, uhh, families, we have two different settings to maintain.
EDIT - the more I think about this, the flakier it seems.
In the “olde world”, we would just choose “an icon”. If “the icon” was in reality a set of dynamic icons, it just worked.
We could choose the icon in sitemap, separating presentation from Item. (We could give the Item a default icon, but the presentation/sitemap took priority.)
Tacking an essential presentation feature back on to each individual Item seems retrograde to me.