Overlay Binary data on temperature graph

Hello,

I’m using Home Assistant and have integrated InfluxDB and Grafana. I have a panel to show when my AC is running or not (data comes in as a 1 or 0 for on or off). I have other panels that show the temperature reading on various rooms or the thermostat itself. I’d like to overlay all on one graph. My trouble is the binary on/off data (as 1 or 0) on a graph normally in the 60s or 70s (degrees F).

I understand I may just be missing something stupid (I’m new to Grafana). Is there a way to override the 1/0 so I can make it the min/max of the other values? Am I just missing the right keywords to google/search to find the feature I’m looking for to do this?

Currently, I do math *100 on the binary value, but it jacks with my auto min/max

I’d like to have the on/off binary functions just be at max/min of whatever the graph is. If I’m doing this completely wrong, feel free to give me some pointers. I want to learn more of this, I just ran out of keywords to search, so I came here to ask for help.

There is a secondary Y-axis option that would work well here. Basically plotting the 0/1 series on a separate (0-1) scale.

The way you set it up will depend on whether you’re using the “legacy” graph panel, or the new time-series panel (can’t quite tell from the screenshot). Maybe poke around the docs and/or the config options and see if it works for you - happy to share some more pointers if you can’t get it to work.

Thanks so much svetb! secondary Y-axis was the missing key to my joy.
Here’s the result I have so far. I have one last issue which I might not be able to get around. The legend cannot be overridden for specific queries, so it is an all of nothing. I don’t need last or max for the AC functions, just for the temps.


I am on Grafana 7.0.4 (the container that Home Assistant creates, so I am at the mercy of HA as to when it updates). To explain what I did, I could not figure out why everything was going left or right for the axis. The split axis worked when I specified the unit for my binary queries. They show as type “state” in the query. I set them to unit boolean. I also had already set a value mapping for 1=On and 0=Off for the 3 AC mode queries. After setting the first query (Cooling) to left, the other 2 modes did not need any overrides. All 3 did need the override for the unit though.

I have a sister query for each of the temps where it just grabs the max and plots a single point, giving me a nice visual on the line where the max for that time range.
Idealy, I would have loved to have a label on the graph point itself for the max, but I’ll settle for if I can have it display in the legend. The drawback is that the AC modes also display the same Last and Max, which just clutters it up (and makes it 2 lines).

Indeed, that’s not currently possible.

I wasn’t 100% clear on your follow-up questions, but it sounds like you’ve mostly got it working now

This topic was automatically closed after 365 days. New replies are no longer allowed.