String WasserStand “Füllstand Frischwasser: [%s]”
Number WasserProzent “” { channel=“exec:command:CheckWasserProz:output”}
Number WasserLiter “” { channel=“exec:command:CheckWasserLiter:output”}
Sitemap
Text item=WasserStand icon="measurecup" labelcolor=[!=1="black"] valuecolor=[!=1="green"]
Rules
rule “update WasserStand”
when
Item WasserProzent received update or
Item WasserLiter received update
then
WasserStand.postUpdate(WasserProzent.state.toString+" % / “+ WasserLiter.state.toString+” L")
end
I found Icons (cistern-0 … cistern-100). what i have to chanage so i can see the icon depending on WasserProzent???
You cannot base a dynamic icon for a sitemap widget assigned to one Item, on the state of some other Item.
The closest effect you can get to what you are trying to do -
Use a Number Item, and update it with your 0-100 level so that it can be used with the dynamic icons. Suppress the state display if you like.
In your updating rule, do not postUpdate your combination text to the Item.
Instead, assign your text as the Item label. someItem.label = "my text " + "more text []"
Because the UIs are not intended to work with dynamic labels, the refresh may not be very good.
If you had only a few icons you wanted to show, you could instead use the visibility= option in your sitemap widget, to show one of a number of similar widgets with different icons. The visibility= parameter can involve a different Item to the main Item of the widget.