diff --git a/Batterie/form.json b/Batterie/form.json index b95e24d..d600cc8 100644 --- a/Batterie/form.json +++ b/Batterie/form.json @@ -85,6 +85,11 @@ "type": "SelectVariable", "name": "Netzbezug", "caption": "Variable mit dem zu regelnden Netzbezug" + }, + { + "type": "SelectVariable", + "name": "AktuelleBatterieleistung", + "caption": "Variable mit der aktueller Batterieleistung" }, { "type": "Label", diff --git a/Batterie/module.php b/Batterie/module.php index 4f73d8b..c1e3698 100644 --- a/Batterie/module.php +++ b/Batterie/module.php @@ -15,7 +15,8 @@ class Batterie extends IPSModule $this->RegisterPropertyInteger("Batteriemanagement", 1); $this->RegisterPropertyInteger("Batterietyp", 1); $this->RegisterPropertyInteger("MaxNachladen",0); - $this->RegisterPropertyInteger("Netzbezug", 0); // Initialisierung mit 0 + $this->RegisterPropertyInteger("Netzbezug", 0); + $this->RegisterPropertyInteger("AktuelleBatterieleistung", 0);// Initialisierung mit 0 $this->RegisterPropertyInteger("Interval", 2); // Recheninterval @@ -379,6 +380,8 @@ public function RequestAction($Ident, $Value) $netzbezug = GetValue($this->ReadPropertyInteger("Netzbezug")); + $bat_leistung = GetValue($this->ReadPropertyInteger("AktuelleBatterieleistung")); + /* if (abs($netzbezug) > $maxentladeleistung) { //$netzbezug = $maxentladeleistung * (-1); @@ -387,7 +390,7 @@ public function RequestAction($Ident, $Value) if ($Peak && $netzbezug > 0) { - $netzbezug = -min($netzbezug, $maxentladeleistung); + $netzbezug = -min($netzbezug, $maxentladeleistung) + $bat_leistung; } if($batterieladezustand>(5+$aufdasnachladen)){