This commit is contained in:
belevo\mh
2024-12-23 09:53:47 +01:00
parent 9fe704d119
commit 6ab9a59633
3 changed files with 8 additions and 5 deletions

View File

@@ -21,6 +21,7 @@ class Batterie extends IPSModule
$this->RegisterVariableBoolean("Idle", "Idle", "", 0);
$this->RegisterVariableInteger("Sperre_Prio", "Sperre_Prio");
$this->RegisterVariableInteger("PV_Prio", "PV_Prio");
$this->RegisterVariableFloat("Bezogene_Energie", "Bezogene_Energie", "", 0);
// Hilfsvariabeln für Idle zustand
$this->RegisterPropertyInteger("IdleCounterMax", 2);
@@ -69,10 +70,11 @@ class Batterie extends IPSModule
public function SetAktuelle_Leistung(int $power)
{
// Batterie-spezifische Eigenschaften abrufen
$spannung = $this->ReadPropertyInteger("Batteriespannung");
$entladestrom = $this->ReadVariableInteger("Entladestrom");
$ladestrom = $this->ReadVariableInteger("Ladestrom");
$maxleistung = $this->ReadPropertyInteger("MaxBatterieleistung");
$array_powersteps = $this->GeneratePowerSteps();
$aktuellerWert = $this->GetValue("Aktuelle_Leistung");
$minimumentladen = $this->ReadPropertyInteger("MinimumEntladen");
$batterieladezustand = $this->ReadPropertyInteger("Batterieladezustand");
$maxleistung = $this->GetValue("MaxBatterieleistung");
// Batterie entladen oder laden basierend auf der Leistung
if ($power > $maxleistung) {