If you have a 0 and a 1 logged, and your graph is for one day, then you could 
get your total energy use by

 

DEF:onoff=myfile.rrd:myds:AVERAGE

(This is now a dataset of 1 or 0)

CDEF:powerinwatts=onoff,3000,*

(This is now a dataset of Watts)

CDEF:powertmp=powerinwatts,86400,*

(This is an intermediate dataset holding 86400xWatts.  This is necessary 
because you cannot do arithmetic in a VDEF)

VDEF:totalenergy=powertmp,AVERAGE

(This is a single value of  (average power over a day, multiplied by 86400).  
Since 86400 is the number of seconds in a day, this value is therefore the 
total energy consumption for the day in Joules.)

 

Of course the above can be simplified.  If you want in kWh rather than J you 
can divide by 3600000 …

 

Steve

 

  _____  

Steve Shipway

ITS Unix Services Design Lead

University of Auckland, New Zealand

Floor 1, 58 Symonds Street, Auckland

Phone: +64 (0)9 3737599 ext 86487

DDI: +64 (0)9 923 6487

Mobile: +64 (0)21 753 189

Email:  <mailto:s.ship...@auckland.ac.nz> s.ship...@auckland.ac.nz

P Please consider the environment before printing this e-mail : 
打印本邮件,将减少一棵树存活的机会

 

From: rrd-users-bounces+s.shipway=auckland.ac...@lists.oetiker.ch 
[mailto:rrd-users-bounces+s.shipway=auckland.ac...@lists.oetiker.ch] On Behalf 
Of Jan Johansson
Sent: Monday, 18 November 2013 12:35 p.m.
Cc: rrd-users@lists.oetiker.ch
Subject: Re: [rrd-users] Calculation that is a bit over my head.

 

>I would suggest to set the DS to GAUGE

> 

>and then log 3000 when your heater is on and 0 when it is off

> 

>cheers

>tobi

 

Hello!

 

The  DS is set to gauge, but I cannot really change the value, as the 
controller in use actually talks to RRD directly, so I only have  control over 
the “read side” of things.

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________
rrd-users mailing list
rrd-users@lists.oetiker.ch
https://lists.oetiker.ch/cgi-bin/listinfo/rrd-users

Reply via email to