no message

This commit is contained in:
2025-03-21 14:24:02 +01:00
parent 709631798d
commit 52dea68b8e
2 changed files with 29 additions and 13 deletions

View File

@@ -247,7 +247,7 @@ class HauptManager extends IPSModule
$allSteps[] = [
"user" => $user["InstanceID"],
"Writeback" => $user["Writeback"],
"step" => $step,
"step" => $step
//"Leistung_Delta" => $user["Leistung_Delta"]
];
}
@@ -394,7 +394,7 @@ class HauptManager extends IPSModule
IPS_LogMessage("Manager", $userInstanceID);
IPS_LogMessage("Manager", $minimalleitsung);
IPS_LogMessage("Manager", $remainingPower);
IPS_LogMessage("Manager", $leistung);
IPS_LogMessage("Manager", print_r($leistung));
// Jedem user den höheren der beiden werte aus minimalwert oder vergebenem zuteilen
$leistung = max($leistung, $minimalleitsung)*-1;

View File

@@ -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,15 +308,8 @@ 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));