(Solved) Valuecolor problems after update to OH2.2

Have been using colors to indicate if temp readings are being updated for a number of years. After the update to OH2.2 however this stopped working and all of my readings stay “green”. Did something regarding valuecolor change in OH2.2?


Number BU_Terras_Sensor2_TEMP_Raw { channel="rfxcom:temperaturehumidity:rfxcom_bridge:1:temperature" }


Text item=BU_Terras_Sensor2_TEMP valuecolor=[BU_Terras_Sensor2_Update=="NULL"="red",BU_Terras_Sensor2_Update>300="red",BU_Terras_Sensor2_Update>150="orange",BU_Terras_Sensor2_Update<=150="green"]


rule "BU_Terras_Sensor2"
    Item BU_Terras_Sensor2_TEMP_Raw received update or
    Item BU_Terras_Sensor2_TEMP_Raw received update
    postUpdate(BU_Terras_Sensor2_TEMP, (BU_Terras_Sensor2_TEMP_Raw.state as DecimalType) + 0)
    postUpdate(BU_Terras_Sensor2_HUM, (BU_Terras_Sensor2_HUM_Raw.state as DecimalType) + 0)
    postUpdate(BU_Terras_Sensor2_BATT, (BU_Terras_Sensor2_BATT_Raw.state as DecimalType) * 1)
    postUpdate(BU_Terras_Sensor2_SIGN, (BU_Terras_Sensor2_SIGN_Raw.state as DecimalType) * 25)   
    BU_Terras_Sensor2_Update.postUpdate( new DateTimeType() )

I can see values coming in, i see timestamps change but if updates stop I do not get orange or red indicators?



Same problem.
Setup was working before the update.

Text item=Update_WZ valuecolor=[>6000="red",>600="orange",<=600="green"]


    rule "LaCrosse2_Update"
    	Item Temperature_WZ received update
      postUpdate(Update_WZ, new DateTimeType())

Any tip?

I have created an issue:

Is the problem only with datetime items ?

Which UI has the problem ?

IOS and basic and thus problem is concerning date time items indeed

I will try to reproduce your problem in Basic UI, we have a very similar case in the demo sitemap.
I know something was recently changed with datetime.

I can confirm the problem when using DateTime diff in sitemap attributes like valuecolor.
Diff computation with “now” was done in the wrong way !
I just proposed a fix: https://github.com/eclipse/smarthome/pull/4827

Thanks for your quick response and your fix Lolodomo!
I will follow your pull request.

Just a short question regarding the DateTime compare values for valuecolor and visibility:
Are the values

Text item=Update_WZ valuecolor=[>6000="red",>600="orange",<=600="green"]

(6000, 600) in seconds ?


Great, thanks.

I’m not knowledgeable enough to understand the whole process from pull request to distribution, but this problem still exists on the latest version, correct? Seems like that in my case at least. I can see the PR was merged to master Jan 5th, any idea when this will find its way to my Pi? :slight_smile:

This fixed in the 2.3.SNAPSHOT
You can change to SNAPSHOT now or you can wait for the 2.3 stable which I understand is not too far off now.

1 Like

Latest update brought back the orginal behaviour. Thx for solving this issue