no message
This commit is contained in:
@@ -40,6 +40,7 @@ class Ladestation_Universal extends IPSModule
|
||||
$this->RegisterVariableInteger("Power", "Power");
|
||||
$this->RegisterVariableBoolean("Is_Peak_Shaving", "Is_Peak_Shaving");
|
||||
$this->RegisterVariableInteger("Leistung_Delta", "Leistung_Delta", "", 0);
|
||||
$this->RegisterVariableInteger("Power_Count", "Power_Count", "", 0);
|
||||
|
||||
// Hilfsvariabeln für Idle zustand
|
||||
$this->RegisterPropertyInteger("IdleCounterMax", 2);
|
||||
@@ -180,6 +181,8 @@ class Ladestation_Universal extends IPSModule
|
||||
$maxLeistung = $this->ReadPropertyInteger("MaxLeistung");
|
||||
}
|
||||
|
||||
|
||||
|
||||
$ch = curl_init();
|
||||
|
||||
// Setze die URL
|
||||
@@ -236,8 +239,6 @@ class Ladestation_Universal extends IPSModule
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// Überprüfe, ob die Antwort nicht leer ist
|
||||
if ($response) {
|
||||
// Dekodiere die JSON-Antwort
|
||||
@@ -307,16 +308,9 @@ class Ladestation_Universal extends IPSModule
|
||||
}
|
||||
}
|
||||
if($this->ReadPropertyInteger("Ladestation")==4){
|
||||
// Überprüfe, ob das JSON-Dekodieren erfolgreich war und der Schlüssel "car" existiert
|
||||
|
||||
/* SetValue(
|
||||
$this->GetIDForIdent("Ladeleistung_Effektiv"),
|
||||
$this->GetValue("Ladeleistung")
|
||||
); */
|
||||
|
||||
|
||||
|
||||
|
||||
// Nichts zu tun hier...
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -326,6 +320,23 @@ class Ladestation_Universal extends IPSModule
|
||||
// Peak-Wert speichern
|
||||
$this->SetValue("Peak", $Peak);
|
||||
|
||||
|
||||
if($this->GetValue("Aktuelle_Leistung")<(0.8*$this->GetValue("Power")) && $this->GetValue("Power")>0){
|
||||
|
||||
$this->SetValue("Power_Count", $this->GetValue("Power_Count")+1);
|
||||
|
||||
}elseif($this->GetValue("Power_Count")<=4) {
|
||||
|
||||
$this->SetValue("Power_Count", 0);
|
||||
|
||||
}
|
||||
|
||||
|
||||
if($this->GetValue("Power_Count"))>4{
|
||||
$maxLeistung = 1.05 * $this->GetValue("Aktuelle_Leistung");
|
||||
}
|
||||
|
||||
|
||||
// Array für die Powersteps initialisieren
|
||||
$powerSteps = [0];
|
||||
|
||||
@@ -347,12 +358,17 @@ class Ladestation_Universal extends IPSModule
|
||||
} elseif ($solarladen && $Peak) {
|
||||
$powerSteps = [0];
|
||||
} else {
|
||||
|
||||
|
||||
$powerSteps += $this->getRangeLimits(
|
||||
$minLeistung,
|
||||
$maxLeistung,
|
||||
GetValue($this->GetIDForIdent("Lademodus"))
|
||||
);
|
||||
}
|
||||
}else{
|
||||
|
||||
$this->SetValue("Power_Count", 0);
|
||||
}
|
||||
// PowerSteps in der RegisterVariable speichern
|
||||
SetValue($this->GetIDForIdent("PowerSteps"), json_encode($powerSteps));
|
||||
|
||||
Reference in New Issue
Block a user