Switching OFF/Hiding Chart Display with button

openhab2
charts
switch
Tags: #<Tag:0x00007f1e5ff97728> #<Tag:0x00007f1e5ff975e8> #<Tag:0x00007f1e5ff97458>
(Andy) #1

Hi All,

I display some values on different charts as per example below. I can switch between Hour, Day & Week.

Chart

I would like to add additional switch (No4) to switch OFF chart display completely when not looking at it.

Below is the configuration from sitemap I use.

Switch item=MyDevice6_Time_Day_Period label="Chart Period" mappings=[0="Hour", 1="Day", 2="Week"] icon="chart"
               Chart item=MyDevice6_Time_Day period=h refresh=6000 visibility=[MyDevice6_Time_Day_Period==0, MyDevice6_Time_Day_Period=="Uninitialized"]
               Chart item=MyDevice6_Time_Day period=D refresh=30000 visibility=[MyDevice6_Time_Day_Period==1]
               Chart item=MyDevice6_Time_Day period=W refresh=30000 visibility=[MyDevice6_Time_Day_Period==2]

Assuming I will have to add switch number 3 to mapping (3=“OFF”] , but not sure if I need to add any syntax in visibility below.

Many thanks

0 Likes

Sitemap showing energy market prices by hour
RRD4J no charts
(Andy) #2

Just an update. Adding an additional option to mapping as per my suggestion below seems to work at the moment :grinning:. I will be checking logs to ensure there are no errors related to this addition.

1 Like