Grafana, plot state boolean

Hi all,

I’m having Grafana running with InfluxDB, but can’t figure out how to get a plot from my on/off state from a light.
What kind of settings should i use to plot such info?

2 Likes

That worked great!
Now what if i’d like to have a graph like this, but then with let’s say 3 or more lights, all plotted above each other, creating some kind of this look:

Currently i’m only abled to this with two lights, using one of the left y and one on the right y-axis, with different offsets.
Thanks in advance!

I guess you’d have to go into the query inspector and add a fixed offset for each sensor.

I use the discrete plugin (https://grafana.com/grafana/plugins/natel-discrete-panel) to get a plot similar to what home assistant has for discrete values. Makes more sense to me than graphs. If you want graphs you’ll have to use the math variables for each sensor, no need to change the query by hand.

oh and I think you need ‘state’ instead of ‘value’ for the field.

I was not understanding why I got many float values for my binary sensors.
Thanks for the tips!