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

76_SMAPortal: contrib 2.3.6

git-svn-id: https://svn.fhem.de/fhem/trunk@19672 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
nasseeder1 2019-06-20 19:18:53 +00:00
parent ac8d7a18cf
commit 7a94132003

View File

@ -1536,7 +1536,8 @@ return;
################################################################
sub extractConsumerHistData($$$) {
my ($hash,$chdata,$tf) = @_;
my $name = $hash->{NAME};
my $name = $hash->{NAME};
my ($bdcd,$bcd);
my %consumers;
my ($key,$val,$i,$res,$gcr,$gct,$pcr,$pct,$tct,$bcr,$bct);
@ -1549,13 +1550,15 @@ sub extractConsumerHistData($$$) {
my $bataval = (defined(ReadingsNum($name,"L1_BatteryIn", undef)) || defined(ReadingsNum($name,"L1_BatteryOut", undef)))?1:0; # Identifikation ist Battery vorhanden ?
my ($bdcd,$bcd) = (0,0);
foreach my $di (@{$chdata->{'BatteryDischarging'}}) {
$bdcd += $di->{'Measurement'}/4; # aufsummierte Batterieentladung pro Zeiteinheit (day) in Wh
}
foreach my $ch (@{$chdata->{'BatteryCharging'}}) {
$bcd += $ch->{'Measurement'}/4; # aufsummierte Batterieladung pro Zeiteinheit (day) in Wh
if($tf =~ /day/) {
($bdcd,$bcd) = (0,0);
foreach my $di (@{$chdata->{'BatteryDischarging'}}) {
$bdcd += $di->{'Measurement'}/4; # aufsummierte Batterieentladung pro Zeiteinheit (day) in Wh
}
foreach my $ch (@{$chdata->{'BatteryCharging'}}) {
$bcd += $ch->{'Measurement'}/4; # aufsummierte Batterieladung pro Zeiteinheit (day) in Wh
}
}
readingsBeginUpdate($hash);