diff --git a/Ladestation_Universal/module.php b/Ladestation_Universal/module.php index 4a9235e..2e5c17a 100644 --- a/Ladestation_Universal/module.php +++ b/Ladestation_Universal/module.php @@ -98,13 +98,32 @@ public function SetCurrentPower(int $power) { elseif (!$peak && !$solarladen) { // Wenn weder Peak noch Solarladen aktiv sind, setze Ladeleistung auf MaxLeistung SetValue($this->GetIDForIdent("Ladeleistung"), $this->ReadPropertyInteger("MaxLeistung")); - SetValue($this->GetIDForIdent("Ladestrom"), $this->ReadPropertyInteger("MaxLeistung") / 400 / sqrt(3)); + + if(GetValue($this->GetIDForIdent("Lademodus"))==0){ + + SetValue($this->GetIDForIdent("Ladestrom"), $this->ReadPropertyInteger("MaxLeistung") / 240); + + }elseif(GetValue($this->GetIDForIdent("Lademodus"))==1){ + + SetValue($this->GetIDForIdent("Ladestrom"), $this->ReadPropertyInteger("MaxLeistung") / 400 / sqrt(3)); + + } $this->sendPowerToStation($this->ReadPropertyInteger("MaxLeistung")); } else { // Ansonsten setze Ladeleistung auf die aktuelle Leistungsvorgabe (CurrentPower) SetValue($this->GetIDForIdent("Ladeleistung"), $power); - SetValue($this->GetIDForIdent("Ladestrom"), $power / 400 / sqrt(3)); + + if(GetValue($this->GetIDForIdent("Lademodus"))==0){ + + SetValue($this->GetIDForIdent("Ladestrom"), $power / 240); + + }elseif(GetValue($this->GetIDForIdent("Lademodus"))==1){ + + SetValue($this->GetIDForIdent("Ladestrom"), $power / 400 / sqrt(3)); + + } + $this->sendPowerToStation($power); } }