Using LastUpdate for sitemap Item color property

lastupdate
Tags: #<Tag:0x00007f1e654ed8d0>
(Pistoletov1974) #1

I just want to change items color in sitemap if they was update long times ago. For example if item updated more than 100 min ago i want to set gray color.
I use in sitemaps this variant:

Text item=Bath_Tmp label="Температура в ванной [%.2f °C]" icon="temperature"        valuecolor=[Bath_Last_Upd=="Uninitialized"="gray",Bath_Last_Upd>100="gray"]	

and this rule:

rule "Records last lodge update time"
when
  Item Bath_Humi  received update or  Item Bath_Humi   received update 
then
  postUpdate(Bath_Last_Upd, new DateTimeType())
end

I found somwhere this example,but i am not sure this is correct and work: Bath_Last_Upd>100=“gray”/

0 Likes

(Rossko57) #2

Not going to work like that, Item will have a state like 2018-01-03T11:36:40.000+0100

I’d do it with a second Switch type Item instead. Install expire binding and configure this Item to expire to OFF after 100 mins. Modify your rule to update Switch Item ON when bath Item updated. Look for Switch on or off to do your valuecolor.

0 Likes

(Pistoletov1974) #3

Thank you very much! I will try this.
UPD: It’s works. Realy nice solution!

0 Likes