diff --git a/Batterie_Deye/module.php b/Batterie_Deye/module.php index 0258c71..8ac5700 100644 --- a/Batterie_Deye/module.php +++ b/Batterie_Deye/module.php @@ -132,18 +132,18 @@ public function RequestAction($Ident, $Value) } } - public function SetAktuelle_Leistung(int $y) + public function SetAktuelle_Leistung(int $power) { - $power = (-1)*$y; + $y = (-1)*$power; - if ($power < 0) { + if ($y < 0) { // Laden $uVarID = $this->ReadPropertyInteger("Batteriespannung"); if ($uVarID > 0 && IPS_VariableExists($uVarID)) { $U = GetValue($uVarID); if ($U > 0) { - $lade_strom = abs($power) / $U; + $lade_strom = abs($y) / $U; } else { $lade_strom = 0; } @@ -155,14 +155,14 @@ public function RequestAction($Ident, $Value) $this->SetValue("Entladestrom", 0); $this->SetValue("Batteriespannung_laden_entladen", 56); - } elseif ($power > 0) { + } elseif ($y > 0) { // Entladen $uVarID = $this->ReadPropertyInteger("Batteriespannung"); if ($uVarID > 0 && IPS_VariableExists($uVarID)) { $U = GetValue($uVarID); if ($U > 0) { - $entlade_strom = $power / $U; + $entlade_strom = $y / $U; } else { $entlade_strom = 0; }