From 126a59a8b60185cd603389946cc3d1040128f1cf Mon Sep 17 00:00:00 2001 From: vk <> Date: Tue, 2 Apr 2019 13:02:04 +0000 Subject: [PATCH] 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 --- fhem/FHEM/24_TPLinkHS110.pm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fhem/FHEM/24_TPLinkHS110.pm b/fhem/FHEM/24_TPLinkHS110.pm index c36ac82ef..71e5f8377 100644 --- a/fhem/FHEM/24_TPLinkHS110.pm +++ b/fhem/FHEM/24_TPLinkHS110.pm @@ -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 {