no message
This commit is contained in:
@@ -52,7 +52,7 @@
|
||||
{
|
||||
"type": "NumberSpinner",
|
||||
"name": "Zeit_Zwischen_Zustandswechseln",
|
||||
"caption": "Mindestlaufzeit des Verbrauchers bei Lastschaltung ",
|
||||
"caption": "(Veraltet, auf 0 lassen, wird in nächster Version entfehrnt) Mindestlaufzeit des Verbrauchers bei Lastschaltung ",
|
||||
"suffix": ""
|
||||
},
|
||||
{
|
||||
|
||||
@@ -102,6 +102,9 @@ class Ladestation_v2 extends IPSModule
|
||||
$this->RegisterTimer("Timer_Do_UserCalc_EVC",$this->ReadPropertyInteger("Interval")*1000,"IPS_RequestAction(" .$this->InstanceID .', "Do_UserCalc", "");');
|
||||
$this->RegisterTimer("Timer_Refresh_Token",0,"IPS_RequestAction(" .$this->InstanceID .', "Refresh_Token", "");');
|
||||
|
||||
$this->RegisterVariableInteger("Mindestaldestrom", "Mindestaldestrom", "", 0);
|
||||
$this->EnableAction("Mindestaldestrom");
|
||||
|
||||
}
|
||||
|
||||
public function ApplyChanges()
|
||||
@@ -175,6 +178,10 @@ class Ladestation_v2 extends IPSModule
|
||||
case "Refresh_Token":
|
||||
$this->Refresh_Token();
|
||||
break;
|
||||
|
||||
case "Mindestaldestrom":
|
||||
$this->SetValue("Mindestaldestrom", (int)$Value);
|
||||
break;
|
||||
|
||||
default:
|
||||
throw new Exception("Invalid Ident");
|
||||
@@ -229,6 +236,15 @@ class Ladestation_v2 extends IPSModule
|
||||
}
|
||||
|
||||
$this->SetValue("Car_detected", true);
|
||||
|
||||
if ($this->GetValue("Is_1_ph")) {
|
||||
$power = $this->GetValue("Mindestaldestrom") * 230;
|
||||
}
|
||||
else {
|
||||
$power = $this->GetValue("Mindestaldestrom") * 400 * 1.71;
|
||||
}
|
||||
|
||||
$this->SetValue("Power", $power);
|
||||
|
||||
|
||||
}
|
||||
@@ -515,9 +531,11 @@ class Ladestation_v2 extends IPSModule
|
||||
{
|
||||
$maxCurrent = 32;
|
||||
if($is_1_ph){
|
||||
|
||||
$maxCurrent = 2.5 + ($this->GetValue("Ladeleistung_Effektiv") / 230);
|
||||
}
|
||||
else{
|
||||
|
||||
$maxCurrent = 2.5 + ($this->GetValue("Ladeleistung_Effektiv") / (1.71*400));
|
||||
}
|
||||
if($maxCurrent>$this->ReadPropertyInteger("Max_Current_abs")){
|
||||
@@ -547,15 +565,10 @@ class Ladestation_v2 extends IPSModule
|
||||
// power == 0: nur eine 0 zurückgeben
|
||||
$resultArray[] = 0;
|
||||
return $resultArray;
|
||||
}
|
||||
// power > 0: keine 0 am Anfang, Schleife normal durchlaufen
|
||||
} else {
|
||||
// Timer aus: wie bisher, 0 am Anfang
|
||||
$resultArray[] = 0;
|
||||
}
|
||||
|
||||
}else{
|
||||
// Schleife wie gehabt
|
||||
for ($i = 6; $i <= $current; $i++) {
|
||||
for ($i = (max($this->GetValue("Mindestaldestrom") + 1, 6)); $i <= $current; $i++) {
|
||||
if ($is_1_ph) {
|
||||
$resultArray[] = $i * 230;
|
||||
} else {
|
||||
@@ -563,6 +576,29 @@ class Ladestation_v2 extends IPSModule
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// power > 0: keine 0 am Anfang, Schleife normal durchlaufen
|
||||
} else {
|
||||
// Timer aus: wie bisher, 0 am Anfang
|
||||
|
||||
if ($is_1_ph) {
|
||||
$resultArray[] = $this->GetValue("Mindestaldestrom") * 230;
|
||||
} else {
|
||||
$resultArray[] = $this->GetValue("Mindestaldestrom") * 400 * 1.71;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Schleife wie gehabt
|
||||
for ($i = (max($this->GetValue("Mindestaldestrom") + 1, 6)); $i <= $current; $i++) {
|
||||
if ($is_1_ph) {
|
||||
$resultArray[] = $i * 230;
|
||||
} else {
|
||||
$resultArray[] = $i * 400 * 1.71;
|
||||
}
|
||||
}
|
||||
}
|
||||
return $resultArray;
|
||||
}
|
||||
|
||||
@@ -669,7 +705,12 @@ class Ladestation_v2 extends IPSModule
|
||||
} elseif (!$Peak && $solarladen) {
|
||||
$powerSteps = $this->Get_Array_From_Current($this->GetValue("Is_1_ph"),$this->GetValue("Max_Current"), $this->GetValue("Aktuelle_Leistung"), $this->GetValue("IsTimerActive_Null_Timer"));
|
||||
} elseif ($solarladen && $Peak) {
|
||||
$powerSteps = [0];
|
||||
if ($is_1_ph) {
|
||||
$powerSteps = [$this->GetValue("Mindestaldestrom") * 230];
|
||||
} else {
|
||||
$powerSteps = [$this->GetValue("Mindestaldestrom") * 400 * 1.71];
|
||||
}
|
||||
|
||||
} else {
|
||||
$powerSteps = $this->Get_Array_From_Current($this->GetValue("Is_1_ph"),$this->GetValue("Max_Current"), $this->GetValue("Aktuelle_Leistung"), $this->GetValue("IsTimerActive_Null_Timer"));
|
||||
}
|
||||
@@ -695,7 +736,18 @@ class Ladestation_v2 extends IPSModule
|
||||
if($counter>(90/($this->ReadPropertyInteger("Interval")))){
|
||||
|
||||
$this->SetValue("Pending_Counter", 0);
|
||||
$this->Calc_Max_Current($this->GetValue("Is_1_ph"));
|
||||
|
||||
if((max(json_decode($this->GetValue("PowerSteps")))) >0){
|
||||
|
||||
if($this->GetValue("Aktuelle_Leistung")>(1.11*$this->GetValue("Ladeleistung_Effektiv"))) {
|
||||
|
||||
$this->Calc_Max_Current($this->GetValue("Is_1_ph"));
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return $powerSteps;
|
||||
|
||||
Reference in New Issue
Block a user