[SOLVED] OH 2 - Bug in dynamic icon handling (?)

All,

I struggled getting my custom icons (previously working on OH1) to work in OH2 as desired.
What confused me was the separate folders for classic and basic UI.

However, whenever I placed icons in basic UI folder /etc/openhab2/icons/basic it did not work (I am using basic UI only).
As soon as I placed it in classic, it does work (make sure that you place the “non-state” icon there as well: espresso.png for espresso-on.png / espresso-off-png).

Is this a bug??

Is anybody actually reading the documentation? We made sure to cover that topic here:
http://docs.openhab.org/features/items.html#icons

and especially here:
http://docs.openhab.org/features/items.html#dynamic-icons

Is this the information you are looking for?

@ThomDietrich

You are absolutely right! I missed that - indeed.
Sorry for that!
Shame on me…

One thing I can agree with you in however: the folder name classic suggests only icons for ClassicUI are supposed to go there.

@Kai can we talk about reducing it to <conf>/icons?

No, because “classic” here refers to the Classic icon set. We are about to have alternative icon sets soon, e.g. the KUF icon set. So custom icons for KUF would likewise go into <conf>/icons/kuf then.

1 Like

Okay fair point. However my own icons are not customized icons for the “classic icon set” but rather the “my icon set”. Do you know what I mean?

I agree. My icons are in the classic folder, but are most definitely a fully customised set. Perhaps there is a simpler way to manage custom icons. A ‘custom’ folder which overrides the classic folder if icons are the same name? shrug

1 Like

Icon sets require some meta-information (name, label, what formats does it support, etc), a plain folder simply cannot provide this.

We would need to build a bundle for this (see https://www.eclipse.org/smarthome/documentation/features/icons.html#icon-sets), so that another icon set is correctly registered.
Note that there are quite some requirements for an icon set, e.g. it should have an icon for every ESH channel category available and it should also have different versions for different item states - so if someone really has packed all that into a personal icon set, I would suggest to share it with the community and contribute it as a then-non-custom iconset :slight_smile:

For all other cases, it imho makes sense to use the existing icon sets as a fallback and only “override” it with your custom versions, where applicable.

OK, so not that simple. A couple of questions then:

Does an icon set need both svg and png icons?
Does it have to have the full extent of every icon in the default esh icon set?
Can the icon set expand upon the esh default set over time?

Sorry, Paul, just noticed that I never answered this.

Does an icon set need both svg and png icons?

No, it can declare which format it supports.

Does it have to have the full extent of every icon in the default esh icon set?

It should at least cover the channel categories.

Can the icon set expand upon the esh default set over time?

Sure, it can come up with its own icon names.