Various icon woes

I am having some icon issues that I cannot seem to locate the source of.

I have looked at a few other threads here, here, and here, oh and over here, but to no avail.

The strangest part of my problem is I have two different installations, one on a Pi2, and one on a Nuc that are manifesting the same issue. I have some icons, but not all. Here is an example where the icon for “light” is not being rendered. It happens in both the classic and basic UIs.

Ignore the motion icon for a second, that one truly is supposed to be a 404. I am running the nighties, and have tried a couple consecutive builds. I have noticed that the working icons are coming through as .png and the non working ones have parameters such as /icon/light?state=OFF&format=svg

I have also completely removed the runtime directory to make sure it was starting fresh. I did not remove the userdata directory as I did not want to remove my existing OH2 configurations. I then copied my items and other configuration files back in.

Is any information about icons stored in mapdb?

I also noticed that while the light icon was missing, the type dimmer sconces show a bright bulb icon even though they are off. It uses the icon “slider” as can be seen below.

Here are some of the items entries:

Switch BarLight              "bar"               <light>        (ALL,lights,bs,bsA)                   {insteonplm="19.F5.F9:F00.00.12#switch"}
Switch UtilityRoomLight      "utility room"      <light>        (ALL,lights,bs,bsA)                   {insteonplm="1D.16.66:F00.00.12#switch"}
Switch GameRoomLight         "game room"         <light>        (ALL,lights,bs,bsA)                   {insteonplm="1F.4A.F7:F00.00.12#switch"}
Dimmer TheaterSconces        "theater sconces"   <slider>       (ALL,lights,bs,bsA)                   {insteonplm="1A.08.B9:F00.00.01#dimmer"}

The sitemap segment used for classicUI is just a group:

Group label="Basement Devices" item=bs

And the Group definition:

Group bs "Basement" <cellar> [ "home-group" ]

I have tried looking at the logs in debug mode, and there are no errors that would indicate there is a problem. Only the 404 broken icons in the displays.

It looks like time to fix my IDE and look at what might be going on in the code, but I wanted to see if anyone else has any thoughts.


I have also found that when I remove the <light> element, the default image for type Switch appears. Perhaps it is something of overriding defaults is broken? Will investigate further.

FTR: should be fixed.
Please test it and let me know if there are any special cases that I have missed.

Sounds great, thanks Kai. Will let you know after some testing.

Looks good! Was it ever considered to have a “unknown” icon for undetermined states? an option or two

I think the icon to be displayed if no state is set can heavily depend on the item (category) - so I would not want to have a single one for all.

Having the base icons makes a nice difference. Now I have created a custom icon, and dropped the files in conf/icons/classic . My icon names are motion-closed.png, motion-open.png, and motion.png. Only the base icon seems to ever get loaded. The entry in .items looks like this:

 Contact UpstairsMotion          "upstairs motion [MAP(]"          <motion>       (ALL,motion,sf)              {zwave="11:command=SENSOR_BINARY"}

The icon does not change when the sensor is tripped, even when refreshed manually (to avoid any association issues). The permissions on the png files are fine, and the custom base icon does get loaded. This is with the classic UI. The basicUI doesn’t use them as it is set to SVG, so I need to create the corresponding svgs to try BasicUI.

Thanks @xsnrg for your testing.
I just spent a while analyzing the problems and found quite a couple of bugs that I have now fixed with

Your main problem was actually, that the Classic UI was already using SVG by default, so adding png files simply should have no effect. The fact that it displayed the fallback png file was only due to a bug :wink:

To simplify migration of existing openHAB 1 users, I have actually now switched the default back to PNG, so that people can continue using their custom bitmap files. Optionally, you can now configure to use SVG in classicui.cfg.

As soon as the fix is merged and a new stable ESH build is created, the problems should hopefully be gone!

Thanks @Kai , I’ll test and report back.

@Kai, still having some issues. What is the best way to check that the ESH commit to master made it through the process to OH2? is the commit to ESH master, so the nightly would have built the p2 artifacts that would have been pulled in by the latest OH2 cloudbees build… is that accurate?

