Valuecolor/labelcolor for negative values

I have a problem getting valuecolor/labelcolor working for negative values. I have two Text items:

Text item=Temp_node2_garage labelcolor=[<= 10 = “red”, >= 10 = “green”] valuecolor=[<= 10 = “red”, >= 10 = “green”]
Text item=Temp_node2_freezer labelcolor=[<= -18 = “green”, > -18 = “red”] valuecolor=[<= -18 = “green”, > -18 = “red”]

The first one works perfectly but the second one renders label black and value blue. If I change the second line to compare positive values it works as expected (temperatures for first text item is varying around +12 C and temperature is -17.5 to -19 for the second). I can of course use an “abs” function and convert the negative values to positive but this is kind of an odd solution. Anyone found a solution?

I don’t see a reason for it in the code, but if you turn on DEBUG logging in logback.xml, you might see an entry from this code.

Thanks for the answer, I have not had the time to try anything yet but I will take a look at the logging procedure and see what I can find.

Changed to DEBUG and seen items in the OpenHab log. There are sequences like this example:

2015-11-20 19:07:46.509 [DEBUG] [.o.m.c.i.folder.FolderObserver] - Refreshing folder ‘sitemaps’
2015-11-20 19:07:46.511 [DEBUG] [.o.m.c.i.folder.FolderObserver] - Refreshing folder ‘persistence’
2015-11-20 19:07:46.512 [DEBUG] [.o.m.c.i.folder.FolderObserver] - Refreshing folder ‘rules’
2015-11-20 19:07:46.513 [DEBUG] [.o.m.c.i.folder.FolderObserver] - Refreshing folder ‘scripts’
2015-11-20 19:07:46.514 [DEBUG] [.o.m.c.i.folder.FolderObserver] - Refreshing folder ‘items’
2015-11-20 19:07:48.020 [DEBUG] [.io.net.http.SecureHttpContext] - security is disabled - processing aborted!
2015-11-20 19:07:48.021 [DEBUG] [.o.u.w.i.servlet.WebAppServlet] - Servlet request received!
2015-11-20 19:07:48.021 [DEBUG] [.o.u.w.i.servlet.WebAppServlet] - reading sitemap mb
2015-11-20 19:07:48.023 [DEBUG] [o.u.i.items.ItemUIRegistryImpl] - Cannot retrieve item null for widget org.openhab.model.sitemap.Frame
2015-11-20 19:07:48.027 [ERROR] [o.u.i.items.ItemUIRegistryImpl] - Error parsing color
2015-11-20 19:07:48.028 [ERROR] [o.u.i.items.ItemUIRegistryImpl] - Error parsing color
2015-11-20 19:07:48.029 [ERROR] [o.u.i.items.ItemUIRegistryImpl] - Error parsing color
2015-11-20 19:07:48.029 [ERROR] [o.u.i.items.ItemUIRegistryImpl] - Error parsing color
2015-11-20 19:07:48.203 [DEBUG] [.io.net.http.SecureHttpContext] - security is disabled - processing aborted!
2015-11-20 19:07:48.204 [DEBUG] [.o.u.w.i.servlet.WebAppServlet] - Servlet request received!
2015-11-20 19:07:48.209 [DEBUG] [.o.u.w.i.servlet.WebAppServlet] - reading sitemap mb
2015-11-20 19:07:56.515 [DEBUG] [.o.m.c.i.folder.FolderObserver] - Refreshing folder ‘sitemaps’
2015-11-20 19:07:56.517 [DEBUG] [.o.m.c.i.folder.FolderObserver] - Refreshing folder ‘persistence’
2015-11-20 19:07:56.518 [DEBUG] [.o.m.c.i.folder.FolderObserver] - Refreshing folder ‘rules’
2015-11-20 19:07:56.519 [DEBUG] [.o.m.c.i.folder.FolderObserver] - Refreshing folder ‘scripts’
2015-11-20 19:07:56.520 [DEBUG] [.o.m.c.i.folder.FolderObserver] - Refreshing folder ‘items’
2015-11-20 19:07:58.729 [DEBUG] [.io.net.http.SecureHttpContext] - security is disabled - processing aborted!
2015-11-20 19:07:58.730 [DEBUG] [.o.u.w.i.servlet.WebAppServlet] - Servlet request received!
2015-11-20 19:07:58.731 [DEBUG] [.o.u.w.i.servlet.WebAppServlet] - reading sitemap mb

Indicates an error with a frame as well as error parsing color but I have yet not been able figure out what is causing these errors.

Found a solution which is working and publish it in case someone else ends up with the same problem. The negative values for label- and valuecolor seems to screw up the internal logic when used like this:

Text item=Temp_node2_freezer labelcolor=[<= -18 = “green”, > -18 = “red”] valuecolor=[<= -18 = “green”, > -18 = “red”]

When adding quotes around the negative values like this all starts to work as expected. Do not see the logic as positive values do not need the quotes but anyhow, it works and that is enough. :smile:

Text item=Temp_node2_freezer labelcolor=[<="-18"=“green”, >"-18"=“red”] valuecolor=[<="-18"=“green”, >"-18"=“red”]