What do I have to do that the heating icon in OH2 change to red color with high temperature? If the setpoint is setup with a low temperatur the icon has no color. That’s ok. But if I set the highest temperature then the icon has only a blue color. And I saw an uninitialized icon that was red.
Setpoint item=HeatingBadSetpoint label="Heizung [%.1f °C]" step=0.5 minValue=4 maxValue=28
Take a look at
@watou’s explanation of how you can map icons to various states in this post. It may not be exactly what you’re looking for but it certainly helped me understand the possibilities.
If you have a number item like
Number dice “facet [%d]” <dice>
You could have icons like
If you have a string item like
String hvacMode “hvacMode [%s]” <hvac>
and it can have states like Heat, COOL, aUto, you can have icons like
Thanks. But in my case it doen’t match. I want to use a setpoint item to switch the temperature.
If your item were defined something like
Number HeatingBadSetpoint "Heizung [%.1f °C]" <setpoint> // etc.
and you had an icon
setpoint-28.png that was a red icon, would that work?
The Number can be very different from 4 until 28 in 0.5 steps. Do I need for each value an icon?
I don’t know! But you wanted icons to change to red with high temperature, so I thought you could copy the red icon to each high temperature level you wanted to be red.
Yip… and I can confidently say it’s worth it, but also a huge time sink.
However, this thread might eventually get some form of traction but my bet is to not count on it happening in a hurry.
I did a bit of searching around and couldn't find any similar topic or discussion (apologies if there is one!), but I wanted to see what people thought about using icon templates, and if this would be a simple thing to implement on openHAB2...
Currently from what I can see, for an icon to become "dynamic" it needs to have several versions of itself for different states. Now that both Classic and Basic UI can use SVG files, is there anything stopping us from having a single template f…