How is it reflected in the source tree for the IDE with OH2? The package names are different for the classicUI in ESH vs OpenHAB. Sorry if this is a very basic question.

The problems:

In the IDE, I have added the sonos binding. When I use the classicUI on localhost:8080 I receive the following:

2015-12-17 08:27:22 [DEBUG] [.s.u.c.i.servlet.WebAppServlet:135 ] - reading sitemap _default
2015-12-17 08:27:22 [WARN ] [.eclipse.jetty.util.UrlEncoded:372 ] - java.lang.NumberFormatException: !hex 111
2015-12-17 08:27:22 [WARN ] [.eclipse.jetty.util.UrlEncoded:372 ] - java.lang.NumberFormatException: !hex 38
2015-12-17 08:27:22 [DEBUG] [s.ui.icon.internal.IconServlet:165 ] - unknown format ‘�rmat�tate=0’ in HTTP request - falling back to PNG
2015-12-17 08:27:22 [DEBUG] [.s.u.c.i.servlet.WebAppServlet:111 ] - Servlet request received!

From the latest build of OH2, the icons are not changing from the base icons in the ClassicUI. An example is the battery icon where the values are being reported in and I have batteries from 40% to 100%. They all show the base battery icon: /icon/battery.png

If the round of fixes has not yet made it to OH2, this is of course all moot, and hopefully the answers to the first questions will help me to understand when that happens.

Thanks for your time.

I’m on the latest stable build. My value on the item is a string like “21,1 °C / 50 %”. The log is full of “java.lang.NumberFormatException: !hex 38” errors. This is the debug log:

