mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-03-12 16:46:35 +00:00
4.5 Prep
git-svn-id: https://svn.fhem.de/fhem/trunk@274 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
d51f8d37f5
commit
cd7523c23d
@ -27,7 +27,7 @@ CUL_WS_Initialize($)
|
||||
$hash->{DefFn} = "CUL_WS_Define";
|
||||
$hash->{UndefFn} = "CUL_WS_Undef";
|
||||
$hash->{ParseFn} = "CUL_WS_Parse";
|
||||
$hash->{AttrList} = "do_not_notify:0,1 showtime:0,1 model:S300TH loglevel";
|
||||
$hash->{AttrList} = "do_not_notify:0,1 showtime:0,1 model:S300TH,KS300 loglevel";
|
||||
}
|
||||
|
||||
|
||||
@ -41,8 +41,8 @@ CUL_WS_Define($$)
|
||||
return "wrong syntax: define <name> CUL_WS <code> [corr1...corr4]"
|
||||
if(int(@a) < 3 || int(@a) > 6);
|
||||
$a[2] = lc($a[2]);
|
||||
return "Define $a[0]: wrong CODE format: valid is 1-7"
|
||||
if($a[2] !~ m/^[1-7]$/);
|
||||
return "Define $a[0]: wrong CODE format: valid is 1-8"
|
||||
if($a[2] !~ m/^[1-8]$/);
|
||||
|
||||
$hash->{CODE} = $a[2];
|
||||
$hash->{corr1} = ((int(@a) > 3) ? $a[3] : 0);
|
||||
@ -79,7 +79,7 @@ CUL_WS_Parse($$)
|
||||
my $firstbyte = hex($a[1]);
|
||||
my $cde = ($firstbyte&7) + 1;
|
||||
|
||||
my $type = $tlist{$a[2]} ? $tlist{$a[2]} : "unknown";
|
||||
my $type = $tlist{$a[2]} ? $tlist{$a[2]} : "unknown";
|
||||
if(!$defptr{$cde}) {
|
||||
Log 1, "CUL_WS UNDEFINED $type sensor detected, code $cde";
|
||||
return "UNDEFINED CUL_WS: $cde";
|
||||
|
@ -19,7 +19,7 @@ CUL_EM_Initialize($)
|
||||
$hash->{DefFn} = "CUL_EM_Define";
|
||||
$hash->{UndefFn} = "CUL_EM_Undef";
|
||||
$hash->{ParseFn} = "CUL_EM_Parse";
|
||||
$hash->{AttrList} = "do_not_notify:0,1 showtime:0,1 model:S300TH loglevel";
|
||||
$hash->{AttrList} = "do_not_notify:0,1 showtime:0,1 model:EMEM,EMWZ,EMGZ loglevel";
|
||||
}
|
||||
|
||||
#####################################
|
||||
|
@ -64,18 +64,18 @@ WS300_Initialize($)
|
||||
my ($hash) = @_;
|
||||
|
||||
# Provider
|
||||
$hash->{Clients} = ":WS300:";
|
||||
$hash->{ReadFn} = "WS300_Read";
|
||||
$hash->{WriteFn} = "WS300_Write";
|
||||
$hash->{Type} = "FHZ1000";
|
||||
$hash->{Match} = "^WS300.*";
|
||||
$hash->{SetFn} = "WS300_Set";
|
||||
$hash->{GetFn} = "WS300_Get";
|
||||
$hash->{DefFn} = "WS300_Define";
|
||||
$hash->{UndefFn} = "WS300_Undef";
|
||||
$hash->{ParseFn} = "WS300_Parse";
|
||||
$hash->{ReadFn} = "WS300_Read";
|
||||
$hash->{AttrList} = "do_not_notify:0,1 showtime:0,1 model:ws300 loglevel:0,1,2,3,4,5,6";
|
||||
$hash->{DefFn} = "WS300_Define";
|
||||
$hash->{GetFn} = "WS300_Get";
|
||||
$hash->{ParseFn} = "WS300_Parse";
|
||||
$hash->{SetFn} = "WS300_Set";
|
||||
$hash->{UndefFn} = "WS300_Undef";
|
||||
|
||||
$hash->{Clients} = ":WS300:"; # Not needed
|
||||
$hash->{Match} = "^WS300.*"; # Not needed
|
||||
$hash->{ReadFn} = "WS300_Read"; # Not needed
|
||||
$hash->{Type} = "FHZ1000"; # Not needed
|
||||
$hash->{WriteFn} = "WS300_Write"; # Not needed
|
||||
}
|
||||
|
||||
###################################
|
||||
|
@ -66,6 +66,7 @@ at_Define($$)
|
||||
}
|
||||
$hash->{NTM} = $ntm if($rel eq "+" || $fn);
|
||||
$hash->{TRIGGERTIME} = $nt;
|
||||
RemoveInternalTimer($name);
|
||||
InternalTimer($nt, "at_Exec", $name, 0);
|
||||
|
||||
$hash->{STATE} = ("Next: " . FmtTime($nt))
|
||||
|
@ -794,6 +794,8 @@ FW_showLog($)
|
||||
if($pm =~ m/gnuplot/) {
|
||||
|
||||
my $tmpfile = "/tmp/file.$$";
|
||||
my $errfile = "/tmp/gnuplot.err";
|
||||
|
||||
if($pm eq "gnuplot" || !$__devs{$d}{from}) {
|
||||
|
||||
# Looking for the logfile....
|
||||
@ -819,7 +821,7 @@ FW_showLog($)
|
||||
$gplot_script =~ s/(set timefmt ".*")/$1\n$fr/;
|
||||
}
|
||||
|
||||
open(FH, "|gnuplot > /dev/null");# feed it to gnuplot
|
||||
open(FH, "|gnuplot >> $errfile 2>&1");# feed it to gnuplot
|
||||
print FH $gplot_script;
|
||||
close(FH);
|
||||
|
||||
@ -864,7 +866,7 @@ FW_showLog($)
|
||||
close(FH);
|
||||
}
|
||||
|
||||
open(FH, "|gnuplot > /dev/null");# feed it to gnuplot
|
||||
open(FH, "|gnuplot >> $errfile 2>&1");# feed it to gnuplot
|
||||
print FH $gplot_script, $xrange, $plot;
|
||||
close(FH);
|
||||
foreach my $p (@path) {
|
||||
|
25
fhem/webfrontend/pgm2/cul_em.gplot
Normal file
25
fhem/webfrontend/pgm2/cul_em.gplot
Normal file
@ -0,0 +1,25 @@
|
||||
############################
|
||||
# Display the power reported by the EM1010
|
||||
# Corresponding FileLog definition:
|
||||
# define ememlog FileLog /var/log/fhem/emem-%Y.log emem:power.*
|
||||
|
||||
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 title '<TL>'
|
||||
set ylabel "Power (KW)"
|
||||
set y2label "Power (KW)"
|
||||
set grid
|
||||
set ytics
|
||||
set y2tics
|
||||
set format y "%.1f"
|
||||
set format y2 "%.1f"
|
||||
|
||||
#FileLog 8:emem:0:
|
||||
#FileLog 8:emwz:0:
|
||||
|
||||
plot "<grep emem <IN>" using 1:8 title 'EMEM' with lines,\
|
||||
"<grep emwz <IN>" using 1:8 title 'EMWZ' with lines
|
27
fhem/webfrontend/pgm2/cul_ws.gplot
Normal file
27
fhem/webfrontend/pgm2/cul_ws.gplot
Normal file
@ -0,0 +1,27 @@
|
||||
############################
|
||||
# Display the s300th data reported by the CUL
|
||||
# Corresponding FileLog definition:
|
||||
# define ememlog FileLog /var/log/fhem/s300th-%Y.log s300th.*
|
||||
|
||||
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 title '<TL>'
|
||||
set ylabel "Temp (C)"
|
||||
set y2label "Temp (C)"
|
||||
set grid
|
||||
set ytics
|
||||
set y2tics
|
||||
set format y "%.1f"
|
||||
set format y2 "%.1f"
|
||||
|
||||
#FileLog 4:s300th1:0:
|
||||
#FileLog 4:s300th3:0:
|
||||
#FileLog 4:s300th5:0:
|
||||
|
||||
plot "<grep s300th1 <IN>" using 1:8 title '1' with lines,\
|
||||
"<grep s300th3 <IN>" using 1:8 title '3' with lines,\
|
||||
"<grep s300th5 <IN>" using 1:8 title '5' with lines
|
Loading…
x
Reference in New Issue
Block a user