stepgrösse und berechnungsintervall geändert

This commit is contained in:
2025-03-14 10:21:25 +01:00
parent f3f4c48b65
commit 3224518861
3 changed files with 11 additions and 5 deletions

View File

@@ -44,7 +44,7 @@ class Batterie extends IPSModule
// Initialisiere Idle
$this->SetValue("Idle", true);
$this->RegisterTimer("Timer_Do_UserCalc",5000,"IPS_RequestAction(" .$this->InstanceID .', "Do_UserCalc", "");');
$this->RegisterTimer("Timer_Do_UserCalc",2500,"IPS_RequestAction(" .$this->InstanceID .', "Do_UserCalc", "");');
}
@@ -56,11 +56,11 @@ class Batterie extends IPSModule
$batterieManagement = $this->ReadPropertyInteger("Batteriemanagement");
$this->SetValue("Batteriemanagement_Variabel", $batterieManagement);
}
private function GeneratePowerSteps($additionalValue)
{
$maxleistung = $this->ReadPropertyInteger("MaxBatterieleistung");
$stepSize = 125; // Schrittgröße
$stepSize = 250; // Schrittgröße
$stepSizeSmall = 25; // Kleine Schrittgröße
// Array direkt als Range erzeugen (schneller als Schleife)
@@ -79,11 +79,17 @@ class Batterie extends IPSModule
// Zusätzliche Werte berechnen und auf MaxLeistung begrenzen
$newValues = array_filter([
$closestValue - 5 * $stepSizeSmall,
$closestValue - 4 * $stepSizeSmall,
$closestValue - 3 * $stepSizeSmall,
$closestValue - 2 * $stepSizeSmall,
$closestValue - $stepSizeSmall,
$closestValue,
$closestValue + $stepSizeSmall,
$closestValue + 2 * $stepSizeSmall
$closestValue + 3 * $stepSizeSmall
$closestValue + 4 * $stepSizeSmall
$closestValue + 5 * $stepSizeSmall
], function ($value) use ($maxleistung) {
return $value >= -$maxleistung && $value <= $maxleistung;
});

View File

@@ -17,7 +17,7 @@ class Manager extends IPSModule
$this->RegisterPropertyInteger("DatenZuruck", 0); // Initialisierung mit 0
// Timer registrieren
$this->RegisterTimer("Timer_DistributeEnergy",5000,"IPS_RequestAction(" .$this->InstanceID .', "DistributeEnergy", "");');
$this->RegisterTimer("Timer_DistributeEnergy",3000,"IPS_RequestAction(" .$this->InstanceID .', "DistributeEnergy", "");');
}
public function ApplyChanges()

View File

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