Switch mapping problem

I have a problem with a switch, where mapping worked briefly, then went back to looking like a normal switch again.

It is defined like this, and at first it had three buttons, Hour, Day, and Week, but for some reason it went back to looking like a switch, but only in the browser, in the android app it got the three options.

Switch item=Temperature_Chart_Period label="Period" icon="chart" mappings=[0="Hour", 1="Day", 2="Week"]

The next problem with that, is that the three charts it should toggle between, are all showing up at the same time, instead of only the one selected.

They are defined like this

Text label="Charts" icon="chart"
{
	Switch item=Temperature_Chart_Period label="Period" icon="chart" mappings=[0="Hour", 1="Day", 2="Week"]
	Chart item=bedroomTemp period=h refresh=300 visibility=[Temperature_Chart_Period==0, Temperature_Chart_Period=="Uninitialized"]
	Chart item=bedroomTemp period=D refresh=1800 visibility=[Temperature_Chart_Period==1]
	Chart item=bedroomTemp period=W refresh=3600 visibility=[Temperature_Chart_Period==2]
}

Can anyone spot the problem?

Problem found!

Had to add this item

Number Temperature_Chart_Period "Chart period [%s]"

to get it to work. :smile:

1 Like