mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-04-21 07:56:03 +00:00
24_TPLinkHS110.pm: Hotfix for incorrect daily/monthly total in sw ver >= 2
git-svn-id: https://svn.fhem.de/fhem/trunk@19095 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
dbd091be33
commit
126a59a8b6
@ -228,7 +228,7 @@ sub TPLinkHS110_Get($$)
|
||||
} else {
|
||||
$total = $total+ $key2->{'energy_wh'};
|
||||
if ($key2->{'day'} == $mday) {
|
||||
readingsBulkUpdate($hash, "daily_total", sprintf("%.3f", $key2->{'energy_wh'}));
|
||||
readingsBulkUpdate($hash, "daily_total", sprintf("%.3f", $key2->{'energy_wh'}*0.001));
|
||||
}
|
||||
}
|
||||
|
||||
@ -236,7 +236,8 @@ sub TPLinkHS110_Get($$)
|
||||
}
|
||||
my $count=1;
|
||||
$count = @{$json->{'emeter'}->{'get_daystat'}->{'day_list'}};
|
||||
readingsBulkUpdate($hash, "monthly_total", $total);
|
||||
if ($hw_ver eq "1.0") {readingsBulkUpdate($hash, "monthly_total", $total);}
|
||||
if ($hw_ver eq "2.0") {readingsBulkUpdate($hash, "monthly_total", $total*0.001);}
|
||||
if ($count) { readingsBulkUpdate($hash, "daily_average", $total/$count)};
|
||||
Log3 $hash, 2, "TPLinkHS110: $name Daystat updated";
|
||||
} else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user