no message

This commit is contained in:
belevo\mh
2025-10-02 09:37:00 +02:00
parent 1c615c30f2
commit 3c40e386f2
2 changed files with 47 additions and 47 deletions

View File

@@ -50,49 +50,33 @@
"caption": "Puffer Teillast",
"suffix": "Watt"
},
{
"type": "Select",
"name": "Stufen",
"caption": "Anzahl Stufen",
"options": [
{"caption": "1-stufig", "value": 1},
{"caption": "2-stufig", "value": 2},
{"caption": "3-stufig", "value": 3},
{"caption": "4-stufig", "value": 4}
]
},
{
"type": "NumberSpinner",
"name": "Stage1",
"caption": "1-stufig",
"minimum": 0,
"maximum": 100,
"visible": true
},
{
"type": "NumberSpinner",
"name": "Stage2",
"caption": "2-stufig",
"minimum": 0,
"maximum": 100,
"visible": "this.Stufen >= 2"
},
{
"type": "NumberSpinner",
"name": "Stage3",
"caption": "3-stufig",
"minimum": 0,
"maximum": 100,
"visible": "this.Stufen >= 3"
},
{
"type": "NumberSpinner",
"name": "Stage4",
"caption": "4-stufig",
"minimum": 0,
"maximum": 100,
"visible": "this.Stufen >= 4"
},
{
"type":"List",
"name":"LeistungsStufen",
"caption":"Anzahl Stufen mit den dazugehörigen Leistungen",
"add":true,
"delete":true,
"columns":[
{
"caption":"Stufe",
"name":"Variablenname",
"width":"200px",
"add":"Stufe",
"edit":{
"type":"ValidationTextBox"
}
},
{
"caption":"Leistung in W",
"name":"Leistung",
"width":"300px",
"add":0,
"edit":{
"type":"NumberSpinner"
}
}
]
},
{
"type": "Label",

View File

@@ -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));
}