From 1d8e3022c7fc3dfaf8b1045ef361cb1594d1f3fc Mon Sep 17 00:00:00 2001 From: rudolfkoenig <> Date: Fri, 2 Apr 2010 10:22:38 +0000 Subject: [PATCH] FileLog avg fix git-svn-id: https://svn.fhem.de/fhem/trunk@613 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/92_FileLog.pm | 6 +++--- fhem/docs/fhem.html | 17 +++++++++++------ fhem/webfrontend/pgm2/km271_1.gplot | 8 ++++---- 3 files changed, 18 insertions(+), 13 deletions(-) diff --git a/fhem/FHEM/92_FileLog.pm b/fhem/FHEM/92_FileLog.pm index a2b587381..50d245732 100755 --- a/fhem/FHEM/92_FileLog.pm +++ b/fhem/FHEM/92_FileLog.pm @@ -153,7 +153,7 @@ FileLog_Set($@) # - delta-h / delta-d to get rain/h and rain/d values from continuous data. # # It will set the %data values -# min, max, avg, cnt, lastd, lastv +# min, max, avg, cnt, lastd, lastv, sum # for each requested column, beggining with = 1 sub @@ -315,8 +315,8 @@ FileLog_Get($@) $min[$i] = $val if($min[$i] == 999999); $max[$i] = $val if($max[$i] == -999999); $lastv[$i] = $val if(!$lastv[$i]); - $sum[$i] = $val if(!$sum[$i]); - $cnt[$i] = 1 if(!$cnt[$i]); + $sum[$i] = ($sum[$i] ? $sum[$i] + $val : $val); + $cnt[$i]++; my @lda = split("[_:]", $lastdate{$hd}); my $ts = "12:00:00"; # middle timestamp diff --git a/fhem/docs/fhem.html b/fhem/docs/fhem.html index 06c468946..ea6b718d7 100644 --- a/fhem/docs/fhem.html +++ b/fhem/docs/fhem.html @@ -87,6 +87,9 @@ screenshot gallery

+ fheME: screenshot gallery +

+ iPhone frontends: fhemgw, @@ -120,9 +123,8 @@
  • Via an attached CUL or CUN (see www.busware.de) access to the - following protocols: FS20 (Receive/Send, all devices), EM (EM1000EM, - EM1000GZ and EM1000WZ), FHT80b, HMS, S300 (KS300, S300TH, KS555, - S555TH, etc)
  • + following protocols: FS20 (all devices), EM (EM1000EM, EM1000GZ and + EM1000WZ), FHT80b, HMS, S300 (KS300, S300TH, KS555, S555TH, etc)
  • Via an attached FHZ1000 or FHZ1300 access to the following protocols: @@ -155,9 +157,12 @@
  • Via an attached DS9490R or DS9097 - access to the following sensors: DS18S20, DS1820, DS18B20
  • + href="http://owfs.org/index.php?page=usb-ds9490r">DS9490R or DS9097 + access to the following sensors: DS18S20, DS1820, DS18B20 +
    + +
  • Via an attached KM271 access to the Buderus Logamatic 2107
diff --git a/fhem/webfrontend/pgm2/km271_1.gplot b/fhem/webfrontend/pgm2/km271_1.gplot index 545dc9d76..aa5feaa44 100644 --- a/fhem/webfrontend/pgm2/km271_1.gplot +++ b/fhem/webfrontend/pgm2/km271_1.gplot @@ -18,11 +18,11 @@ set format y "%0.1f" set ylabel "Minutes" set yrange [0:] -#FileLog 4:Warmwasseristtemperatur:0: -#FileLog 4:Brennerlaufzeit:0:delta-h +#FileLog 4:WW_Isttemperatur:0: +#FileLog 4:Brenner_Laufzeit1_Minuten\x3a:0:delta-h -plot "" using 1:4 axes x1y2 title 'WW-Temp' with lines lw 2,\ - " | perl -ane '\ +plot "" using 1:4 axes x1y2 title 'WW-Temp' with lines lw 2,\ + " | perl -ane '\ @a = split(\"[_:]\", $F[0]);\ if(defined($lh) && $lh ne $a[1])\ { printf(\"${ld}_$lh:30:00 %f\n\", $hv); $hv = 0; }\