[rrd-users] help required to graph photovoltaic electricity savings

Thomas Parvais tparvais at gmail.com
Wed Nov 28 14:02:14 CET 2012


Hello

I've photovoltaic pannels installed on my roof. I also install an energy
counter (1 pulse = 1 Wh) to measure my own electricity production.

I finally succeed to use RRDtool to graph my solar production:
http://nas.parvais.com/domotique/electricite-prod_pv.php

I also use the same principle to measure the electricity I need to buy from
my supplier.: http://nas.parvais.com/domotique/electricite-conso.php

Here is below the subroutine (perl) used to chart my production or my
consumption(RRD file with 2 DS conso / prod)

I would like to to two new improvements, for which I'm lost:

1. make a difference peak-hour / offpeak hours as electricity costs are
cheaper between 19h00 & 7H00 and during week end. Make clear color
distrinction on graphs
2. print on the same graph (second right axis) a new line with the
correspondance between energy prodution / consumption (W*h) an EURO (we
know i.e 1kWh costs 0.15€ off peak and 0.25€ peak)


Can you make me some suggestion ? should I reword my RRD file structure ?
(it's still the time, as I'm not yet in production)

Thank you for any idea and web reference

Thomas


sub CreateGraph
# inputs: $_[0]: sensor_rrd_name
# $_[1]: chart title
# $_[2]: interval period (1h,24h,7d,1m,1y,10y)
# $_[3]: Display Puissance instantanee (1/0)
# $_[4]: Moving average timeperiod
# $_[5]: Moving average Timeperiod unit
# $_[6]: picture prefix-filename
{
my @rrd=();
push @rrd, "$dir_img/$_[6]-$_[2].png";
push @rrd, "--start=end-$_[2]";
push @rrd, "--end=now";
push @rrd, "--width=500";
push @rrd, "--height=200 -j";
push @rrd, "--slope-mode";
push @rrd, "--title=$_[1]";
push @rrd, "--vertical-label=Watt";
push @rrd, "--lower-limit=0";
push @rrd, "--alt-autoscale-max";
push @rrd, "--watermark=$TimeStamp";
push @rrd, "--imgformat=PNG";
push @rrd, "DEF:energy=$rrd_file:$_[0]:AVERAGE";
push @rrd, "CDEF:Watt=energy,3600,*";
push @rrd, "AREA:Watt#00FF00:";
push @rrd, "VDEF:WattHour=energy,TOTAL";
push @rrd, "CDEF:mean=Watt,$_[4],TREND";
push @rrd, "COMMENT:\\n";
push @rrd, "COMMENT:\\n";
push @rrd, "LINE2:Watt#0000FF:Puissance instantanee";
push @rrd, "LINE1:mean#A00000:Puissance moyenne $_[5]:";
push @rrd, "COMMENT:\\n";
push @rrd, "COMMENT:\\n";
push @rrd, "GPRINT:WattHour:Energie totale\\:%3.2lf%sWh";
push @rrd, "GPRINT:eurotot:Argent\\:%3.2lfeuro";
push @rrd, "GPRINT:Watt:LAST:      Puissance Instantanee\\:%3.2lf%sW\\j";
push @rrd, "COMMENT:\\n";
push @rrd, "COMMENT:\\n";
push @rrd, "GPRINT:Watt:MIN:Min\\:%3.2lf%sW";
push @rrd, "GPRINT:Watt:AVERAGE:Moyenne\\:%3.2lf%sW";
push @rrd, "GPRINT:Watt:MAX:Max\\:%3.2lf%sW\\j";
push @rrd, "COMMENT:\\n";
push @rrd, "COMMENT:\\n";
 print "@rrd\n\n" if ($verbose==1);
 RRDs::graph(@rrd);
 if ($ERROR = RRDs::error) { print "$0: failed to generate graph $_[0] data
into rrd: $ERROR\n"; }
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.oetiker.ch/pipermail/rrd-users/attachments/20121128/d58912d2/attachment-0001.htm 


More information about the rrd-users mailing list