2017-02-15 20:30:29.911 [DEBUG] [org.eclipse.jetty.server.HttpChannel] - HttpChannelOverHttp@10e8af1{r=1,c=false,a=IDLE,uri=/icon/sofa?state=21,0%20%C2%B0C%20/%2050%20%&format=png} messageComplete
2017-02-15 20:30:29.915 [DEBUG] [] - Finished writing
2017-02-15 20:30:29.916 [DEBUG] [] - Send SSH_MSG_CHANNEL_DATA on channel 0
2017-02-15 20:30:29.916 [DEBUG] [] - Writing 160 bytes
2017-02-15 20:30:29.917 [DEBUG] [org.eclipse.jetty.server.HttpInput  ] - HttpInputOverHTTP@1c3dab2 EOF
2017-02-15 20:30:29.919 [DEBUG] [] - Finished writing
2017-02-15 20:30:29.920 [DEBUG] [org.eclipse.jetty.server.HttpChannel] - HttpChannelOverHttp@10e8af1{r=1,c=false,a=IDLE,uri=/icon/sofa?state=21,0%20%C2%B0C%20/%2050%20%&format=png} handle enter
2017-02-15 20:30:29.920 [DEBUG] [] - Send SSH_MSG_CHANNEL_DATA on channel 0
2017-02-15 20:30:29.921 [DEBUG] [] - Writing 176 bytes
2017-02-15 20:30:29.922 [DEBUG] [clipse.jetty.server.HttpChannelState] - HttpChannelState@17cffba{s=IDLE i=true a=null} handling IDLE
2017-02-15 20:30:29.923 [DEBUG] [] - Finished writing
2017-02-15 20:30:29.924 [DEBUG] [] - Send SSH_MSG_CHANNEL_DATA on channel 0
2017-02-15 20:30:29.925 [DEBUG] [org.eclipse.jetty.server.HttpChannel] - HttpChannelOverHttp@10e8af1{r=1,c=false,a=DISPATCHED,uri=/icon/sofa?state=21,0%20%C2%B0C%20/%2050%20%&format=png} action REQUEST_DISPATCH
2017-02-15 20:30:29.925 [DEBUG] [] - Writing 160 bytes
2017-02-15 20:30:29.927 [DEBUG] [org.eclipse.jetty.server.Server     ] - REQUEST GET /icon/sofa on HttpChannelOverHttp@10e8af1{r=1,c=false,a=DISPATCHED,uri=/icon/sofa?state=21,0%20%C2%B0C%20/%2050%20%&format=png}
2017-02-15 20:30:29.927 [DEBUG] [] - Finished writing
2017-02-15 20:30:29.927 [DEBUG] [] - Send SSH_MSG_CHANNEL_DATA on channel 0
2017-02-15 20:30:29.928 [DEBUG] [ax.web.service.spi.model.ServerModel] - Matching [/icon/sofa]...
2017-02-15 20:30:29.930 [DEBUG] [] - Writing 160 bytes
2017-02-15 20:30:29.931 [DEBUG] [ax.web.service.spi.model.ServerModel] - Path [/icon/sofa] matched to {pattern=/icon/.*,model=ServletModel{id=org.ops4j.pax.web.service.spi.model.ServletModel-10,name=org.ops4j.pax.web.service.spi.model.ServletModel-10,urlPatterns=[/icon/*],alias=/icon,servlet=org.eclipse.smarthome.ui.icon.internal.IconServlet@17c11d7,initParams={},context=ContextModel{id=org.ops4j.pax.web.service.spi.model.ContextModel-9,name=,httpContext=DefaultHttpContext [bundle=org.eclipse.smarthome.ui.icon_0.9.0.b4 [137], contextID=default],contextParams={},virtualHosts={},connectors={}}}}
2017-02-15 20:30:29.932 [DEBUG] [] - Finished writing
2017-02-15 20:30:29.933 [DEBUG] [] - Send SSH_MSG_CHANNEL_DATA on channel 0
2017-02-15 20:30:29.936 [DEBUG] [.jetty.server.handler.ContextHandler] - scope null||/icon/sofa @ HttpServiceContext{httpContext=DefaultHttpContext [bundle=org.eclipse.smarthome.ui.icon_0.9.0.b4 [137], contextID=default]}
2017-02-15 20:30:29.936 [DEBUG] [.jetty.server.handler.ContextHandler] - context=||/icon/sofa @ HttpServiceContext{httpContext=DefaultHttpContext [bundle=org.eclipse.smarthome.ui.icon_0.9.0.b4 [137], contextID=default]}
2017-02-15 20:30:29.937 [DEBUG] [] - Writing 176 bytes
2017-02-15 20:30:29.937 [DEBUG] [org.eclipse.jetty.server.session    ] - sessionManager=org.ops4j.pax.web.service.jetty.internal.LateInvalidatingHashSessionManager@1b0f3e9
2017-02-15 20:30:29.938 [DEBUG] [org.eclipse.jetty.server.session    ] - session=null
2017-02-15 20:30:29.939 [DEBUG] [] - Finished writing
2017-02-15 20:30:29.939 [DEBUG] [] - Send SSH_MSG_CHANNEL_DATA on channel 0
2017-02-15 20:30:29.940 [DEBUG] [eclipse.jetty.servlet.ServletHandler] - servlet |/icon|/sofa -> org.ops4j.pax.web.service.spi.model.ServletModel-10@b9f03e57==org.eclipse.smarthome.ui.icon.internal.IconServlet,-1,true
2017-02-15 20:30:29.940 [DEBUG] [ce.jetty.internal.HttpServiceContext] - Handling request for [/icon/sofa] using http context [DefaultHttpContext [bundle=org.eclipse.smarthome.ui.icon_0.9.0.b4 [137], contextID=default]]
2017-02-15 20:30:29.940 [DEBUG] [] - Writing 160 bytes
2017-02-15 20:30:29.941 [DEBUG] [y.internal.HttpServiceServletHandler] - handling request org.ops4j.pax.web.service.jetty.internal.HttpServiceRequestWrapper@478a71, org.ops4j.pax.web.service.jetty.internal.HttpServiceResponseWrapper@17dfe88
2017-02-15 20:30:29.941 [DEBUG] [eclipse.jetty.servlet.ServletHandler] - chain=null
2017-02-15 20:30:29.942 [DEBUG] [] - Finished writing
2017-02-15 20:30:29.943 [WARN ] [org.eclipse.jetty.util.UrlEncoded   ] - java.lang.NumberFormatException: !hex 38
2017-02-15 20:30:29.943 [DEBUG] [] - Send SSH_MSG_CHANNEL_DATA on channel 0
2017-02-15 20:30:29.944 [DEBUG] [org.eclipse.jetty.util.UrlEncoded   ] - 
java.lang.NumberFormatException: !hex 38
	at org.eclipse.jetty.util.TypeUtil.convertHexDigit([83:org.eclipse.jetty.util:9.2.19.v20160908]
	at org.eclipse.jetty.util.UrlEncoded.decodeUtf8To([83:org.eclipse.jetty.util:9.2.19.v20160908]
	at org.eclipse.jetty.http.HttpURI.decodeQueryTo([71:org.eclipse.jetty.http:9.2.19.v20160908]
	at org.eclipse.jetty.server.Request.extractQueryParameters([80:org.eclipse.jetty.server:9.2.19.v20160908]
	at org.eclipse.jetty.server.Request.extractParameters([80:org.eclipse.jetty.server:9.2.19.v20160908]
	at org.eclipse.jetty.server.Request.getParameter([80:org.eclipse.jetty.server:9.2.19.v20160908]
	at org.eclipse.smarthome.ui.icon.internal.IconServlet.getFormat([137:org.eclipse.smarthome.ui.icon:0.9.0.b4]
	at org.eclipse.smarthome.ui.icon.internal.IconServlet.doGet([137:org.eclipse.smarthome.ui.icon:0.9.0.b4]
	at javax.servlet.http.HttpServlet.service([19:javax.servlet-api:3.1.0]
	at javax.servlet.http.HttpServlet.service([19:javax.servlet-api:3.1.0]
	at org.eclipse.jetty.servlet.ServletHolder.handle([81:org.eclipse.jetty.servlet:9.2.19.v20160908]
	at org.eclipse.jetty.servlet.ServletHandler.doHandle([81:org.eclipse.jetty.servlet:9.2.19.v20160908]
	at org.ops4j.pax.web.service.jetty.internal.HttpServiceServletHandler.doHandle([172:org.ops4j.pax.web.pax-web-jetty:4.3.0]
	at org.eclipse.jetty.server.handler.ScopedHandler.handle([80:org.eclipse.jetty.server:9.2.19.v20160908]
	at org.eclipse.jetty.server.session.SessionHandler.doHandle([80:org.eclipse.jetty.server:9.2.19.v20160908]
	at org.eclipse.jetty.server.handler.ContextHandler.doHandle([80:org.eclipse.jetty.server:9.2.19.v20160908]
	at org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.doHandle([172:org.ops4j.pax.web.pax-web-jetty:4.3.0]
	at org.eclipse.jetty.servlet.ServletHandler.doScope([81:org.eclipse.jetty.servlet:9.2.19.v20160908]
	at org.eclipse.jetty.server.session.SessionHandler.doScope([80:org.eclipse.jetty.server:9.2.19.v20160908]
	at org.eclipse.jetty.server.handler.ContextHandler.doScope([80:org.eclipse.jetty.server:9.2.19.v20160908]
	at org.eclipse.jetty.server.handler.ScopedHandler.handle([80:org.eclipse.jetty.server:9.2.19.v20160908]
	at org.ops4j.pax.web.service.jetty.internal.JettyServerHandlerCollection.handle([172:org.ops4j.pax.web.pax-web-jetty:4.3.0]
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle([80:org.eclipse.jetty.server:9.2.19.v20160908]
	at org.eclipse.jetty.server.Server.handle([80:org.eclipse.jetty.server:9.2.19.v20160908]
	at org.eclipse.jetty.server.HttpChannel.handle([80:org.eclipse.jetty.server:9.2.19.v20160908]
	at org.eclipse.jetty.server.HttpConnection.onFillable([80:org.eclipse.jetty.server:9.2.19.v20160908]
	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob([83:org.eclipse.jetty.util:9.2.19.v20160908]
	at org.eclipse.jetty.util.thread.QueuedThreadPool$[83:org.eclipse.jetty.util:9.2.19.v20160908]