diff --git a/MinMax/form.json b/MinMax/form.json index e684791..5bb96b2 100644 --- a/MinMax/form.json +++ b/MinMax/form.json @@ -7,6 +7,7 @@ ], "actions": [ + { "type": "Button", "label": "Set Init Values", "onClick": "VTMM_setInitValues($id);" } ], "status": diff --git a/MinMax/module.php b/MinMax/module.php index 1adbf95..efb1952 100644 --- a/MinMax/module.php +++ b/MinMax/module.php @@ -14,13 +14,13 @@ class MinMax extends IPSModule { SetValue($this->RegisterVariableFloat("ActualValue", "Aktueller Wert","",0),123.4); - SetValue($this->RegisterVariableFloat("MinValue", "Minimalwert","LimitValue",10),20); + $this->RegisterVariableFloat("MinValue", "Minimalwert","LimitValue",10); $this->EnableAction("MinValue"); SetValue($this->RegisterVariableBoolean("MinValueEn", "Minimalwert auswerten?","LimitEn",20),true); $this->EnableAction("MinValueEn"); $this->RegisterVariableBoolean("IsMinValue", "Minimalwert","~Alert",30); - SetValue($this->RegisterVariableFloat("MaxValue", "Maximalwert","LimitValue",50),70); + $this->RegisterVariableFloat("MaxValue", "Maximalwert","LimitValue",50); $this->EnableAction("MaxValue"); SetValue($this->RegisterVariableBoolean("MaxValueEn", "Maximalwert auswerten?","LimitEn",60),true); $this->EnableAction("MaxValueEn"); @@ -169,7 +169,14 @@ class MinMax extends IPSModule { return false; } } + public function setInitValues(){ + SetValue($this->GetIDForIdent("NotifyTitel"),"Störung!"); + SetValue($this->GetIDForIdent("NotifyTextMin"),"Grenzwert unterschritten"); + SetValue($this->GetIDForIdent("NotifyTextMax"),"Grenzwert überschritten"); + SetValue($this->GetIDForIdent("Hysterese"),1); + + } } ?> \ No newline at end of file diff --git a/Multialarmer/form.json b/Multialarmer/form.json index a234060..bcf5544 100644 --- a/Multialarmer/form.json +++ b/Multialarmer/form.json @@ -11,6 +11,7 @@ ], "actions": [ + { "type": "Button", "label": "Set Init Values", "onClick": "VTMA_setInitValues($id);" } ], "status": diff --git a/Multialarmer/module.php b/Multialarmer/module.php index bee06f7..fcc5579 100644 --- a/Multialarmer/module.php +++ b/Multialarmer/module.php @@ -14,13 +14,13 @@ class Multialarmer extends IPSModule { $this->RegisterPropertyInteger("ValueId03",0); $this->RegisterPropertyInteger("ValueId04",0); - SetValue($this->RegisterVariableBoolean("NotifyEn01", "Variable 01 Melden?","LimitEn",95),true); + $this->RegisterVariableBoolean("NotifyEn01", "Variable 01 Melden?","LimitEn",95); $this->EnableAction("NotifyEn01"); - SetValue($this->RegisterVariableBoolean("NotifyEn02", "Variable 02 Melden?","LimitEn",115),true); + $this->RegisterVariableBoolean("NotifyEn02", "Variable 02 Melden?","LimitEn",115); $this->EnableAction("NotifyEn02"); - SetValue($this->RegisterVariableBoolean("NotifyEn03", "Variable 03 Melden?","LimitEn",135),true); + $this->RegisterVariableBoolean("NotifyEn03", "Variable 03 Melden?","LimitEn",135); $this->EnableAction("NotifyEn03"); - SetValue($this->RegisterVariableBoolean("NotifyEn04", "Variable 04 Melden?","LimitEn",155),true); + $this->RegisterVariableBoolean("NotifyEn04", "Variable 04 Melden?","LimitEn",155); $this->EnableAction("NotifyEn04"); SetValue($this->RegisterVariableString("NotifyTitel01", "Titel der Benachrichtigung Var 01","~TextBox",100),"Störung!"); @@ -98,7 +98,7 @@ class Multialarmer extends IPSModule { $NotifyTitel01 = GetValue($this->GetIDForIdent("NotifyTitel01")); - $NotifyText01 = IPS_GetName($IdVariable01);//GetValue($this->GetIDForIdent("NotifyText01")); + $NotifyText01 = IPS_GetName($IdVariable01);//GetValue($this->GetIDForIdent("NotifyText01")); 2.207.168.165/29 $NotifyTitel02 = GetValue($this->GetIDForIdent("NotifyTitel02")); $NotifyText02 = IPS_GetName($IdVariable02);//GetValue($this->GetIDForIdent("NotifyText02")); @@ -140,6 +140,17 @@ class Multialarmer extends IPSModule { } + + public function setInitValues(){ + SetValue($this->GetIDForIdent("NotifyTitel01"),"Störung!"); + + SetValue($this->GetIDForIdent("NotifyTitel02"),"Störung!"); + + SetValue($this->GetIDForIdent("NotifyTitel03"),"Störung!"); + + SetValue($this->GetIDForIdent("NotifyTitel04"),"Störung!"); + } + private function notify($trigid, $webfrontid, $targetid, $art, $smname, $ico){ if (GetValueBoolean($trigid) == true && ($this->GetBuffer($smname) == "true")) { diff --git a/Varnamer/module.php b/Varnamer/module.php index ffdd7da..505dfae 100644 --- a/Varnamer/module.php +++ b/Varnamer/module.php @@ -14,19 +14,15 @@ class Varnamer extends IPSModule { - SetValue($this->RegisterVariableString("Name01", "Name Variable 1","~TextBox",10),"Variable 1"); + $this->RegisterVariableString("Name01", "Name Variable 1","~TextBox",10); $this->EnableAction("Name01"); - SetValue($this->RegisterVariableString("Name02", "Name Variable 2","~TextBox",10),"Variable 2"); + $this->RegisterVariableString("Name02", "Name Variable 2","~TextBox",20); $this->EnableAction("Name02"); - SetValue($this->RegisterVariableString("Name03", "Name Variable 3","~TextBox",10),"Variable 3"); + $this->RegisterVariableString("Name03", "Name Variable 3","~TextBox",30); $this->EnableAction("Name03"); - SetValue($this->RegisterVariableString("Name04", "Name Variable 4","~TextBox",10),"Variable 4"); + $this->RegisterVariableString("Name04", "Name Variable 4","~TextBox",40); $this->EnableAction("Name04"); - - - - } // Überschreibt die intere IPS_ApplyChanges($id) Funktion @@ -34,6 +30,8 @@ class Varnamer extends IPSModule { // Diese Zeile nicht löschen parent::ApplyChanges(); + $this->getInitValues(); + } public function RequestAction($Ident, $Value) { $varid = $this->GetIDForIdent($Ident); @@ -70,6 +68,19 @@ class Varnamer extends IPSModule { } + public function getInitValues(){ + $Idvalue01 = $this->ReadPropertyInteger("IdVariable01"); + $Idvalue02 = $this->ReadPropertyInteger("IdVariable02"); + $Idvalue03 = $this->ReadPropertyInteger("IdVariable03"); + $Idvalue04 = $this->ReadPropertyInteger("IdVariable04"); + + SetValue($this->GetIDForIdent("Name01"),IPS_GetName($Idvalue01)); + SetValue($this->GetIDForIdent("Name02"),IPS_GetName($Idvalue01)); + SetValue($this->GetIDForIdent("Name03"),IPS_GetName($Idvalue01)); + SetValue($this->GetIDForIdent("Name04"),IPS_GetName($Idvalue01)); + + } + }