Visibility items in sitemap based on connectivity

Hi,

Any ideas how to hide items in the sitemap according to the connectivity local or myopenhab.

Something like

visibility=[WIFI_connected ==ON]

That works, but you will need to set up an item WIFI_connected that carries the info, that you want to test against (in your case “ON”); In other words, you would need to create a separate item WIFI_connected and update its status appropriately; maybe the easiest is to use getThingsStatus action or make a rule that triggers with a change in thing status (both are described in the docs under rules); once you know your status, set WIFI_connected to ON and all is well (just pay attention whether you use ON as a status or a string).
The disadvantage is that you will need to make one WIFI_connected item for each item (or maybe group of items) you want to hide/show.
Good luck

thanks @lipp_markus

i am not sure to understand how to check if the current phone is connected to wifi or not.

Moreover, at the home we are 5 different users from 5 different phones

There is no foolproof solution, so it depends how critical this issue is for you.
Search the forum for presence detection and similar and you will find quite a few approaches on how to deal with this. For apple devices there is the icloud binding, for android devices you may want to learn about "find’. There are others who work with BT beacons, and more. Just because to find out reliably whether a cell phone is present or not, is not trivial (deep sleep, simply being out of power, user left cell phone at some place, someone is home, but his/her cell phone is not).