version 1.7.4

This commit is contained in:
Johannes Holzwarth | SE-Inno GmbH
2024-01-24 10:41:00 +01:00
parent fd7eedea75
commit c1ba3eb052
5 changed files with 29 additions and 16 deletions
+14 -3
View File
@@ -38,8 +38,6 @@ class MonitoringServer extends IPSModule {
$this->RegisterVariableInteger("AlarmActiveCount", "Number of Values in Alarmstate", "", 1);
$this->RegisterVariableInteger("AnalogVarCount", "Number of Analogvalues", "", 2);
$this->RegisterVariableInteger("DigitalVarCount", "Number of DigitalValues", "", 3);
$this->RegisterVariableString("InfluxState", "Influx-DB State", "", 4);
$this->RegisterVariableString("InfluxMessage", "Influx-DB Message", "", 5);
}
@@ -182,6 +180,7 @@ class MonitoringServer extends IPSModule {
$ispnumber = $this->ReadPropertyInteger("ISP");
$logit = $this->ReadPropertyBoolean("LogValues");
$logit = $this->ReadPropertyBoolean("LogValues");
$numberofvalues = 0;
@@ -240,6 +239,7 @@ class MonitoringServer extends IPSModule {
$system = "P".$projectnumber."_ISP".$ispnumber;
$category = $system."_Analog";
$valuename = $parname."".$varname;
//IPS_LogMessage ("Analog Var-Logger", "Ready: ".$system."/".$category."/".$valuename." with Value: ".$payload);
if($this->checkInfluxState() > -1){
@@ -384,16 +384,27 @@ class MonitoringServer extends IPSModule {
$catChilds = IPS_GetChildrenIDs($catAlarmId);
foreach ($catChilds as $catChild) { //for each object in category
$this->createAlarmprofile();
$objchildids = IPS_GetChildrenIDs($catChild); //get variables of objects
$parname = IPS_GetName($catChild);
IPS_SetName($catChild,$this->getTextAfterLastSlash($parname));
IPS_SetVariableCustomProfile($catChild, "Alarm");
}
}
}
public function createAlarmprofile(){
if(!IPS_VariableProfileExists ("Alarm") ){
IPS_CreateVariableProfile("Alarm", 0);
IPS_SetVariableProfileAssociation("Alarm", true, "Störung", "Alert", 0xFF0000);
IPS_SetVariableProfileAssociation("Alarm", false, "OK", "Ok", 0x00FF00);
}
}
}
?>