From 875c40e1799a258e687b3ab37c7dac6b222dc5ec Mon Sep 17 00:00:00 2001 From: DanielHaefliger Date: Thu, 5 Feb 2026 17:09:20 +0100 Subject: [PATCH] no message --- Bat_EV_SDL _V2/module.php | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/Bat_EV_SDL _V2/module.php b/Bat_EV_SDL _V2/module.php index 054c109..1035356 100644 --- a/Bat_EV_SDL _V2/module.php +++ b/Bat_EV_SDL _V2/module.php @@ -615,14 +615,22 @@ private function CalculateBatteryDistribution(float $pEvW, float $pSdlW): array } $totalPower_ist = 0; - + print_r($batteries); foreach ($batteries as $bat) { - $totalPower_ist += GetValue($bat['register_bat_power']); + $totalPower_ist += 0; // GetValue($bat['register_bat_power']); } - + + if(($pEvW + $pSdlW) === 0){ + + $this->SetValue("Aktuelle_Leistung_EV", $totalPower_ist/2); + $this->SetValue("Aktuelle_Leistung_SDL", $totalPower_ist/2); + + }else{ + $this->SetValue("Aktuelle_Leistung_EV", $totalPower_ist/($pEvW + $pSdlW)*$pEvW); $this->SetValue("Aktuelle_Leistung_SDL", $totalPower_ist/($pEvW + $pSdlW)*$pSdlW); + } return $finalOutput; }