2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-01-31 12:49:34 +00:00

Die changed to return, Power Limit decreased to 30kWh

git-svn-id: https://svn.fhem.de/fhem/trunk@72 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2007-06-09 06:40:44 +00:00
parent 83ff2cc59c
commit 3d296ad858
3 changed files with 8 additions and 4 deletions

View File

@ -53,7 +53,7 @@ EM_Define($$)
Log 3, "EM opening device $dev";
my $po = new Device::SerialPort ($dev);
return "Can't open $dev: $!\n" if(!$po);
return "Can't open $dev: $!" if(!$po);
Log 3, "EM opened device $dev";
$po->close();
@ -229,7 +229,10 @@ EmGetData($$)
$d = EmMakeMsg(pack('H*', $d));
my $serport = new Device::SerialPort ($dev);
die "Can't open $dev: $!\n" if(!$serport);
if(!$serport) {
Log 1, "EM: Can't open $dev: $!";
return undef;
}
$serport->reset_error();
$serport->baudrate(38400);
$serport->databits(8);
@ -282,6 +285,7 @@ EmGetData($$)
if(b($retval,1) != 0) { $rm = "EM Bad second byte"; goto DONE; }
if(w($retval,2) != $l-7) { $rm = "EM Length mismatch"; goto DONE; }
if(!EmCrcCheck($retval,$l-7)) { $rm = "EM Bad CRC"; goto DONE; }
$serport->close();
return substr($retval, 4, $l-7);
}
}

View File

@ -61,7 +61,7 @@ EMWZ_GetStatus($)
my $cur_energy = $pulses / $ec; # ec = U/kWh
my $cur_power = $cur_energy / 5 * 60; # 5minute interval scaled to 1h
if($cur_power > 100) {
if($cur_power > 30) { # 20Amp x 3 Phase
my $msg = "EMWZ Bogus reading: curr. power is reported to be $cur_power";
Log GetLogLevel($name,2), $msg;
return $msg;

View File

@ -52,7 +52,7 @@ EMEM_GetStatus($)
my $iec = 1000;
my $cur_power = $pulses / 100;
if($cur_power > 100) {
if($cur_power > 30) { # 20Amp x 3 Phase
my $msg = "EMEM Bogus reading: curr. power is reported to be $cur_power";
Log GetLogLevel($name,2), $msg;
return $msg;