Sitemap valuecolor change from rule

Hi Guys,

First post so sorry if make little sense. I want to change the colour of the actual temperature values evaluated against their target in my sitemap.

I.e Actual temp is 20 and target is 21 then text would be blue. if the actual temp was above the target then it would be red. and if it was equal then colour would be black.

I can get it to work when evaluating against a static temp as per the documentation I.e ```item=actual_temp valuecolor[>20=“red”]

that can be done directly in the site map. I am guessing I need to do this in a rule???

If I understand correctly, what you are after is not possible in sitemaps. You can only use static values for comparison with the valuecolor syntax. There is nothing you can do from a Rule to change that limitation.

Wonder if you can compare against a non printable character in sotemap? I have never looked.

My thought you could have a non printable character for each color you wanted to show. Then use a rule to append the character.

Hi thanks for the clarity. I am now wondering if item visibility would work with the three temperature icons instead.

Thanks again.

Yes not sure. Give it a shot!

Hi for future reference. This can be done with a combination of valuecolor and visibility.
Basically you can define a condition that will always be true in my case actual temperature >0 but differing colours then trigger the visibility of the relevant panel based on a rule below Site_Test is defined as a Number item.

Text item=LR_Heating_ActualTemp visibility=[Site_Test==1] valuecolor=[>0="red"] label="Living Room [%.1f °C]" icon="temperature_hot" {
        Setpoint item=LR_Heating_TargetTemp label="Living Room [%.1f °C]" icon="temperature" minValue=10.0 maxValue=30.0 step=0.5
        }

        Text item=LR_Heating_ActualTemp visibility=[Site_Test==0,Site_Test==NULL] label="Living Room [%.1f °C]" icon="temperature" {
        Setpoint item=LR_Heating_TargetTemp label="Living Room [%.1f °C]" icon="temperature" minValue=10.0 maxValue=30.0 step=0.5
        }

        Text item=LR_Heating_ActualTemp visibility=[Site_Test==-1]  valuecolor=[>0="blue"] label="Living Room [%.1f °C]" icon="temperature_cold" {
        Setpoint item=LR_Heating_TargetTemp label="Living Room [%.1f °C]" icon="temperature" minValue=10.0 maxValue=30.0 step=0.5
        }

hope this helps someone in the future.

1 Like

Can you post the full rule and site map? That pertains to this?

Hi - I abandoned this for the moment as it was giving unreliable results. I will revisit it once I have my boiler demand rules finished.