no message
This commit is contained in:
@@ -50,49 +50,33 @@
|
|||||||
"caption": "Puffer Teillast",
|
"caption": "Puffer Teillast",
|
||||||
"suffix": "Watt"
|
"suffix": "Watt"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "Select",
|
"type":"List",
|
||||||
"name": "Stufen",
|
"name":"LeistungsStufen",
|
||||||
"caption": "Anzahl Stufen",
|
"caption":"Anzahl Stufen mit den dazugehörigen Leistungen",
|
||||||
"options": [
|
"add":true,
|
||||||
{"caption": "1-stufig", "value": 1},
|
"delete":true,
|
||||||
{"caption": "2-stufig", "value": 2},
|
"columns":[
|
||||||
{"caption": "3-stufig", "value": 3},
|
{
|
||||||
{"caption": "4-stufig", "value": 4}
|
"caption":"Stufe",
|
||||||
]
|
"name":"Variablenname",
|
||||||
},
|
"width":"200px",
|
||||||
{
|
"add":"Stufe",
|
||||||
"type": "NumberSpinner",
|
"edit":{
|
||||||
"name": "Stage1",
|
"type":"ValidationTextBox"
|
||||||
"caption": "1-stufig",
|
}
|
||||||
"minimum": 0,
|
},
|
||||||
"maximum": 100,
|
{
|
||||||
"visible": true
|
"caption":"Leistung in W",
|
||||||
},
|
"name":"Leistung",
|
||||||
{
|
"width":"300px",
|
||||||
"type": "NumberSpinner",
|
"add":0,
|
||||||
"name": "Stage2",
|
"edit":{
|
||||||
"caption": "2-stufig",
|
"type":"NumberSpinner"
|
||||||
"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": "Label",
|
"type": "Label",
|
||||||
|
|||||||
@@ -8,10 +8,7 @@ class Puffer_Speicher extends IPSModule
|
|||||||
|
|
||||||
$this->RegisterPropertyInteger("PufferLeistung", 6000);
|
$this->RegisterPropertyInteger("PufferLeistung", 6000);
|
||||||
$this->RegisterPropertyInteger("PufferTeilLeistung", 3000);
|
$this->RegisterPropertyInteger("PufferTeilLeistung", 3000);
|
||||||
$this->RegisterPropertyInteger("Stage1", 1);
|
$this->RegisterPropertyString("LeistungsStufen", json_encode([])); // Bezeichnung der Liste
|
||||||
$this->RegisterPropertyInteger("Stage2", 2);
|
|
||||||
$this->RegisterPropertyInteger("Stage3", 3);
|
|
||||||
$this->RegisterPropertyInteger("Stage4", 4);
|
|
||||||
$this->RegisterPropertyInteger("ZeitKonstante", 120);
|
$this->RegisterPropertyInteger("ZeitKonstante", 120);
|
||||||
$this->RegisterPropertyInteger("Pufferfuehler_PT1", 0);
|
$this->RegisterPropertyInteger("Pufferfuehler_PT1", 0);
|
||||||
$this->RegisterPropertyInteger("Heizkontakt2_Puffer", 0);
|
$this->RegisterPropertyInteger("Heizkontakt2_Puffer", 0);
|
||||||
@@ -61,6 +58,25 @@ class Puffer_Speicher extends IPSModule
|
|||||||
parent::ApplyChanges();
|
parent::ApplyChanges();
|
||||||
$this->SetTimerInterval("Timer_Do_UserCalc_Boiler",$this->ReadPropertyInteger("Interval")*1000);
|
$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