no message

This commit is contained in:
2025-04-08 06:57:53 +02:00
parent bb931667cf
commit e6c4146b5d
2 changed files with 38 additions and 36 deletions

View File

@@ -61,6 +61,40 @@ class Ladestation_v2 extends IPSModule
// Zusätzliche Anpassungen nach Bedarf
}
public function RequestAction($Ident, $Value)
{
switch ($Ident) {
case "SetAktuelle_Leistung":
$this->SetValue("Power", (int)$Value);
break;
case "GetCurrentData":
$this->SetValue("Is_Peak_Shaving", (bool)$Value);
break;
case "Do_UserCalc":
if($this->Detect_Car($this->ReadPropertyInteger("Ladestation"))){
$this->SetAktuelle_Leistung($this->GetValue("Power"));
$this->GetCurrentData($this->GetValue("Is_Peak_Shaving"));
}
else{
SetValue($this->GetIDForIdent("PowerSteps"), json_encode([0]));
$this->SetValue("PowerSteps", json_encode([0]));
}
break;
default:
throw new Exception("Invalid Ident");
}
}
public function Detect_Car(int $carType)
{
@@ -228,38 +262,6 @@ class Ladestation_v2 extends IPSModule
public function RequestAction($Ident, $Value)
{
switch ($Ident) {
case "SetAktuelle_Leistung":
$this->SetValue("Power", (int)$Value);
break;
case "GetCurrentData":
$this->SetValue("Is_Peak_Shaving", (bool)$Value);
break;
case "Do_UserCalc":
if($this->Detect_Car($this->ReadPropertyInteger("Ladestation"))){
$this->SetAktuelle_Leistung($this->GetValue("Power"));
$this->GetCurrentData($this->GetValue("Is_Peak_Shaving"));
}
else{
SetValue($this->GetIDForIdent("PowerSteps"), json_encode([0]));
$this->SetValue("PowerSteps", json_encode([0]));
}
break;
default:
throw new Exception("Invalid Ident");
}
}
public function SetAktuelle_Leistung(int $power)
{
@@ -299,11 +301,11 @@ class Ladestation_v2 extends IPSModule
} elseif (!$peak && !$solarladen) {
// Wenn weder Peak noch Solarladen aktiv sind, setze Ladeleistung auf MaxLeistung
$this->sendPowerToStation(Get_Current_From_Power($this->GetValue("Is_1_ph"), $this->GetValue("Max_Current")));
$this->sendPowerToStation($this->Get_Current_From_Power($this->GetValue("Is_1_ph"), $this->GetValue("Max_Current")));
} else {
// Ansonsten setze Ladeleistung auf die aktuelle Leistungsvorgabe (Aktuelle_Leistung)
$this->sendPowerToStation(Get_Current_From_Power($this->GetValue("Is_1_ph"), $power));
$this->sendPowerToStation($this->Get_Current_From_Power($this->GetValue("Is_1_ph"), $power));
}
}

View File

@@ -241,8 +241,8 @@ class Manager_v2 extends IPSModule
$allSteps[] = [
"user" => $user["InstanceID"],
"step" => $step
];
}
];}
}
else{
if($step<=0){
$allSteps[] = [