Is visibility attribute not implemented in OH3.0?

  • Platform information: Docker

    • Hardware: Synology NAS
    • OS: DSM 6.2.3
    • Java Runtime Environment: 11
    • openHAB version: 3.0.0 Milestone Build
  • Issue of the topic: Inside the GUI in Settings -> Pages -> Sitemap I want to add a Chart with visibility depending on the selected period. Since visibility is not added in Design mode I am trying to add it in Code mode and I immediately get the following error:

Error: Syntax error at line 6 col 53:

                  Chart item=EMeter_Power period="3h" visibility
                                                      ^
Unexpected identifier token: "visibility". Instead, I was expecting to see one of the following:
        Text icon="line" label="Power [%s W]" item=EMeter_Power {
            Selection item=EMeter_Power_Graph mappings=[0="3 hours",1="6 hours",2="12 hours",3="Day",4="3 days",5="Week",6="Month"]
            Chart item=EMeter_Power period="3h" visibility=[EMeter_Power_Graph==0, EMeter_Power_Graph=="NULL"]
        }

And when I switch to Design mode and then back to Code mode the visibility attribute is gone. Probably because it is not recognizing it.

So is visibility attribute not yet implemented? Or is there something wrong with my declaration in the sitemap?

Correct.

I want to jump in here.

The issue is still open since last year. Will it ever implemented and if not, is there a workaround? I use it very often in my sitemap.

1 Like

The workaround is to use s sitemap file like in OH2.

@hafniumzinc Thanks for the link :slight_smile:

Is there a plan to implement visibility attribute in Design or Code mode later in OH3?

I see, visibility is working in text based sitemaps. But not in the GUI. Great, this helps a lot.

Just to make sure I understand, this may sound dumb, but bare with me. Does “visibility is working in text based sitemaps. But not in the GUI.” mean that it works in sitemaps so that OH3 will not fail if they are there, but the web and android GUI just draw it wrong? Or should it actually work somehow via text based site map?

As I just upgraded from 2.5.1 to 3.0.1, and I have used Switch item=sonoff_yk_sohva_oikea label="Sohva ikkunalla" icon=light visibility=[network_device_192_168_117_70_online==ON] kind of items, which are hidden if the device does not appear in the network. And now this sitemap served from OH3 via either GUI or Android app does not honor that. And this definition is in text sitemap. So in my logic, they don’t work, right? Or is there some way to do it differently in OH3?