diff --git a/Bat_EV_SDL _V2/module.php b/Bat_EV_SDL _V2/module.php index e43b49b..f84030c 100644 --- a/Bat_EV_SDL _V2/module.php +++ b/Bat_EV_SDL _V2/module.php @@ -625,15 +625,18 @@ private function CalculateBatteryDistribution(float $pEvW, float $pSdlW): array } - if(($pEvW + $pSdlW) === 0){ + $sumReq = (float)($pEvW + $pSdlW); - $this->SetValue("Aktuelle_Leistung_EV", $totalPower_ist/2); - $this->SetValue("Aktuelle_Leistung_SDL", $totalPower_ist/2); + if (!is_finite($sumReq) || abs($sumReq) < 0.01) { - }else{ + $this->SetValue("Aktuelle_Leistung_EV", $totalPower_ist / 2); + $this->SetValue("Aktuelle_Leistung_SDL", $totalPower_ist / 2); - $this->SetValue("Aktuelle_Leistung_EV", $totalPower_ist/($pEvW + $pSdlW)*$pEvW); - $this->SetValue("Aktuelle_Leistung_SDL", $totalPower_ist/($pEvW + $pSdlW)*$pSdlW); + } else { + + $this->SetValue("Aktuelle_Leistung_EV",($totalPower_ist / $sumReq) * $pEvW); + + $this->SetValue("Aktuelle_Leistung_SDL",($totalPower_ist / $sumReq) * $pSdlW); } return $finalOutput; diff --git a/Batterie/module.php b/Batterie/module.php index 20adb84..3a061f2 100644 --- a/Batterie/module.php +++ b/Batterie/module.php @@ -191,10 +191,6 @@ private function GeneratePowerSteps($additionalValue) $array_powersteps = array_values(array_unique($array_powersteps)); sort($array_powersteps, SORT_NUMERIC); - IPS_LogMessage("Batterie", "RAW Max=" . $maxleistung_raw . " RAW Nach=" . $nachladen_raw . " additional=" . $additionalValue); - - IPS_LogMessage("Batterie", "Rounded Max=" . $maxleistung . " Min=" . $minleistung); - return $array_powersteps; } // Ende Array Steps