From 61396bd111e40cc5cdde7ebad022820628538974 Mon Sep 17 00:00:00 2001 From: "belevo\\mh" Date: Wed, 3 Dec 2025 10:16:51 +0100 Subject: [PATCH] no message --- Batterie_test/module.php | 41 ++++++++++++++++++++++------------------ 1 file changed, 23 insertions(+), 18 deletions(-) diff --git a/Batterie_test/module.php b/Batterie_test/module.php index 106a686..7991ad4 100644 --- a/Batterie_test/module.php +++ b/Batterie_test/module.php @@ -25,7 +25,7 @@ class Batterie_test extends IPSModule //$this->RegisterVariableInteger("Laden3_Entladen4","Laden3_Entladen4", "",3); $this->RegisterVariableInteger("Laden_Entladen","Laden_Entladen", "",3); $this->RegisterVariableFloat("Ladeleistung","Ladeleistung", "",0); - $this->RegisterVariableFloat("Goodwe_EntLadeleistung","Goodwe_EntLadeleistung", "",0); + //$this->RegisterVariableFloat("Goodwe_EntLadeleistung","Goodwe_EntLadeleistung", "",0); $this->RegisterVariableInteger("Aktuelle_Leistung", "Aktuelle_Leistung", "", 0); $this->RegisterVariableString("PowerSteps", "PowerSteps"); $this->RegisterVariableBoolean("Idle", "Idle", "", 0); @@ -65,26 +65,31 @@ class Batterie_test extends IPSModule $batterietyp = $this->ReadPropertyInteger("Batterietyp"); switch ($batterietyp) { - case 1: // z.B. LiFePo4 - $this->MaintainVariable("Goodwe_EntLadeleistung", "Goodwe_EntLadeleistung", "", 10, true); - $this->MaintainVariable("BattTyp2_Wert", "BattTyp2_Wert", "", 11, false); - $this->MaintainVariable("BattTyp3_Wert", "BattTyp3_Wert", "", 12, false); - break; + case 1: // z.B. LiFePo4 + $this->MaintainVariable("Goodwe_EntLadeleistung", "Goodwe_EntLadeleistung", VARIABLETYPE_FLOAT, "", 10, true); + $this->MaintainVariable("BattTyp2_Wert", "BattTyp2_Wert", VARIABLETYPE_FLOAT, "", 11, false); + $this->MaintainVariable("BattTyp3_Wert", "BattTyp3_Wert", VARIABLETYPE_FLOAT, "", 12, false); + break; - case 2: // z.B. Blei-Gel - $this->MaintainVariable("Goodwe_EntLadeleistung", "Goodwe_EntLadeleistung", "", 10, false); - $this->MaintainVariable("BattTyp2_Wert", "BattTyp2_Wert", "", 11, true); - $this->MaintainVariable("BattTyp3_Wert", "BattTyp3_Wert", "", 12, false); - break; - break; + case 2: // z.B. Blei-Gel + $this->MaintainVariable("Goodwe_EntLadeleistung", "Goodwe_EntLadeleistung", VARIABLETYPE_FLOAT, "", 10, false); + $this->MaintainVariable("BattTyp2_Wert", "BattTyp2_Wert", VARIABLETYPE_FLOAT, "", 11, true); + $this->MaintainVariable("BattTyp3_Wert", "BattTyp3_Wert", VARIABLETYPE_FLOAT, "", 12, false); + break; - case 2: + case 3: // dritter Typ + $this->MaintainVariable("Goodwe_EntLadeleistung", "Goodwe_EntLadeleistung", VARIABLETYPE_FLOAT, "", 10, false); + $this->MaintainVariable("BattTyp2_Wert", "BattTyp2_Wert", VARIABLETYPE_FLOAT, "", 11, false); + $this->MaintainVariable("BattTyp3_Wert", "BattTyp3_Wert", VARIABLETYPE_FLOAT, "", 12, true); + break; - $this->MaintainVariable("Goodwe_EntLadeleistung", "Goodwe_EntLadeleistung", "", 10, false); - $this->MaintainVariable("BattTyp2_Wert", "BattTyp2_Wert", "", 11, false); - $this->MaintainVariable("BattTyp3_Wert", "BattTyp3_Wert", "", 12, true); - break; - } + default: + // Sicherheit: alles weg + $this->MaintainVariable("Goodwe_EntLadeleistung", "Goodwe_EntLadeleistung", VARIABLETYPE_FLOAT, "", 10, false); + $this->MaintainVariable("BattTyp2_Wert", "BattTyp2_Wert", VARIABLETYPE_FLOAT, "", 11, false); + $this->MaintainVariable("BattTyp3_Wert", "BattTyp3_Wert", VARIABLETYPE_FLOAT, "", 12, false); + break; + } }