OH 1.x Visibility: only in sitemap?

For OH1.x:
The easiest way to put a few things in a room on a sitemap is by adding them to a group and add this group to the sitemap.

What if I want to have one item only visible based on a condition?

Do I need, instead of the single group entry in the sitemap, add all items, one with a visibility condition?

Because, what I have tried: adding visibility to one item, lists this item under the group and again as single item on the sitemap?

The example:
The group “The Property” has these items:

But the tank appears one level up as well:

Which sort of implies, I have to list these items explicitly in a sitemap section?! Is this correct?

… and raises the question: Why can’t the visibility set in the .items file?

Also (in sitemap):

    Group item=gProperty	label="The Property"	icon="garden2"
    Text  item=Tank_Irrigation_Level
    Text  item=Tank_Irrigation_Command visibility=[Tank_Irrigation_Command==ON]

Does not show the command (being filled), but does so in the group (but based on visibility it shouldn’t)…

Number   Tank_Irrigation_Level		"Irrigation Tank Level [%s %%]"		<cistern>	(gProperty)	{mqtt="<[mymosquitto:ArgyleCourt/Property/IrrigationTank/WaterLevel:state:default]"}
String   Tank_Irrigation_Command	"Irrigation Tank is being filled"	<cistern>	(gProperty)	{mqtt="<[mymosquitto:ArgyleCourt/Property/IrrigationTank/WaterDemand:state:default]"}

Your assertion is correct; the widget must be defined explicitly in the sitemap. There is a clean separation between items and where they appear in UIs, so it’s not possible to set visibility directly on an item. Sitemaps and UIs would have to be enhanced or functionally replaced in order to support having a widget appear in groups as defined in a different place with customised options like visibility,

1 Like

OK, I get the separation issues (sitemap | items)

So, it is also correct to have either a group as a sitemap item; or if one item in the group has a visibility condition, all items need to be listed individually in their section. ??

In order the use the visibility attribute of a sitemap widget, you have to explicitly define the widget in the sitemap. Items don’t have visibility – sitemap widgets do. Having a group item in a sitemap means all rendering of items in the group are the default for that type of item.

Aha… meaning a groups default visibility is (implicitly) set to yes (visible). Otherwise one has to use widgets for every item in a group (if only one item in the group requires a visibility constraint).

I just played with this, and I cannot for instance, take the two tank items out of the property and list them as widgets with the group gProperty.

In any case: thanks… at least things are clearer now.

Groups seem to be about control (grouping all lights together) and less about display. I admit that it is easier and even nicer in the UI when you use groups that way but you have so much more freedom when you design in the .sitemap instead of the .item.