anpassungen

This commit is contained in:
2025-03-19 14:35:53 +01:00
parent 6b9c1ce968
commit e93f23bdf4
3 changed files with 26 additions and 6 deletions

View File

@@ -243,7 +243,7 @@ class Ladestation_Universal extends IPSModule
// Dekodiere die JSON-Antwort
$data = json_decode($response, true);
if($this->ReadPropertyInteger("Ladestation")==2||$this->ReadPropertyInteger("Ladestation")==1){
if($this->ReadPropertyInteger("Ladestation")==2){
// Überprüfe, ob das JSON-Dekodieren erfolgreich war und der Schlüssel "car" existiert
if (json_last_error() === JSON_ERROR_NONE && isset($data["car"])) {
// Speichere den Wert von "car" in der Variable $status
@@ -262,6 +262,26 @@ class Ladestation_Universal extends IPSModule
}
}
}
if($this->ReadPropertyInteger("Ladestation")==1){
// Überprüfe, ob das JSON-Dekodieren erfolgreich war und der Schlüssel "car" existiert
if (json_last_error() === JSON_ERROR_NONE && isset($data["car"])) {
// Speichere den Wert von "car" in der Variable $status
SetValue(
$this->GetIDForIdent("Ladeleistung_Effektiv"),
$data["nrg"][11]*10
);
SetValue($this->GetIDForIdent("Fahrzeugstatus"), $data["car"]);
if ($data["nrg"][6] > 1 && $data["car"] == 2) {
SetValue($this->GetIDForIdent("Lademodus"), 1);
} elseif ($data["nrg"][6] <= 1 && $data["car"] == 2) {
SetValue($this->GetIDForIdent("Lademodus"), 0);
}
}
}
if($this->ReadPropertyInteger("Ladestation")==3){
// Überprüfe, ob das JSON-Dekodieren erfolgreich war und der Schlüssel "car" existiert
if (json_last_error() === JSON_ERROR_NONE && isset($data["State"])) {