diff --git a/Ladestation_v2/module.php b/Ladestation_v2/module.php index 1225eb2..5095475 100644 --- a/Ladestation_v2/module.php +++ b/Ladestation_v2/module.php @@ -97,10 +97,14 @@ class Ladestation_v2 extends IPSModule public function Detect_Car(int $carType) { - + $full = false; if($this->GetValue("Car_Detected")){ if($this->Get_Car_Status($carType)==true){ $this->SetValue("Car_Detected", true); + if($this->GetValue("Max_Current")<6){ + $full = true; + } + }else{ $this->SetValue("Car_Detected", false); } @@ -141,6 +145,8 @@ class Ladestation_v2 extends IPSModule $this->SetValue("Car_Detected", false); } } + + $this-SetValue("Car_is_full", $full); return $this->GetValue("Car_Detected"); } @@ -344,8 +350,7 @@ class Ladestation_v2 extends IPSModule // Rückgabe der Powersteps $counter = $this->GetValue("Pending_Counter"); - if(max($powerSteps)==$this->GetValue("Aktuelle_Leistung")){ - if(max($powerSteps)>(1.11*$this->GetValue("Ladeleistung_Effektiv"))){ + if($this->GetValue("Aktuelle_Leistung")>(1.11*$this->GetValue("Ladeleistung_Effektiv"))){ $this->SetValue("Pending_Counter", $counter+1); } @@ -360,10 +365,8 @@ class Ladestation_v2 extends IPSModule $this->SetValue("Pending_Counter", 0); $this->Calc_Max_Current($this->GetValue("Is_1_ph")); } - } - else{ - $this->SetValue("Pending_Counter", 0); - } + + return $powerSteps;