diff --git a/fhem/FHEM/92_FileLog.pm b/fhem/FHEM/92_FileLog.pm index cb7611f88..ffe15fd61 100755 --- a/fhem/FHEM/92_FileLog.pm +++ b/fhem/FHEM/92_FileLog.pm @@ -599,7 +599,7 @@ FileLog_Get($@) # last2: last delta value recorded (for the very last entry) # last3: last delta timestamp (d or h) my (@d, @fname); - my (@min, @max, @sum, @cnt, @lastv, @lastd, @mind, @maxd); + my (@min, @max, @sum, @cnt, @lastv, @lastd, @mind, @maxd, @firstv, @firstd); for(my $i = 0; $i < int(@a); $i++) { my @fld = split(":", $a[$i], 4); @@ -635,6 +635,8 @@ FileLog_Get($@) $cnt[$i] = 0; $lastv[$i] = 0; $lastd[$i] = "undef"; + $firstv[$i] = 0; + $firstd[$i] = "undef"; $mind[$i] = "undef"; $maxd[$i] = "undef"; } @@ -729,6 +731,10 @@ RESCAN: } $sum[$i] += $val; $cnt[$i]++; + if($firstd[$i] eq "undef") { + $firstv[$i] = $val; + $firstd[$i] = $dte; + } $lastv[$i] = $val; $lastd[$i] = $dte; map { $cnt[$i]++; $min[$i] = 0 if(0 < $min[$i]); } @missingvals; @@ -818,6 +824,8 @@ RESCAN: $data{"cnt$j"} = $cnt[$i] ? $cnt[$i] : "undef"; $data{"currval$j"} = $lastv[$i]; $data{"currdate$j"} = $lastd[$i]; + $data{"firstval$j"} = $firstv[$i]; + $data{"firstdate$j"} = $firstd[$i]; $data{"mindate$j"} = $mind[$i]; $data{"maxdate$j"} = $maxd[$i]; $data{"lastraw$j"} = $h->{last2} if($h->{last2}); diff --git a/fhem/FHEM/98_SVG.pm b/fhem/FHEM/98_SVG.pm index 2b0736951..b56ce8fe4 100755 --- a/fhem/FHEM/98_SVG.pm +++ b/fhem/FHEM/98_SVG.pm @@ -1105,7 +1105,8 @@ SVG_getData($$$$$) { my ($d, $f,$t,$srcDesc,$showData) = @_; my (@da, $ret, @vals); - my @keys = ("min","max","avg","cnt","currval","mindate","maxdate","lastraw"); + my @keys = ("min","mindate","max","maxdate","currval","currdate", + "firstval","firstdate","avg","cnt","lastraw"); foreach my $src (@{$srcDesc->{order}}) { my $s = $srcDesc->{src}{$src}; @@ -2331,8 +2332,10 @@ plotAsPng(@) expression, so you have access e.g. to the Value functions.

If the plotmode is gnuplot-scroll or SVG, you can also use the min, max, - mindate, maxdate, avg, cnt, sum, currval (last value) and currdate (last - date) values of the individual curves, by accessing the corresponding + mindate, maxdate, avg, cnt, sum, firstval, firstdate, currval (last + value) and currdate (last date) values of the individual curves, by + accessing the corresponding + values from the data hash, see the example below: