I have a similar solution for my heating, maybe this helps you. Also if anybody knows a better way to do it i’m grateful for any hints.
What i’ve done is creating additional items for the Icons:
Number WZHIcon "Heating Icon Livingroom"
with a rule i check the temperature at every change and change the value of the item depending on the temperature range:
rule "ChangeHeatingWZHIcon" when Item WZHeizung received update then if (WZHeizung.state >= 0 && WZHeizung.state <=20) {postUpdate(WZHIcon, 0) } if (WZHeizung.state > 20 && WZHeizung.state <= 40) {postUpdate(WZHIcon, 20) } if (WZHeizung.state > 40 && WZHeizung.state <= 60) {postUpdate(WZHIcon, 40) } if (WZHeizung.state > 60 && WZHeizung.state <= 80) {postUpdate(WZHIcon, 60) } if (WZHeizung.state > 80 && WZHeizung.state < 100) {postUpdate(WZHIcon, 80) } end
after this i’ve made multiple entries in the sitemap and used the visibility to only show the one entry depending on the value of the item WZHIcon:
Text item=WZHeizung label="Heizung [%d %%]" icon="heating-0" visibility=[WZHIcon==0] Text item=WZHeizung label="Heizung [%d %%]" icon="heating-20" visibility=[WZHIcon==20] Text item=WZHeizung label="Heizung [%d %%]" icon="heating-40" visibility=[WZHIcon==40] Text item=WZHeizung label="Heizung [%d %%]" icon="heating-60" visibility=[WZHIcon==60] Text item=WZHeizung label="Heizung [%d %%]" icon="heating-80" visibility=[WZHIcon==80]