I have a simple application to determine the power generated by a water heater. One sensor (TEMPIN) measures the in-flowing cold water temperature while a second sensor (TEMPOUT) does the same for the hot water exiting the heater. The flow rate is constant and samples are stored in an rrd database. Using rrdgraph I want to display the time series of the temperatures plus the generated power in Watt. I planned to use a CDEF to calculate the power by multiplying the temperature difference by the flowrate and a constant and divide that by the time between two successive samples. A python script does it all for me. Samples come in nominally - but not exactly - at a one-second interval, therefore the CDEF does the division using a value calculated in python using rrdtool.last() just before every rrdtool.update() call and NOW in the CDEF as you might guess. Seems not all too complex you would say.... BUT: I noticed that the entire Power graph (PWR) jumps up and down over the entire time range when the time-interval (hence the division) changes and that is clearly not what I want. Here is the CDEF (as a python snippet): "CDEF:PWR=TMPOUT,TMPIN,-," + str(flowrate) + ",*,0.06978,*,NOW," + str(prevtime) + ",-,/", I spent many hours reading all the available material on CDEF, VDEF etc. but this fenomenon apparently has never come up - or this is a feature "by design". How can I accomplish that the power is calculated and displayed truly momentary per step even when the measuring interval varies? Thanks everyone!
-- View this message in context: http://rrd-mailinglists.937164.n2.nabble.com/CDEF-effects-entire-timeline-tp7583504.html Sent from the RRDtool Users Mailinglist mailing list archive at Nabble.com. _______________________________________________ rrd-users mailing list rrd-users@lists.oetiker.ch https://lists.oetiker.ch/cgi-bin/listinfo/rrd-users