mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-04-08 07:24:21 +00:00
77_SMAEM: contrib 3.5.0
git-svn-id: https://svn.fhem.de/fhem/trunk@20741 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
6971dec1e8
commit
9b2c9a2fcb
@ -362,11 +362,8 @@ sub SMAEM_DoParse ($) {
|
|||||||
my $data = decode_base64($dataenc);
|
my $data = decode_base64($dataenc);
|
||||||
my $discycles = $hash->{HELPER}{FAULTEDCYCLES};
|
my $discycles = $hash->{HELPER}{FAULTEDCYCLES};
|
||||||
my $diffaccept = AttrVal($name, "diffAccept", 10);
|
my $diffaccept = AttrVal($name, "diffAccept", 10);
|
||||||
# my $fw = $hash->{FIRMWARE};
|
|
||||||
my ($error,@row_array,@array);
|
my ($error,@row_array,@array);
|
||||||
|
|
||||||
Log3 ($name, 4, "SMAEM $name -> Start BlockingCall SMAEM_DoParse");
|
|
||||||
|
|
||||||
my $gridinsum = $hash->{'GRIDIN_SUM_'.$smaserial} ?sprintf("%.4f",$hash->{'GRIDIN_SUM_'.$smaserial}):'';
|
my $gridinsum = $hash->{'GRIDIN_SUM_'.$smaserial} ?sprintf("%.4f",$hash->{'GRIDIN_SUM_'.$smaserial}):'';
|
||||||
my $gridoutsum = $hash->{'GRIDOUT_SUM_'.$smaserial}?sprintf("%.4f",$hash->{'GRIDOUT_SUM_'.$smaserial}):'';
|
my $gridoutsum = $hash->{'GRIDOUT_SUM_'.$smaserial}?sprintf("%.4f",$hash->{'GRIDOUT_SUM_'.$smaserial}):'';
|
||||||
|
|
||||||
@ -375,7 +372,6 @@ sub SMAEM_DoParse ($) {
|
|||||||
my $retcode = SMAEM_getsum($hash,$smaserial);
|
my $retcode = SMAEM_getsum($hash,$smaserial);
|
||||||
if ($retcode) {
|
if ($retcode) {
|
||||||
$error = encode_base64($retcode,"");
|
$error = encode_base64($retcode,"");
|
||||||
Log3 ($name, 4, "SMAEM $name -> BlockingCall SMAEM_DoParse finished");
|
|
||||||
$discycles++;
|
$discycles++;
|
||||||
return "$name|''|''|''|$error|$discycles|''";
|
return "$name|''|''|''|$error|$discycles|''";
|
||||||
} else {
|
} else {
|
||||||
@ -474,7 +470,6 @@ sub SMAEM_DoParse ($) {
|
|||||||
"Try to set attribute \"diffAccept > $d\" temporary or execute \"reset\".";
|
"Try to set attribute \"diffAccept > $d\" temporary or execute \"reset\".";
|
||||||
$error = encode_base64($errtxt,"");
|
$error = encode_base64($errtxt,"");
|
||||||
Log3 ($name, 1, "SMAEM $name - $errtxt");
|
Log3 ($name, 1, "SMAEM $name - $errtxt");
|
||||||
Log3 ($name, 4, "SMAEM $name -> BlockingCall SMAEM_DoParse finished");
|
|
||||||
$gridinsum = $einspeisung_wirk_count;
|
$gridinsum = $einspeisung_wirk_count;
|
||||||
$gridoutsum = $bezug_wirk_count;
|
$gridoutsum = $bezug_wirk_count;
|
||||||
$discycles++;
|
$discycles++;
|
||||||
@ -506,7 +501,6 @@ sub SMAEM_DoParse ($) {
|
|||||||
"Try to set attribute \"diffAccept > $d\" temporary or execute \"reset\".";
|
"Try to set attribute \"diffAccept > $d\" temporary or execute \"reset\".";
|
||||||
$error = encode_base64($errtxt,"");
|
$error = encode_base64($errtxt,"");
|
||||||
Log3 ($name, 1, "SMAEM $name - $errtxt");
|
Log3 ($name, 1, "SMAEM $name - $errtxt");
|
||||||
Log3 ($name, 4, "SMAEM $name -> BlockingCall SMAEM_DoParse finished");
|
|
||||||
$gridinsum = $einspeisung_wirk_count;
|
$gridinsum = $einspeisung_wirk_count;
|
||||||
$gridoutsum = $bezug_wirk_count;
|
$gridoutsum = $bezug_wirk_count;
|
||||||
$discycles++;
|
$discycles++;
|
||||||
@ -522,7 +516,6 @@ sub SMAEM_DoParse ($) {
|
|||||||
# error while writing values to file
|
# error while writing values to file
|
||||||
if ($retcode) {
|
if ($retcode) {
|
||||||
$error = encode_base64($retcode,"");
|
$error = encode_base64($retcode,"");
|
||||||
Log3 ($name, 4, "SMAEM $name -> BlockingCall SMAEM_DoParse finished");
|
|
||||||
$discycles++;
|
$discycles++;
|
||||||
return "$name|''|''|''|$error|$discycles|''";
|
return "$name|''|''|''|$error|$discycles|''";
|
||||||
}
|
}
|
||||||
@ -672,18 +665,10 @@ sub SMAEM_DoParse ($) {
|
|||||||
push(@row_array, $ps."L3_Spannung ".sprintf("%.1f",$l3_v)."\n");
|
push(@row_array, $ps."L3_Spannung ".sprintf("%.1f",$l3_v)."\n");
|
||||||
push(@row_array, $ps."L3_CosPhi ".sprintf("%.3f",$l3_cosphi)."\n");
|
push(@row_array, $ps."L3_CosPhi ".sprintf("%.3f",$l3_cosphi)."\n");
|
||||||
|
|
||||||
Log3 ($name, 5, "$name - row_array before encoding:");
|
|
||||||
foreach my $row (@row_array) {
|
|
||||||
chomp $row;
|
|
||||||
Log3 ($name, 5, "SMAEM $name - $row");
|
|
||||||
}
|
|
||||||
|
|
||||||
# encoding result
|
# encoding result
|
||||||
my $rowlist = join('_ESC_', @row_array);
|
my $rowlist = join('_ESC_', @row_array);
|
||||||
$rowlist = encode_base64($rowlist,"");
|
$rowlist = encode_base64($rowlist,"");
|
||||||
|
|
||||||
Log3 ($name, 4, "SMAEM $name -> BlockingCall SMAEM_DoParse finished");
|
|
||||||
|
|
||||||
return "$name|$rowlist|$gridinsum|$gridoutsum|''|$discycles|$smaserial";
|
return "$name|$rowlist|$gridinsum|$gridoutsum|''|$discycles|$smaserial";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -702,8 +687,6 @@ sub SMAEM_ParseDone ($) {
|
|||||||
my $discycles = $a[5];
|
my $discycles = $a[5];
|
||||||
my $smaserial = $a[6];
|
my $smaserial = $a[6];
|
||||||
|
|
||||||
Log3 ($name, 4, "SMAEM $name -> Start BlockingCall SMAEM_ParseDone");
|
|
||||||
|
|
||||||
$hash->{HELPER}{FAULTEDCYCLES} = $discycles;
|
$hash->{HELPER}{FAULTEDCYCLES} = $discycles;
|
||||||
|
|
||||||
# update time
|
# update time
|
||||||
@ -711,7 +694,6 @@ sub SMAEM_ParseDone ($) {
|
|||||||
|
|
||||||
if ($error) {
|
if ($error) {
|
||||||
readingsSingleUpdate($hash, "state", $error, 1);
|
readingsSingleUpdate($hash, "state", $error, 1);
|
||||||
Log3 ($name, 4, "SMAEM $name -> BlockingCall SMAEM_ParseDone finished");
|
|
||||||
delete($hash->{HELPER}{RUNNING_PID});
|
delete($hash->{HELPER}{RUNNING_PID});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -737,7 +719,6 @@ sub SMAEM_ParseDone ($) {
|
|||||||
readingsEndUpdate($hash, 1);
|
readingsEndUpdate($hash, 1);
|
||||||
|
|
||||||
delete($hash->{HELPER}{RUNNING_PID});
|
delete($hash->{HELPER}{RUNNING_PID});
|
||||||
Log3 ($name, 4, "SMAEM $name -> BlockingCall SMAEM_ParseDone finished");
|
|
||||||
CancelDelayedShutdown($name);
|
CancelDelayedShutdown($name);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user