gleiche wie vorhin
This commit is contained in:
@@ -12,13 +12,12 @@ class Batterie extends IPSModule
|
||||
$this->RegisterPropertyInteger("AufdasNachladen",0);
|
||||
$this->RegisterPropertyInteger("MinimumEntladen",0);
|
||||
$this->RegisterPropertyInteger("Batterieladezustand",0);
|
||||
|
||||
$this->RegisterPropertyFloat("Entladeleistung",0);
|
||||
$this->RegisterPropertyFloat("Ladeleistung",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);
|
||||
@@ -94,15 +93,15 @@ public function RequestAction($Ident, $Value)
|
||||
{
|
||||
|
||||
$ladeleistung = $this->ReadPropertyFloat("Ladeleistung");
|
||||
$entladeleistung = $this->ReadPropertyFloat("Entladeleistung"); // Korrigierter Name
|
||||
$entladeleistung = $this->ReadPropertyFloat("Entladeleistung");
|
||||
|
||||
if ($power >= 0) {
|
||||
$this->SetValue("Ladeleistung", $power);
|
||||
SetValue($this->ReadPropertyFloat("Ladeleistung"), $power);
|
||||
} else {
|
||||
$this->SetValue("Entladeleistung", abs($power));
|
||||
SetValue($this->ReadPropertyFloat("Entladeleistung"),abs($power));
|
||||
}
|
||||
|
||||
$spannung = $this->ReadPropertyInteger("Batteriespannung"); // Spannung ebenfalls als Property
|
||||
$spannung = $this->ReadPropertyInteger("Batteriespannung");
|
||||
//$ladestrom = GetValue($this->GetIDForIdent("Ladestrom"));
|
||||
//$entladestrom = GetValue($this->GetIDForIdent("Entladestrom"));
|
||||
$ladestrom = $this->ReadPropertyFloat("Ladestrom");
|
||||
@@ -113,17 +112,15 @@ public function RequestAction($Ident, $Value)
|
||||
IPS_LogMessage("Batterie", "Fehler: Batteriespannung ist 0 oder ungültig.");
|
||||
return;
|
||||
}
|
||||
// Batterie entladen oder laden basierend auf der Leistung
|
||||
|
||||
if ($power >= 0) {
|
||||
$ladestrom = $power / $spannung;
|
||||
$this->SetValue("Ladestrom", $ladestrom);
|
||||
$this->SetValue("Entladestrom", 0);
|
||||
//IPS_LogMessage("Batterie", "Ladestrom: " . $ladestrom);
|
||||
} else {
|
||||
$entladestrom = $power / $spannung;
|
||||
$this->SetValue("Entladestrom", $entladestrom);
|
||||
$this->SetValue("Ladestrom", 0);
|
||||
//IPS_LogMessage("Batterie", "Entladestrom: " . $entladestrom);
|
||||
$this->SetValue("Ladestrom", 0);
|
||||
}
|
||||
|
||||
// Prüfe auf Änderung der Leistung im Vergleich zur letzten Einstellung
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
"compatibility": {
|
||||
"version": "7.1"
|
||||
},
|
||||
"version": "1.047",
|
||||
"version": "1.048",
|
||||
"build": 0,
|
||||
"date": 0
|
||||
}
|
||||
Reference in New Issue
Block a user