[rrd-users] graphing hvac thermostat?

Simon Hobson linux at thehobsons.co.uk
Sun Apr 1 09:32:25 CEST 2012

James Russo wrote:

>I have an RRD file with temperature, cooling setpoint, heating 
>setpoint, cool flag (are we cooling 1/0) and then heat flag (are we 
>heating 1/0).
>It would be nice to just throw a vline when calling for cool or 
>heat, but I don't think it is possible to capture the "transition" 
>of the values and determine the time to put the vline at.

Correct, unless your transition happens to be on a step boundary, 
then you won't see a sharp transition between 0 and 1. Once you get 
into consolidated data, then it becomes even worse since there may 
have been several transitions in (say) a 2 hour period.

What I think you might do is compare the stored cooling flag with 
some non-integer number. For example, if you compare against 0.5 then 
you've get an indication of whether you were cooling more than you 
weren't. Compare against 0.1 and you'll get an indication that you 
were doing anything but very little cooling. By the time you 
consolidate over a longer period, depending on your choice of 
threshold, you could have both cooling and heating showing as active.

You might consider using a range of colours, rather than just 2 or 3. 
I think your idea is that you'll plot in (say) blue if you've been 
cooling, red if you've been heating, and green if neither. You could 
expand that a bit, and use different gradations across the rainbow 
between red and blue. You'll need to come up with a formula to 
combine the heating and cooling quotients to get a single value - and 
this may vary with timescale of graph/consolidation period length.

Just "thinking aloud", this may give a starting point ...
If you are heating all the time, then q=2, if you are cooling all the 
time then q=0, if you are not using heating or cooling or if you heat 
and cool in equal amount (possible over 24 hours or longer) then q=1.
So you might choose to plot in green if 0.9 < q <= 1.1, in 'orangy 
green' if 1.1 < q <= 1.25, orange if 1.25 < q <= 1.5, and red of q > 

I think some experimentation may be needed.

Simon Hobson

Visit http://www.magpiesnestpublishing.co.uk/ for books by acclaimed
author Gladys Hobson. Novels - poetry - short stories - ideal as
Christmas stocking fillers. Some available as e-books.

More information about the rrd-users mailing list