JSON boolean and Sitemap does not work

Hi everyone.
I have OpenHab 2.5.4 and have some json:

    "dev": [
      "sn": "28ffde8d70191aa2",
      "temp": 26
      "sn": "28ffedfb70191ac9",
      "temp": 26
   "leak": false,
   "door_open": false,
   "V_in": false,
   "V_bat": 0,
   "RSSI": -71,
   "SNR": 10

I’ve added item:

String garage_leak "Garage basement's flood raw"

and in console see this one:

smarthome:status garage_leak

i.e. JSON parsing propertly. But i’m try to add item in Sitemap:

Switch item=garage_leak label="some label" icon="smiley" visibility=[garage_leak==true]
Switch item=garage_leak label="some label" icon="water" visibility=[garage_leak==false]

and don’t see anyting at Sitemap. What am I doing wrong?

It’s a String type Item maybe? In which case, it’s state will be “true” etc.

yes, this is a String. The question is “why i’m don’t see it in Sitemap” :thinking:

Because it is a String type Item. That means its state is a string, like “true” or “banana”

Hmmm… so strange. I’ve tryied use "true", but this does not work before :grinning: :grinning:Thank you!

Sometimes it’s better to do things like -

... visibility=[garage_leak=="true"]
... visibility=[garage_leak!="true"]