[SOLVED] Habpanel dynamic custom icons not loading

Hi,

I’m not able to load my custom icons in habpanel.
I’ve copied the icons in /etc/openhab2/html/icons /etc/openhab2/icons/classic
but none seem to work. This is a beginner problem probably, but I just can’t seem to get it to work.
icon-widget:

<widget-icon iconset="'custom-icon'" icon="'roller-shutter-anim'" size="100" center="true" />

I also tried it with state, but no luck
image
if I inspect the icon it links to:
image

src="/icon…"
So, I’m not sure what is going wrong here.
Maybe someone can point me in the right direction?

thanks!
/Jasper

hyphens are not allowed in dynamic icon filenames. It breaks the select-by-state mechanism, which uses a hyphen.

EDIT -to explain your surprise at the URL a bit, the UI does not fetch icon images directly but asks an “icon provider” service. That supplies the image according to state.

Shoot! I should have known this.
I’ll give it a try later today and come back to you.

Thank you @rossko57 for taking the time to reply!

/Jasper

Ok, the dynamic icons are working now! Super!

Icons are placed in the “icons” folder. Renamed as suggested by @rossko57.
Now the blinds are changing according to the state of the blind_control value!

Result:
image

Icons:
image

For displaying the icons:

<widget-icon iconset="'custom-icon'" icon="'rollers'" state="itemValue('FF_RS_Ruben')" size="100" center="true" />

Another widget completed for now!

Thanks everyone (especially @rossko57!)
/Jasper

1 Like