# Chart, a temperature and a switch

Tags: #<Tag:0x00007f213c81b6e0>

(Psyciknz) #1

Can I make a chart with a temperature (in the 20s) and a switch, so I can see when the switch is on.

I think I’ve done it, but I think it’s treating the on and off as 1 and 0. How can I get the switch to register the on/off as say 0 and 10 so it’s closer to the temperature scale?

(Stefan) #2

Are you using OH1 or OH2? In OH1 the ON/OFF value of the switch is transformed to 0/1, so that it can be displayed on a chart. In OH2, this is not possible (at the moment). You can however define a number item and create a rule which sets the number item to 0/1, according to the switch state. And then display the number item in the chart.

With this rule, you can also set the value to 0/10 instead of 0/1.

(Psyciknz) #3

Using 1.

Is there no way of changing the value on the chart? Or two y axis?

I guess I could add a rule and when switch is ON, Store, 10

(Rich Koshak) #4

I highly recommend InfluxDB+Grafana for anything but the simplest of charts. Or look at Habpanel which has flexible and attractive charts as well.

(Tommy Sharp) #5

Yeah the easiest way would probably be to have a rule that sets a Number to 10 or something when the switch is ON.