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

View File

@@ -37,14 +37,14 @@
},
{
"type": "SelectVariable",
"name": "Ladestrom",
"caption": "Ladestrom",
"name": "Entladeleistung",
"caption": "Entladeleistung",
"test": true
},
{
"type": "SelectVariable",
"name": "Entladestrom",
"caption": "Entladestrom",
"name": "Ladeleistung",
"caption": "Ladeleistung",
"test": true
}

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"));

View File

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