no message

This commit is contained in:
belevo\mh
2026-04-17 13:08:42 +02:00
parent 2bbca149c4
commit 2939722a59
+2 -35
View File
@@ -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;