1-Phasenumschaltung funktioniert jetzt besser

This commit is contained in:
2024-07-17 14:51:59 +02:00
parent a9cb24a2c3
commit fcff795137
2 changed files with 39 additions and 7 deletions

View File

@@ -177,13 +177,13 @@ public function GetCurrentData(bool $Peak) {
$powerSteps = [$maxLeistung];
} elseif (!$Peak && $solarladen) {
$powerSteps = array_merge($powerSteps, $this->getRangeLimits($minLeistung, $maxLeistung));
$powerSteps = array_merge($powerSteps, $this->getRangeLimits($minLeistung, $maxLeistung, GetValue($this->GetIDForIdent("Lademodus"))));
} elseif ($solarladen && $Peak) {
$powerSteps = [0];
} else {
$powerSteps += $this->getRangeLimits($minLeistung, $maxLeistung);
$powerSteps += $this->getRangeLimits($minLeistung, $maxLeistung, GetValue($this->GetIDForIdent("Lademodus")));
}
}
@@ -254,7 +254,7 @@ public function sendPowerToStation($value) {
public function convertPowerToCurrent($value, $Lademodus) {
if($Lademodus==1){
if ($value == 0) {
if ($value == 0) {
return 0;
} elseif ($value == 4150) {
return 6;
@@ -377,8 +377,9 @@ public function convertPowerToCurrent($value, $Lademodus) {
}
}
public function getRangeLimits($min, $max) {
$limits = [
public function getRangeLimits($min, $max, $Lademodus) {
if($Lademodus==1){
$limits = [
4150,
4850,
5550,
@@ -406,7 +407,38 @@ public function getRangeLimits($min, $max) {
20800,
21500,
22000
];
];}
elseif($Lademodus==0){
$limits = [
1450,
1690,
1930,
2170,
2410,
2650,
2890,
3130,
3370,
3610,
3850,
4090,
4330,
4570,
4810,
5050,
5290,
5530,
5770,
6010,
6250,
6490,
6730,
6970,
7210,
7450,
7690
];
}
$result = [];

View File

@@ -6,7 +6,7 @@
"compatibility": {
"version": "7.1"
},
"version": "0.4",
"version": "0.5",
"build": 0,
"date": 0
}