Sitemap visibility in OpenHAB3?


I have changed my system from OpenHAB2 to OpenHAB 3.1.

In version v2 I have this source code in my sitemap, there I can view the rigth Chart with the visibility patameter

Text label="OG SPZ Aufzeichnung" icon="line" {
  Switch item=Chart_og_sp_aufzeichnung label="" icon="line" mappings=[0="4 Std", 1="Tag", 2="Woche", 3="Monat"]
  Text label="Temperatur" icon="temperature"
  Chart item=g_og_sp_temperatur period=4h refresh=60000  visibility=[Chart_og_sp_aufzeichnung==0] 
  Chart item=g_og_sp_temperatur period=D  refresh=60000  visibility=[Chart_og_sp_aufzeichnung==1,  Chart_og_sp_aufzeichnung=="NULL"]
  Chart item=g_og_sp_temperatur period=W  refresh=60000  visibility=[Chart_og_sp_aufzeichnung==2] 
  Chart item=g_og_sp_temperatur period=M  refresh=60000  visibility=[Chart_og_sp_aufzeichnung==3] 					

In the UI OpenHAB3 there is no field for “visibility” only for “service”.
And if I add the visibility in the code and i change back to the Design-Mode, the visibility is lost.

How can I now do the functionality from OpenHAB2 visibility?

Thank you!

The UI built sitemaps do not support visibility yet. You’ll have to stick to .sitemap files for now.

when will OpenHAB3 be able to visibility from the UI?

When someone implements it. openHAB is a 100% volunteer effort.

1 Like

Got the point…but how?
If I have in OH3 such sitemap

and we stated we cannot use “Code” (red circle) to customize the item visibility, where I should the OH2 old-fashion

Text item=Moon_Elevation icon="sunmoon" visibility=[Moon_Elevation > 0]

(it works with a full textual sitemap, without no UI sitemap)

What should be the .sitemap filename in /etc/openhab/sitemaps where to add the aforementioned directive? In other words, if I have the UI sitemap, how can I integrate it with a textual sitemap?

That won’t work via the UI!
Place your .sitemap file into the known sitemap folder and call it for display like:

You can add that link to the MainUI sidemenu, however I’d have to search for the how to do that.

1 Like

Sorry, it didn’t answer to my question.

The textual .sitemap will integrate the UI sitemap or I have to keep just the textual .sitemap?

If my UI sitemap is called “E&E_new” with defined Moon_Elevation item + I need to hide such item under condition, I would like to know

  1. what should be the exact filename for complementary textual “mysitemap.sitemap”
  2. what should I write inside this textual .sitemap to enable/disable visibility for Moon_Elevation when itself is greater than 0. Please provide for fenced code or screenshot of the textual .sitemap

This. Don’t use MainUI at all. Put a .sitemap file in $OH_CONF/sitemaps and display it using BasicUI.


OK, so I have to keep my .sitemap textual version, in the same version I adopted since years, without exploiting the UI sitemap.
It’s a shame, as, unless to say, the UI approach is much more versatile, as it can be viewed and shown also by remote and in “any” device (my openHAB instance runs on a Raspberry PI3), without having physical access to $OH_CONF/ folder.

But, since UI approach sounds so limited against the textual approach, I got the point.
I hope it will change in the future.

Thanks for your support

tried to upgrade from OH2 to OH3,

   Frame label="doors" {
        Switch item=GarageSafety
        Switch item=GarageOut label="Garage: " icon="garagedoor" visibility=[GarageSafety==ON]

In OH3, I defined items for GarageOut and for GarageSafety.
All works, but when I switch GarageSafety on, on UI, only If I press F5 for reload, the GarageOut is displayed.

How Can I “refresh” automatically?

I face the same issue (sometimes), that visibility / or even item states are not updated and sitemap must be refreshed.

Unfortunately it’s not really reproducable and happens from time to time.

hi, you are absolutely right. today all works perfect without changing code. thanks

yes, that’s pretty strange… maybe you can find anything, how this behaviour is “forced” and therefore reproducable that we can raise an issue…