diff --git a/Ladestation_v2/module.php b/Ladestation_v2/module.php index faf7b34..f56d201 100644 --- a/Ladestation_v2/module.php +++ b/Ladestation_v2/module.php @@ -201,7 +201,7 @@ class Ladestation_v2 extends IPSModule public function Get_Car_Status(int $carType) { $ch = curl_init(); - + $car_on_station = false; switch ($carType) { case 1: curl_setopt($ch, CURLOPT_URL, "http://" . $this->ReadPropertyString("IP_Adresse") . "/mqtt?payload="); @@ -217,6 +217,12 @@ class Ladestation_v2 extends IPSModule else{ $this->SetValue("Car_detected", false); }*/ + if ($data["car"] != 1) { + $car_on_station = true; + } + else{ + $car_on_station = false; + } $this->SetValue("Ladeleistung_Effektiv", $data["nrg"][11]*10); $this->SetValue("Fahrzeugstatus", $data["car"]); } @@ -236,6 +242,12 @@ class Ladestation_v2 extends IPSModule else{ $this->SetValue("Car_detected", false); }*/ + if ($data["car"] != 1) { + $car_on_station = true; + } + else{ + $car_on_station = false; + } $this->SetValue("Ladeleistung_Effektiv", $data["nrg"][11]); $this->SetValue("Fahrzeugstatus", $data["car"]); } @@ -257,6 +269,12 @@ class Ladestation_v2 extends IPSModule else{ $this->SetValue("Car_detected", false); }*/ + if ($data["car"] != 1) { + $car_on_station = true; + } + else{ + $car_on_station = false; + } $this->SetValue("Ladeleistung_Effektiv", round($data["ActiveChargingPower"]*1000)); $this->SetValue("Fahrzeugstatus", $data["State"]);