zuürck gesetzt für Fehler diagnose

This commit is contained in:
belevo\mh
2025-02-24 10:18:13 +01:00
parent 00f16ad917
commit 3c76c2a0dd
2 changed files with 19 additions and 25 deletions

View File

@@ -94,32 +94,26 @@ public function RequestAction($Ident, $Value)
public function SetAktuelle_Leistung(int $power)
{
// Ausgewählte Variablen aus der Instanzkonfiguration lesen
$entladeleistungID = $this->ReadPropertyFloat("Entladeleistung");
$ladeleistungID = $this->ReadPropertyFloat("Ladeleistung");
// Überprüfen, ob die Entladeleistung-ID korrekt gesetzt ist
if ($entladeleistungID > 0) {
if ($power < 0) {
// Entladeleistung setzen (wenn power negativ ist)
$this->SetValue("AktuelleEntladeleistung", abs($power));
$this->SetValue("AktuelleLadeleistung", 0); // Ladeleistung auf 0 setzen
} else {
// Ladeleistung auf 0 setzen, wenn keine Entladung stattfindet
$this->SetValue("AktuelleEntladeleistung", 0);
}
$spannung = $this->ReadPropertyInteger("Batteriespannung");
//$ladestrom = GetValue($this->GetIDForIdent("Ladestrom"));
//$entladestrom = GetValue($this->GetIDForIdent("Entladestrom"));
$ladestrom = $this->ReadPropertyFloat("Ladestrom");
$entladestrom = $this->ReadPropertyFloat("Entladestrom");
if ($spannung <= 0) {
IPS_LogMessage("Batterie", "Fehler: Batteriespannung ist 0 oder ungültig.");
return;
}
// Überprüfen, ob die Ladeleistung-ID korrekt gesetzt ist
if ($ladeleistungID > 0) {
if ($power >= 0) {
// Ladeleistung setzen (wenn power positiv ist)
$this->SetValue("AktuelleLadeleistung", $power);
$this->SetValue("AktuelleEntladeleistung", 0); // Entladeleistung auf 0 setzen
} else {
// Ladeleistung auf 0 setzen, wenn keine Aufladung stattfindet
$this->SetValue("AktuelleLadeleistung", 0);
}
if ($power >= 0) {
$ladestrom = $power / $spannung;
$this->SetValue("Ladestrom", $ladestrom);
$this->SetValue("Entladestrom", 0);
} else {
$entladestrom = $power / $spannung;
$this->SetValue("Entladestrom", $entladestrom);
$this->SetValue("Ladestrom", 0);
}

View File

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