[rrd-users] Handling solar inverter data in rrdtool ?

Alex van den Bogaerdt alex at vandenbogaerdt.nl
Fri Jul 6 05:07:37 CEST 2012

From: "Joel HATSCH" <j-ml at joel-hatsch.net>
To: <rrd-users at lists.oetiker.ch>
Sent: Friday, July 06, 2012 12:50 AM
Subject: Re: [rrd-users] Handling solar inverter data in rrdtool ?

> On Monday 02 July 2012 08:20:16 Simon Hobson wrote:
>> Joel HATSCH wrote:
>> >My inverter (SMA) records every 5 minutes the instantaneous power and 
>> >the
>> >overall yield (both in kW (resp kWh), float with 3 decimal places).
>> I'd say use the counter. I assume the instantaneous reading is
>> actually for the instant read rather than an average over the
>> previous 5 minutes and so may well be significantly different.Long
>> term it will probably average out and be fairly accurate, but short
>> term may be way out.

Agreed (provided that the assumption holds).

>> Since you aren't likely to want anything other than kWH in your
>> output, I'd suggest just storing that. Internally it will be stored
>> as KWH/s (all things are stored as rates) and so on output you'll
>> need to multiply by your time span to get a total amount of energy.
>> Eg, if doing daily figures, multiply by 86400 and you'll kWH/day.

This will work, but you should also think about the alternative. Or, rather,
the more scientific approach, where Simon's suggestion is the alternative.

> I knew I was missing something very obvious... data is stored as rates,
> therefore you must multiply it by the period of integration/time. Was 
> still
> thinking in discrete data series inside my spreadsheet.

Instead of storing kWh/s, you could also consider storing J/s (Joules per 

One kWh is just a packet of 3600000J:
k is for kilo, 1000.
W is Watt, which is Joules per second
h is hour.  No division here, but a multiplication, so "during 3600 
Divide by seconds then multiply by seconds means the seconds can be crossed 
out (unless zero seconds, which will not happen).
1000 x J/s x 3600s = 3600 x 1000 x J = 3,600,000 J

If your counter counts kWh then multiply by 3600000 and feed that number to 
RRDtool. RRDtool will automatically divide by number of seconds, and thus 
store the average number of Watts during that interval.

If this is only useless extra math, then go for Simon's suggestion.  But if 
you ever would like to display something else, such as Watts generated 
during the day, then you probably want to have the "raw" data.

I don't know if you will ever encounter it, but my suggestion also prevents 
weird output such as kkWh (on very sunny days) or mkWh (solar panel covered 
with snow).

More information about the rrd-users mailing list