Grafana and graphing on/off switches

Ok, I know I’m probably being thick, but how do you graph an on/off - home/away switch in Grafana like Home Assistant does? Here’s an example of Home Assistant doing it:

I have multiple device trackers and I’m trying to tune my bayesian sensor I use for presence/location detection in Home Assistant. I’d like to actually graph each device tracker and compare it to my work schedule via Google Calendar, but I’m not finding a way to do that. Anyone have an idea of how to do this in Grafana?

1 Like

Try the Discrete Panel plugin by Natal Energy. You can create similar graphs, e.g.,

2 Likes

Thanks! @philhawthorne suggested that and it’s now running! I think that’s enough winning for today :smiley: I’ll figure out how to get the data in on another day!

And how to setting this???

Question when you set this up in Grafana, How did you change the value from numeric to Home/Away and whatever else you have defined in zones?

Grafana lets you map different values to a common “discreet” state as below:

Thanks Pete,

I started to look at that early this morning. Let me ask one more question my presence detection has 5 or 6 zones, is it just figuring out which numerical number maps to which zone? Essentially I am trying to get something like this.

Figured it out really simple actually.

Had to select distinct State instead of Value … which throws in the location names by default. :slight_smile:

I can’t seem to get the Discrete Panel plugin set up right, not sure setting I am missing but when I try to do a graph with a binary sensor or presence most of the time it shows N/A. I don’t get the nice home/away charts you guys are getting.

Switches and such appear the same way, showing on or off if the state changes but N/A most of the time. What am I missing?

@jeremeyi I don’t know if you solved this yet or not, but if you change the fill option in your query from the default of null to none, it should fix the problem.

1 Like

I tried a few things. I’m getting a spike on the graph where the switch goes on and off but i’d prefer it to be shaded from on to off. Any ideas?

Try playing with the fill option… Previous or Last should work.

Thanks! Changing from count to mean and then fill to previous seems to do it! sweet!

can i display this information in a state panel
please if anyone has an idea how