Leistung hinzugefügt

This commit is contained in:
belevo\mh
2025-02-24 07:55:42 +01:00
parent cdc3dfc448
commit 9b0d1a328a
3 changed files with 18 additions and 9 deletions
+13 -4
View File
@@ -12,12 +12,13 @@ class Batterie extends IPSModule
$this->RegisterPropertyInteger("AufdasNachladen",0);
$this->RegisterPropertyInteger("MinimumEntladen",0);
$this->RegisterPropertyInteger("Batterieladezustand",0);
//$this->RegisterPropertyFloat("Ladestrom",0);
//$this->RegisterPropertyFloat("Entladestrom",0);
// Variabeln für Kommunkation mit Manager
$this->RegisterVariableFloat("Ladestrom", "Ladestrom", "", 0);
$this->RegisterVariableFloat("Entladestrom", "Entladestrom", "", 0);
$this->RegisterVariableFloat("Ladeleistung", "Ladeleistung", "", 0);
$this->RegisterVariableFloat("Entladeleistung", "Entladeleistung", "", 0);
$this->RegisterVariableInteger("Aktuelle_Leistung", "Aktuelle_Leistung", "", 0);
$this->RegisterVariableString("PowerSteps", "PowerSteps");
$this->RegisterVariableBoolean("Idle", "Idle", "", 0);
@@ -91,8 +92,16 @@ public function RequestAction($Ident, $Value)
public function SetAktuelle_Leistung(int $power)
{
$batterieladezustand = $this->ReadPropertyInteger("Batterieladezustand"); // Als Property gelesen
$maxleistung = $this->ReadPropertyInteger("MaxBatterieleistung"); // Als Property gelesen
$ladeleistung = $this->ReadPropertyFloat("Ladeleistung");
$entladeleistung = $this->ReadPropertyFloat("Entladeleistung"); // Korrigierter Name
if ($power >= 0) {
$this->SetValue("Ladeleistung", $power);
} else {
$this->SetValue("Entladeleistung", abs($power));
}
$spannung = $this->ReadPropertyInteger("Batteriespannung"); // Spannung ebenfalls als Property
//$ladestrom = GetValue($this->GetIDForIdent("Ladestrom"));
//$entladestrom = GetValue($this->GetIDForIdent("Entladestrom"));