From 2939722a5987948311084b8628867348b8ddb23d Mon Sep 17 00:00:00 2001 From: "belevo\\mh" Date: Fri, 17 Apr 2026 13:08:42 +0200 Subject: [PATCH] no message --- Bat_EV_SDL _V2/module.php | 37 ++----------------------------------- 1 file changed, 2 insertions(+), 35 deletions(-) diff --git a/Bat_EV_SDL _V2/module.php b/Bat_EV_SDL _V2/module.php index 754f37e..09bec22 100644 --- a/Bat_EV_SDL _V2/module.php +++ b/Bat_EV_SDL _V2/module.php @@ -665,44 +665,11 @@ private function CalculateBatteryDistribution(float $pEvW, float $pSdlW): array // ---------------------------- - - // --------------------------------------------------------- - // AKTUELLE_Leistung EV/SDL - // Ziel: - // - wenn beide aktiv: beide zeigen totalPower_ist (z.B. ~ -4000W) - // - wenn einer 0 ist: Umschaltbar -> auf "anderen" oder immer auf SDL - // --------------------------------------------------------- - $eps = 0.01; - // Wenn du willst, dass bei 0 immer SDL bekommt -> true setzen - $preferSDLWhenOneIsZero = true; - if (abs($pEvW) < $eps && abs($pSdlW) < $eps) { - $this->SetValue("Aktuelle_Leistung_EV", 0.0); - $this->SetValue("Aktuelle_Leistung_SDL", 0.0); + $this->SetValue("Aktuelle_Leistung_SDL", $pSdlW); + $this->SetValue("Aktuelle_Leistung_EV", $totalPower_ist + $pSdlW); - } elseif (abs($pEvW) < $eps || abs($pSdlW) < $eps) { - // Einer ist 0 - if ($preferSDLWhenOneIsZero) { - // immer SDL bekommt totalPower_ist - $this->SetValue("Aktuelle_Leistung_EV", 0.0); - $this->SetValue("Aktuelle_Leistung_SDL", $totalPower_ist); - } else { - // "klassisch": der nicht-0 Kanal bekommt totalPower_ist - if (abs($pEvW) < $eps) { - $this->SetValue("Aktuelle_Leistung_EV", 0.0); - $this->SetValue("Aktuelle_Leistung_SDL", $totalPower_ist); - } else { - $this->SetValue("Aktuelle_Leistung_EV", $totalPower_ist); - $this->SetValue("Aktuelle_Leistung_SDL", 0.0); - } - } - - } else { - // Beide aktiv -> beide sollen ca. totalPower_ist anzeigen (dein Wunsch) - $this->SetValue("Aktuelle_Leistung_EV", $totalPower_ist); - $this->SetValue("Aktuelle_Leistung_SDL", $totalPower_ist); - } return $finalOutput;