From 957cc1fe3552d2588944b4a1097653259d885ba7 Mon Sep 17 00:00:00 2001 From: MadMax <> Date: Sun, 9 Oct 2022 10:30:18 +0000 Subject: [PATCH] 76_SMAInverter.pm:fix new ETOTAL/LOADTOTAL bug git-svn-id: https://svn.fhem.de/fhem/trunk@26514 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/76_SMAInverter.pm | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/fhem/FHEM/76_SMAInverter.pm b/fhem/FHEM/76_SMAInverter.pm index 543e1eab8..8ed9bb9a7 100644 --- a/fhem/FHEM/76_SMAInverter.pm +++ b/fhem/FHEM/76_SMAInverter.pm @@ -32,6 +32,7 @@ eval "use FHEM::Meta;1" or my $modMetaAbsent = 1; # Versions History by DS_Starter our %SMAInverter_vNotesIntern = ( + "2.18.2" => "09.10.2022 fix new ETOTAL/LOADTOTAL bug", "2.18.1" => "03.10.2022 new SE Inverters fix BAT-Data, fix ETODAY bug", "2.18.0" => "30.09.2022 new SE Inverters", "2.17.1" => "12.07.2021 fix ETOTAL/LOADTOTAL bug", @@ -1361,8 +1362,9 @@ sub SMAInverter_SMAcommand($$$$$) { $inv_SPOT_ETODAY = unpack("V*", substr ($data, 78, 4)); if(($inv_SPOT_ETODAY eq -2147483648) || ($inv_SPOT_ETODAY eq 0xFFFFFFFF) || $inv_SPOT_ETODAY <= 0) {$inv_SPOT_ETODAY = "-"; } - } - elsif($inv_SPOT_ETOTAL ne "-") { + } + + if($inv_SPOT_ETODAY eq "-" && $inv_SPOT_ETOTAL ne "-") { # ETODAY wurde vom WR nicht geliefert, es wird versucht ihn zu berechnen Log3 ($name, 3, "$name - ETODAY wasn't delivered from inverter, try to calculate it ..."); my $etotold = ReadingsNum($name, ".etotal_yesterday", 0); @@ -1401,7 +1403,8 @@ sub SMAInverter_SMAcommand($$$$$) { if(($inv_BAT_LOADTODAY eq -2147483648) || ($inv_BAT_LOADTODAY eq 0xFFFFFFFF) || $inv_BAT_LOADTODAY <= 0) {$inv_BAT_LOADTODAY = "-"; } } - elsif($inv_BAT_LOADTOTAL ne "-") { + + if($inv_BAT_LOADTODAY eq "-" && $inv_BAT_LOADTOTAL ne "-") { # BATTERYLOAD_TODAY wurde vom WR nicht geliefert, es wird versucht ihn zu berechnen Log3 $name, 3, "$name - BATTERYLOAD_TODAY wasn't delivered from inverter, try to calculate it ..."; my $bltotold = ReadingsNum($name, ".bat_loadtotal_yesterday", 0); @@ -2557,7 +2560,7 @@ Die Abfrage des Wechselrichters wird non-blocking ausgeführt. Der Timeoutwert f "PV", "inverter" ], - "version": "v2.18.1", + "version": "v2.18.2", "release_status": "stable", "author": [ "Maximilian Paries",