no message
This commit is contained in:
@@ -8,10 +8,7 @@ class Puffer_Speicher extends IPSModule
|
||||
|
||||
$this->RegisterPropertyInteger("PufferLeistung", 6000);
|
||||
$this->RegisterPropertyInteger("PufferTeilLeistung", 3000);
|
||||
$this->RegisterPropertyInteger("Stage1", 1);
|
||||
$this->RegisterPropertyInteger("Stage2", 2);
|
||||
$this->RegisterPropertyInteger("Stage3", 3);
|
||||
$this->RegisterPropertyInteger("Stage4", 4);
|
||||
$this->RegisterPropertyString("LeistungsStufen", json_encode([])); // Bezeichnung der Liste
|
||||
$this->RegisterPropertyInteger("ZeitKonstante", 120);
|
||||
$this->RegisterPropertyInteger("Pufferfuehler_PT1", 0);
|
||||
$this->RegisterPropertyInteger("Heizkontakt2_Puffer", 0);
|
||||
@@ -61,6 +58,25 @@ class Puffer_Speicher extends IPSModule
|
||||
parent::ApplyChanges();
|
||||
$this->SetTimerInterval("Timer_Do_UserCalc_Boiler",$this->ReadPropertyInteger("Interval")*1000);
|
||||
|
||||
// JSON aus der Property auslesen
|
||||
$json = $this->ReadPropertyString("LeistungsStufen");
|
||||
$leistungsStufen = json_decode($json, true);
|
||||
|
||||
// Array mit Werten aufbauen, erste Stufe = 0
|
||||
$leistungArray = [0]; // Startwert 0
|
||||
|
||||
if (is_array($leistungsStufen)) {
|
||||
foreach ($leistungsStufen as $stufe) {
|
||||
if (isset($stufe['Leistung'])) {
|
||||
$leistungArray[] = $stufe['Leistung'];
|
||||
} else {
|
||||
$leistungArray[] = 0; // falls 'Leistung' fehlt
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Optional: Debug-Ausgabe
|
||||
IPS_LogMessage("LeistungArray", json_encode($leistungArray));
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user