Windows Service Custom Icons Not Working

  • Platform information:
    • Hardware: x64 8Gb
    • OS: Windows 10 x64 v2004
    • Java Runtime Environment: jre1.8.0_261
    • openHAB version: 2.5.7
  • Issue of the topic: unable to display png/svg files in HABPanel widgets or browser URLs

URL: hxxp://localhost:1980
Install folder: C:\openHAB2
Installed as service as per https://www.openhab.org/docs/installation/windows.html
Test files: fire1.png and fire2.svg
Copied to the following locations:
C:\openHAB2\conf\html
C:\openHAB2\conf\icons\classic
C:\openHAB2\userdata\webapps

Tried the following:
hxxp://localhost:1980/static/fire1.png
hxxp://localhost:1980/icons/fire1.png
hxxp://localhost:1980/icon/fire1.png
hxxp://localhost:1980/icon/classic/fire1.png
hxxp://localhost:1980/icons/classic/fire1.png

All returned:
HTTP ERROR 404
Problem accessing /icons/classic/fire1.png. Reason:

Not Found

Powered by Jetty:// 9.4.20.v20190813

Not sure where I’m going wrong, but would appreciate any suggestions.

Thanks,
Richie

Try this URL:
http://localhost:1980/icon/fire1?format=png&anyFormat=true

You’re not supposed to be able to fetch icon images directly. @Wolfgang_S URL goes to an icon-picker service embedded in openHAB, that selects and supplies images based on the parameters given.
Note that one of the parameters needs to be [an Item] - wrong, my mistake, an item state
The picker serves up the relevant icon for that Item state.

If you want to give access to files, including images, they go in your /html folder.

1 Like

Hi Wolfgang,
I will try your solution when i get home soon.
Rossko, as per my post, you can see that I have already tried putting files in the html folder, which doesn’t work - I’m guessing due to me running this as a service on Windows 10.
Thanks,
Richie

Hi Wolfgang,
Your suggestion didn’t work either.
However, after further investigation, I can confirm it is related to openHAB running as a service.
Maybe a config issue in the wrapper config???
Running OpenHAB from command line (start.bat)
http://localhost:1980/static/fire1.png <— works
Running it again as a service and the link doe NOT work any more.

Any suggestions on fixing this?

Thanks,
Richie

Hi,
Solved it.
It was an issue with the keyboard-seat interface (me)
I thought I’d followed the Windows steps, but failed to copy the contents into the wrapper.conf file - i just changed couple of things instead.
Once I copied the contents (only changing the http ports) it suddenly started working correctly.
Sorry for wasting everyone’s time.

Thanks,
Richie