I am using a Window Shutter contact which has two channels: “contact_state” and “battery_low”. the “battery_low” is a read-only switch. My aim is to show up an item in the UI ONLY for all items with the battery_low ON switch which i cant seem to realize asi dont know how to make a Channel the prerequisite for a visibility.
My code in the sitemap was:
Text item=Fensterkontakt_DG_ZimmerR_Bat icon=lowbattery visibility=[battery_low==ON]
From what i understand, you want the item to only show on a specific state. If you don’t know that state you can set visibility only to known state. You can however, use HABPanel and create a specific custom widget that will display items in a group with specific state.
Works like a charm for me. You just can’t compare two items to each other, one part of the condition has to be static, the other one has to be an item.
Some examples from my sitemap (Thermostat mode and Squeezebox title):
Text item=AZWT_MODE label="AZWT [MAP(HM-CC-RT-DN.map):%s]" visibility=[AZWT_MODE!="AUTO-MODE"]
Text item=SBB1_Title icon="info" visibility=[SBB1_Power==ON]
I still am unsure how that can help
me with my issue as the parameter for beeing visible has to be the ON state
of a channel, in this case a switch type…
Can’t find my error.
thats the magic… working now, thanks for the help.
ran into another problem: with the same example as above with the items showing in a group frame WITHOUT visibility parameter i get different display results, although all are defined the same way… for 12 of my items it shows the label and a switch (although its readable only) and for one item (the first) it shows “OFF” ADDITIONALLY (while the others have no text).
So what i would like is to hide the text “OFF” for the one item and the switch for ALL items, so they battery_low state is shown through the icon only…
yes, but as i got no definition in brackets, there shouldnt be a text and it doesnt explain why one got a text and 12 dont… and it doesnt solve my problem with the switch which shouldnt be seen…