2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-03 23:06:37 +00:00

CUL_EM generates a trigger for each of the READINGS (wished by Markus)

git-svn-id: https://svn.fhem.de/fhem/trunk@396 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2009-06-22 17:34:59 +00:00
parent 2f4a8481bd
commit 750901be8b
2 changed files with 3 additions and 6 deletions

View File

@ -711,7 +711,7 @@ CUL_Read($)
my $fn = substr($dmsg,0,1); my $fn = substr($dmsg,0,1);
my $len = length($dmsg); my $len = length($dmsg);
if($fn eq "F") { # Reformat for 10_FS20.pm if($fn eq "F" && length($dmsg) >= 9) { # Reformat for 10_FS20.pm
if(defined($attr{$name}) && defined($attr{$name}{CUR_id_list})) { if(defined($attr{$name}) && defined($attr{$name}{CUR_id_list})) {
my $id= substr($dmsg,1,4); my $id= substr($dmsg,1,4);
@ -745,7 +745,7 @@ CUL_Read($)
} elsif($fn eq "E") { # CUL_EM / Native } elsif($fn eq "E") { # CUL_EM / Native
; ;
} else { } else {
Log GetLogLevel($name,4), "CUL: unknown message $dmsg"; Log GetLogLevel($name,2), "CUL: unknown message $dmsg";
goto NEXTMSG; goto NEXTMSG;
} }
$hash->{RSSI} = $rssi; $hash->{RSSI} = $rssi;

View File

@ -73,7 +73,6 @@ CUL_EM_Undef($$)
return undef; return undef;
} }
##################################### #####################################
sub sub
CUL_EM_Parse($$) CUL_EM_Parse($$)
@ -142,7 +141,6 @@ CUL_EM_Parse($$)
if($total_cnt< $total_cnt_last) { if($total_cnt< $total_cnt_last) {
$basis_cnt += 65536; $basis_cnt += 65536;
$readings{basis} = $basis_cnt; $readings{basis} = $basis_cnt;
$hash->{CHANGED}[$c++] = "basis: $basis_cnt";
} }
# #
@ -196,7 +194,6 @@ CUL_EM_Parse($$)
my @cmv = split(" ", $hash->{READINGS}{cum_day}{VAL}); my @cmv = split(" ", $hash->{READINGS}{cum_day}{VAL});
$val = sprintf("CUM_DAY: %0.3f CUM: %0.3f COST: %0.2f", $total-$cmv[3], $total, ($total-$cmv[3])*$cost); $val = sprintf("CUM_DAY: %0.3f CUM: %0.3f COST: %0.2f", $total-$cmv[3], $total, ($total-$cmv[3])*$cost);
$readings{cum_day} = $val; $readings{cum_day} = $val;
$hash->{CHANGED}[$c++] = "$val";
Log GetLogLevel($n,3), "CUL_EM $n: $val"; Log GetLogLevel($n,3), "CUL_EM $n: $val";
# #
if( (localtime($tsecs_prev))[4] != (localtime($tsecs))[4] ) { if( (localtime($tsecs_prev))[4] != (localtime($tsecs))[4] ) {
@ -209,7 +206,6 @@ CUL_EM_Parse($$)
@cmv = split(" ", $hash->{READINGS}{cum_month}{VAL}); @cmv = split(" ", $hash->{READINGS}{cum_month}{VAL});
$val = sprintf("CUM_MONTH: %0.3f CUM: %0.3f COST: %0.2f", $total-$cmv[3],$total,($total-$cmv[3])*$cost+$basicfee); $val = sprintf("CUM_MONTH: %0.3f CUM: %0.3f COST: %0.2f", $total-$cmv[3],$total,($total-$cmv[3])*$cost+$basicfee);
$readings{cum_month} = $val; $readings{cum_month} = $val;
$hash->{CHANGED}[$c++] = "$val";
Log GetLogLevel($n,3), "CUL_EM $n: $val"; Log GetLogLevel($n,3), "CUL_EM $n: $val";
} }
} }
@ -222,6 +218,7 @@ CUL_EM_Parse($$)
foreach my $k (keys %readings) { foreach my $k (keys %readings) {
$hash->{READINGS}{$k}{TIME}= $tn; $hash->{READINGS}{$k}{TIME}= $tn;
$hash->{READINGS}{$k}{VAL} = $readings{$k}; $hash->{READINGS}{$k}{VAL} = $readings{$k};
$hash->{CHANGED}[$c++] = "$k: $readings{$k}";
} }
return $hash->{NAME}; return $hash->{NAME};