mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-04-16 04:36:02 +00:00
KM271 log fixes
git-svn-id: https://svn.fhem.de/fhem/trunk@589 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
8c205d412f
commit
e627993c87
@ -262,15 +262,15 @@ FileLog_Get($@)
|
||||
|
||||
} elsif($t == 2) { # delta-h or delta-d
|
||||
|
||||
my $hd = $h->{didx};
|
||||
my $ld = substr($fld[0],0,$hd);
|
||||
my $hd = $h->{didx}; # TimeStamp-Length
|
||||
my $ld = substr($fld[0],0,$hd); # TimeStamp-Part (hour or date)
|
||||
if(!defined($h->{last1}) || $h->{last3} ne $ld) {
|
||||
if(defined($h->{last1})) {
|
||||
my @lda = split("[_:]", $lastdate{$hd});
|
||||
my $ts = "12:00:00"; # middle timestamp
|
||||
my $ts = "12:00:00"; # middle timestamp
|
||||
$ts = "$lda[1]:30:00" if($hd == 13);
|
||||
my $v = $fld[$col]-$h->{last1};
|
||||
$v = 0 if($v < 0); # Skip negative delta
|
||||
$v = 0 if($v < 0); # Skip negative delta
|
||||
$dte = "$lda[0]_$ts";
|
||||
$val = sprintf("%0.1f", $v);
|
||||
}
|
||||
@ -279,7 +279,6 @@ FileLog_Get($@)
|
||||
}
|
||||
$h->{last2} = $fld[$col];
|
||||
$lastdate{$hd} = $fld[0];
|
||||
|
||||
} elsif($t == 3) { # int function
|
||||
$val = $1 if($fld[$col] =~ m/^(\d+).*/o);
|
||||
|
||||
@ -312,7 +311,12 @@ FileLog_Get($@)
|
||||
my $h = $d[$i];
|
||||
my $hd = $h->{didx};
|
||||
if($hd && $lastdate{$hd}) {
|
||||
my $val = defined($h->{last1}) ? $h->{last2}-$h->{last1} : 0;
|
||||
my $val = defined($h->{last1}) ? $h->{last2}-$h->{last1} : 0;
|
||||
$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]);
|
||||
|
||||
my @lda = split("[_:]", $lastdate{$hd});
|
||||
my $ts = "12:00:00"; # middle timestamp
|
||||
|
@ -240,8 +240,9 @@ SVG_render($$$$$$)
|
||||
# Round values, compute a nice step
|
||||
next if(!defined($hmax{$axis}));
|
||||
my $dh = $hmax{$axis} - $hmin{$axis};
|
||||
my ($step, $mi, $ma);
|
||||
my @limit = (1,2,5,10,20,50,100,200,500,1000,2000,5000,10000);
|
||||
my ($step, $mi, $ma) = (1, 1, 1);
|
||||
my @limit = (1,2,5,10,20,50,100,200,500,1000,2000,5000,10000,
|
||||
20000,50000,100000,200000,500000,1000000,2000000);
|
||||
for my $li (0..int(@limit)-1) {
|
||||
my $l = $limit[$li];
|
||||
next if($dh > $l);
|
||||
|
41
fhem/webfrontend/pgm2/km271_1.gplot
Normal file
41
fhem/webfrontend/pgm2/km271_1.gplot
Normal file
@ -0,0 +1,41 @@
|
||||
############################
|
||||
# Display the Water temperature and burner runtime values.
|
||||
# Corresponding FileLog definition:
|
||||
# define KM271 FileLog /var/log/fhem/km271-%Y.log KM271
|
||||
|
||||
set terminal png transparent size <SIZE> crop
|
||||
set output '<OUT>.png'
|
||||
set xdata time
|
||||
set timefmt "%Y-%m-%d_%H:%M:%S"
|
||||
set xlabel " "
|
||||
set ytics nomirror
|
||||
set y2tics
|
||||
set title '<L1>'
|
||||
set grid
|
||||
|
||||
set y2label "Temperature in C"
|
||||
set format y "%0.1f"
|
||||
set ylabel "Minutes"
|
||||
set yrange [0:]
|
||||
|
||||
#FileLog 4:Warmwasseristtemperatur:0:
|
||||
#FileLog 4:Brennerlaufzeit:0:delta-h
|
||||
#FileLog 4:Brennerlaufzeit:0:delta-d
|
||||
|
||||
plot "<IN>" using 1:4 axes x1y2 title 'WW-Temp' with lines lw 2,\
|
||||
"<grep Brennerlaufzeit <IN> | perl -ane '\
|
||||
@a = split(\"[_:]\", $F[0]);\
|
||||
if(defined($lh) && $lh ne $a[1])\
|
||||
{ printf(\"${ld}_$lh:30:00 %f\n\", $hv); $hv = 0; }\
|
||||
if($lv) { $hv += ($F[3]-$lv); }\
|
||||
$lh = $a[1]; $ld = $a[0]; $lv = $F[3];\
|
||||
END { printf(\"${ld}_$lh:30:00 %f\n\", $hv) }'"\
|
||||
using 1:2 axes x1y1 title 'Runtime/h (Min)' with histeps,\
|
||||
"<grep Brennerlaufzeit <IN> | perl -ane '\
|
||||
@a = split(\"[_]\", $F[0]);\
|
||||
if(defined($ld) && $ld ne $a[0]) {\
|
||||
printf(\"${ld}_12:00:00 %f\n\", $dv); $dv = 0; }\
|
||||
if($lv) { $dv += ($F[3]-$lv); }\
|
||||
$ld = $a[0]; $lv = $F[3];\
|
||||
END {printf(\"${ld}_12:00:00 %f\n\", $dv)}'"\
|
||||
using 1:2 axes x1y1 title 'Runtime/day (Min)' with histeps
|
Loading…
x
Reference in New Issue
Block a user