Text item visibility with "or"

Hi, i have a text item which sometimes show wrong numbers.

So i want to make the item visible only if the number is valid and not 0.

Text item=HeatPump_alarm visibility=[HeatPump_alarm!=0 or HeatPump_alarm!=16384]

But this doesn´t work. If the alarm is 16384 it is visible.

If i only make the visibility to 0 it works, but with “OR” in it, it will not work.

What´s wrong?

According to the wiki you use a comma, not logical operators, to have multiple conditions under which an item is visible. So your sitemap element should be:

Text item=HeatPump_alarm visibility=[HeatPump_alarm!=0, HeatPump_alarm!=16384]

As far as I can tell that is functionally equivalent to an OR. There is no support for AND it would appear.

I tried with and first, but this was not working also.

But will this work with a comma?

If the item is 16384: It is not 0 --> so it is visible - it doesn´t matter if it´s 16384 because it is 0 and so it is visible???

In this case i can´t use it like i want to have it.

1 Like

It is not working with comma. [or] is not the right command for my use case. It has to be [and].

How can I fix this? I want to have the alarm item visible only if it is bigger as 0 and smaller as 16384. Maybe with < and > signs? But I don’t know how to set this up without having the same problem like above.

Have you tried

[HeatPump_alarm>0, HeatPump_alarm<16384]

The wiki says “If any of the rules are true then the item will be visible” so this should work and I think it is what you really want. Before, assuming it worked, would not have hidden the item if it was -1 or 16385.

But your logic statement will always be true.

Any number is bigger than 0 or smaller 16385

There is no way to control visibility the way you want because the logic “when HeatPump_alarm is not 0, or HeatPump_alarm is not 16384” always returns true. There is no AND operator available.

What you can do is to use an additional frame, without a label. Downside is, that there will be a slightly visible frame on the sitemap, but you can add a second visibility condition to get a kind of a AND logic:

		Frame label="" visibility=[ConditionSwitch1=="ON"] {
			Text item=Item_1 icon="switch" visibility=[ConditionSwitch2=="ON"]

Edit: TIL, and maybe also worth mentioning here, that frame in frame is not allowed and android app is not capable visualizing it (although iOS + browser obviously are):

1 Like