Compare commits

...
10 Commits
Author SHA1 Message Date
jhartworks 28605b231a V1.5.2 2024-12-14 11:14:36 +01:00
jhartworks 59ac7efdba V1.5.1 2024-12-13 14:17:04 +01:00
jhartworks b69958b2d7 V1.5 2024-12-13 13:57:00 +01:00
jhartworks 7f88ce0009 V1.4.6 2024-12-13 13:47:48 +01:00
jhartworks 03f74cac69 1.4.5 2024-12-13 11:24:43 +01:00
jhartworks 417b3a728d V1.4.4 2024-12-13 10:57:20 +01:00
jhartworks 9cb39c194c V1.4.3 2024-12-13 10:40:21 +01:00
jhartworks e1ac7c9077 V1.4.2 2024-12-13 08:11:02 +01:00
jhartworks 27a0bee822 V1.4 2024-12-09 09:04:27 +01:00
jhartworks 873f390f00 V1.3 2024-11-29 09:40:49 +01:00
4 changed files with 45 additions and 26 deletions
+5 -4
View File
@@ -3,13 +3,15 @@
[ [
{ "type": "Label", "caption": "Main" }, { "type": "Label", "caption": "Main" },
{ "type": "ValidationTextBox", "name": "devName", "caption": "Name" }, { "type": "ValidationTextBox", "name": "devName", "caption": "Name" },
{ "type": "NumberSpinner", "name": "devTime", "caption": "Refreshtime" }, { "type": "NumberSpinner", "name": "devTime", "caption": "Refreshtime (sek) | Act- Values To Controller", "width": "40%"},
{ "type": "NumberSpinner", "name": "devLoraQueTime", "caption": "LORA QUE Time (min) | Payload to Broker / LORA", "width": "40%"},
{ "type": "Label", "caption": "Mqtt Properties" }, { "type": "Label", "caption": "Mqtt Properties" },
{ "type": "SelectInstance", "name": "mqttGwId", "caption": "Mqtt Gateway", "validModules":["{C6D2AEB3-6E1F-4B2E-8E69-3A1A00246850}"] }, { "type": "SelectInstance", "name": "mqttGwId", "caption": "Mqtt Gateway", "validModules":["{C6D2AEB3-6E1F-4B2E-8E69-3A1A00246850}"] },
{ "type": "SelectInstance", "name": "modGwId", "caption": "Modbus Gateway", "validModules":["{A5F663AB-C400-4FE5-B207-4D67CC030564}"] }, { "type": "SelectInstance", "name": "modGwId", "caption": "Modbus Gateway", "validModules":["{A5F663AB-C400-4FE5-B207-4D67CC030564}"] },
{ "type": "ValidationTextBox", "name": "mqttPrefix", "caption": "Mqtt-Prefix e.g. Milesight01 (/uplink/EUI and /downlink/EUI is autm. added)" }, { "type": "ValidationTextBox", "name": "mqttPrefix", "caption": "Mqtt-Prefix e.g. Milesight01 (/uplink/EUI and /downlink/EUI is autm. added)" , "width": "40%"},
{ "type": "ValidationTextBox", "name": "devEui", "caption": "Device EUI (as Suffix on MQTT Topic)" }, { "type": "ValidationTextBox", "name": "devEui", "caption": "Device EUI (as Suffix on MQTT Topic)" },
@@ -21,7 +23,6 @@
{ "type": "NumberSpinner", "name": "modCurrent_Valve_Position", "caption": "Modbusadress Current_Valve_Position" }, { "type": "NumberSpinner", "name": "modCurrent_Valve_Position", "caption": "Modbusadress Current_Valve_Position" },
{ "type": "NumberSpinner", "name": "modCalibration_OK", "caption": "Modbusadress Calibration_OK" }, { "type": "NumberSpinner", "name": "modCalibration_OK", "caption": "Modbusadress Calibration_OK" },
{ "type": "NumberSpinner", "name": "modFlow_Sensor_Failure", "caption": "Modbusadress Flow_Sensor_Failure" },
{ "type": "NumberSpinner", "name": "modFlow_Temperature", "caption": "Modbusadress Flow_Temperature (Float)" }, { "type": "NumberSpinner", "name": "modFlow_Temperature", "caption": "Modbusadress Flow_Temperature (Float)" },
{ "type": "NumberSpinner", "name": "modHarvesting_Active", "caption": "Modbusadress Harvesting_Active" }, { "type": "NumberSpinner", "name": "modHarvesting_Active", "caption": "Modbusadress Harvesting_Active" },
@@ -48,7 +49,7 @@
], ],
"actions": "actions":
[ [
{ "type": "Button", "label": "Send QUE", "onClick": "MLR3_WriteSetpointvalues($id);" }
], ],
"status": "status":
[ [
+35 -18
View File
@@ -9,6 +9,8 @@ class LoraMlr003 extends IPSModule {
$this->RegisterPropertyString("devName","A Small Valve in a Big World 01"); $this->RegisterPropertyString("devName","A Small Valve in a Big World 01");
$this->RegisterPropertyInteger("devTime",10); $this->RegisterPropertyInteger("devTime",10);
$this->RegisterPropertyInteger("devLoraQueTime",10);
$this->RegisterPropertyString("mqttPrefix","milesight01"); $this->RegisterPropertyString("mqttPrefix","milesight01");
$this->RegisterPropertyInteger("mqttGwId",54321); $this->RegisterPropertyInteger("mqttGwId",54321);
$this->RegisterPropertyInteger("modGwId",54321); $this->RegisterPropertyInteger("modGwId",54321);
@@ -22,7 +24,7 @@ class LoraMlr003 extends IPSModule {
$this->RegisterPropertyInteger("modCurrent_Valve_Position",12345); $this->RegisterPropertyInteger("modCurrent_Valve_Position",12345);
$this->RegisterPropertyInteger("modCalibration_OK",12345); $this->RegisterPropertyInteger("modCalibration_OK",12345);
$this->RegisterPropertyInteger("modFlow_Sensor_Failure",12345);
$this->RegisterPropertyInteger("modFlow_Temperature",12345); $this->RegisterPropertyInteger("modFlow_Temperature",12345);
$this->RegisterPropertyInteger("modHarvesting_Active",12345); $this->RegisterPropertyInteger("modHarvesting_Active",12345);
@@ -50,8 +52,12 @@ class LoraMlr003 extends IPSModule {
$this->RegisterTimer("ReadUpdate", 0, 'MLR3_ReadActualValues('.$this->InstanceID.');'); $this->RegisterTimer("ReadUpdate", 0, 'MLR3_ReadActualValues('.$this->InstanceID.');');
$this->RegisterTimer("WriteUpdate", 0, 'MLR3_WriteSetpointvalues('.$this->InstanceID.');'); $this->RegisterTimer("WriteUpdate", 0, 'MLR3_WriteSetpointvalues('.$this->InstanceID.');');
$this->RegisterVariableString("hexOutput","HEX-Output"); $this->RegisterVariableString("hexOutput","HEX-Output");
$this->RegisterVariableString("jsonOutput","JSON-Output"); $this->RegisterVariableString("jsonOutput","JSON-Output");
$this->RegisterVariableFloat("setpointModbus","Setpoint from Modbus");
$this->RegisterVariableFloat("valvePosition","Actual Valve Position");
$this->RegisterVariableFloat("storageVoltage","Storagevoltage");
} }
@@ -65,6 +71,7 @@ class LoraMlr003 extends IPSModule {
$devEui = $this->ReadPropertyString("devEui"); $devEui = $this->ReadPropertyString("devEui");
$mqttGwId = $this->ReadPropertyInteger("mqttGwId"); $mqttGwId = $this->ReadPropertyInteger("mqttGwId");
$devTime = $this->ReadPropertyInteger("devTime"); $devTime = $this->ReadPropertyInteger("devTime");
$devLoraQueTime = $this->ReadPropertyInteger("devLoraQueTime");
$topicuplink = $mqttPrefix.'/uplink'.'/'.$devEui; $topicuplink = $mqttPrefix.'/uplink'.'/'.$devEui;
$topicdownlink = $mqttPrefix.'/downlink'.'/'.$devEui; $topicdownlink = $mqttPrefix.'/downlink'.'/'.$devEui;
@@ -73,7 +80,7 @@ class LoraMlr003 extends IPSModule {
$this->MqttPublish("s".$devEui, $mqttGwId, $devName." ".$devEui. " downlink", $topicdownlink, "", false, false); $this->MqttPublish("s".$devEui, $mqttGwId, $devName." ".$devEui. " downlink", $topicdownlink, "", false, false);
$this->SetTimerInterval("ReadUpdate", $devTime * 1000); $this->SetTimerInterval("ReadUpdate", $devTime * 1000);
$this->SetTimerInterval("WriteUpdate", $devTime * 1000); $this->SetTimerInterval("WriteUpdate", $devLoraQueTime * 60 * 1000);
} }
/** /**
@@ -128,7 +135,7 @@ class LoraMlr003 extends IPSModule {
//echo $temp; //echo $temp;
if ($temp != "failure") { if ($temp != "failure") {
$adressmodAmbient_Temperature = $this->ReadPropertyInteger("modAmbient_Temperature"); $adressmodAmbient_Temperature = $this->ReadPropertyInteger("modAmbient_Temperature");
/* $this->SendDebug("Ambient_Temperature: ",$temp, 0); /*$this->SendDebug("Ambient_Temperature: ",$temp, 0);
$this->SendDebug("Ambient_Temperature Adress: ", $adressmodAmbient_Temperature, 0); */ $this->SendDebug("Ambient_Temperature Adress: ", $adressmodAmbient_Temperature, 0); */
$this->ModbusPublish($devEui."Ambient_Temperature", $modGwId, $devName." Ambient_Temperature", $adressmodAmbient_Temperature, $temp, $modFcReadActValues, $modFcWriteActValues,7); $this->ModbusPublish($devEui."Ambient_Temperature", $modGwId, $devName." Ambient_Temperature", $adressmodAmbient_Temperature, $temp, $modFcReadActValues, $modFcWriteActValues,7);
$temp = "failure"; $temp = "failure";
@@ -164,6 +171,9 @@ class LoraMlr003 extends IPSModule {
$temp = $this->CheckGetArrayValue($data,"Current_Valve_Position"); $temp = $this->CheckGetArrayValue($data,"Current_Valve_Position");
if ($temp != "failure") { if ($temp != "failure") {
$idFromvalvePosition = $this->GetIDForIdent("valvePosition");
SetValueFloat($idFromvalvePosition,$temp);
$adressmodCurrent_Valve_Position = $this->ReadPropertyInteger("modCurrent_Valve_Position"); $adressmodCurrent_Valve_Position = $this->ReadPropertyInteger("modCurrent_Valve_Position");
$this->ModbusPublish($devEui."Current_Valve_Position", $modGwId, $devName." Current_Valve_Position", $adressmodCurrent_Valve_Position, $temp, $modFcReadActValues, $modFcWriteActValues,5); $this->ModbusPublish($devEui."Current_Valve_Position", $modGwId, $devName." Current_Valve_Position", $adressmodCurrent_Valve_Position, $temp, $modFcReadActValues, $modFcWriteActValues,5);
$temp = "failure"; $temp = "failure";
@@ -193,8 +203,6 @@ class LoraMlr003 extends IPSModule {
$temp = $this->CheckGetArrayValue($data,"Flow_Sensor_Failure"); $temp = $this->CheckGetArrayValue($data,"Flow_Sensor_Failure");
if ($temp != "failure") { if ($temp != "failure") {
$adressmodFlow_Sensor_Failure = $this->ReadPropertyInteger("modFlow_Sensor_Failure");
$this->ModbusPublish($devEui."Flow_Sensor_Failure", $modGwId, $devName." Flow_Sensor_Failure", $adressmodFlow_Sensor_Failure, $temp, $modFcReadActValues, $modFcWriteActValues,0);
$temp = "failure"; $temp = "failure";
} }
@@ -305,6 +313,10 @@ class LoraMlr003 extends IPSModule {
$temp = $this->CheckGetArrayValue($data,"Storage_Voltage"); $temp = $this->CheckGetArrayValue($data,"Storage_Voltage");
if ($temp != "failure") { if ($temp != "failure") {
$adressmodStorage_Voltage = $this->ReadPropertyInteger("modStorage_Voltage"); $adressmodStorage_Voltage = $this->ReadPropertyInteger("modStorage_Voltage");
$idFromstorageVoltage = $this->GetIDForIdent("storageVoltage");
SetValueFloat($idFromstorageVoltage,$temp);
//echo "Storage_Voltage ".$temp; //echo "Storage_Voltage ".$temp;
$this->ModbusPublish($devEui."Storage_Voltage", $modGwId, $devName." Storage_Voltage", $adressmodStorage_Voltage, $temp, $modFcReadActValues, $modFcWriteActValues,7); $this->ModbusPublish($devEui."Storage_Voltage", $modGwId, $devName." Storage_Voltage", $adressmodStorage_Voltage, $temp, $modFcReadActValues, $modFcWriteActValues,7);
$temp = "failure"; $temp = "failure";
@@ -371,26 +383,30 @@ class LoraMlr003 extends IPSModule {
$modFcReadSetpoints = $this->ReadPropertyInteger("modFcReadSetpoints"); $modFcReadSetpoints = $this->ReadPropertyInteger("modFcReadSetpoints");
$adressmodUsermode = $this->ReadPropertyInteger("modUsermode"); $adressmodUsermode = $this->ReadPropertyInteger("modUsermode");
$modUsermode = $this->ModbusPublish($devEui."Usermode", $modGwId, $devName." Usermode", $adressmodUsermode, $temp, $modFcReadSetpoints, 0,5); $modUsermode = 3;//$this->ModbusPublish($devEui."Usermode", $modGwId, $devName." Usermode", $adressmodUsermode, $temp, $modFcReadSetpoints, 0,5);
//echo $adressmodUsermode; //echo $adressmodUsermode;
//echo $modUsermode; //echo $modUsermode;
$adressmodSetpoint = $this->ReadPropertyInteger("modSetpoint"); $adressmodSetpoint = $this->ReadPropertyInteger("modSetpoint");
$modSetpoint = $this->ModbusPublish($devEui."Setpoint", $modGwId, $devName." Setpoint", $adressmodSetpoint, $temp, $modFcReadSetpoints, 0,5); $modSetpoint = $this->ModbusPublish($devEui."Setpoint", $modGwId, $devName." Setpoint", $adressmodSetpoint, $temp, $modFcReadSetpoints, 0,7);
$idFromsetpointModbus = $this->GetIDForIdent("setpointModbus");
SetValueFloat($idFromsetpointModbus,$modSetpoint);
//echo $modSetpoint; //echo $modSetpoint;
$adressmodRoomtemp = $this->ReadPropertyInteger("modRoomtemp"); $adressmodRoomtemp = $this->ReadPropertyInteger("modRoomtemp");
$modRoomtemp = $this->ModbusPublish($devEui."Roomtemp", $modGwId, $devName." Roomtemp", $adressmodRoomtemp, $temp, $modFcReadSetpoints, 0,5); $modRoomtemp = 20; //$this->ModbusPublish($devEui."Roomtemp", $modGwId, $devName." Roomtemp", $adressmodRoomtemp, $temp, $modFcReadSetpoints, 0,7);
$adressmodSafetymode = $this->ReadPropertyInteger("modSafetymode"); $adressmodSafetymode = $this->ReadPropertyInteger("modSafetymode");
$modSafetymode = $this->ModbusPublish($devEui."Safetymode", $modGwId, $devName." Safetymode", $adressmodSafetymode, $temp, $modFcReadSetpoints, 0,5); $modSafetymode = 1; //$this->ModbusPublish($devEui."Safetymode", $modGwId, $devName." Safetymode", $adressmodSafetymode, $temp, $modFcReadSetpoints, 0,7);
$adressmodSafetySetpoint = $this->ReadPropertyInteger("modSafetySetpoint"); $adressmodSafetySetpoint = $this->ReadPropertyInteger("modSafetySetpoint");
$modSafetySetpoint = $this->ModbusPublish($devEui."SafetySetpoint", $modGwId, $devName." SafetySetpoint", $adressmodSafetySetpoint, $temp, $modFcReadSetpoints, 0,5); $modSafetySetpoint = 22;//$this->ModbusPublish($devEui."SafetySetpoint", $modGwId, $devName." SafetySetpoint", $adressmodSafetySetpoint, $temp, $modFcReadSetpoints, 0,7);
$adressmodComIntervall = $this->ReadPropertyInteger("modComIntervall"); $adressmodComIntervall = $this->ReadPropertyInteger("modComIntervall");
$modComIntervall = $this->ModbusPublish($devEui."ComIntervall", $modGwId, $devName." ComIntervall", $adressmodComIntervall, $temp, $modFcReadSetpoints, 0,5); $modComIntervall = 10;//$this->ModbusPublish($devEui."ComIntervall", $modGwId, $devName." ComIntervall", $adressmodComIntervall, $temp, $modFcReadSetpoints, 0,7);
$adressmodRefRun = $this->ReadPropertyInteger("modRefRun"); $adressmodRefRun = $this->ReadPropertyInteger("modRefRun");
$modRefRun = $this->ModbusPublish($devEui."RefRun", $modGwId, $devName." RefRun", $adressmodRefRun, $temp, $modFcReadSetpoints, 0,5); $modRefRun = $this->ModbusPublish($devEui."RefRun", $modGwId, $devName." RefRun", $adressmodRefRun, $temp, $modFcReadSetpoints, 0,7);
$usermode = $modUsermode; $usermode = $modUsermode;
@@ -488,7 +504,7 @@ class LoraMlr003 extends IPSModule {
SetValueString($idFromHexOutput,$sendstring); SetValueString($idFromHexOutput,$sendstring);
$data = [ $data = [
"confirmed" => true, "confirmed" => true,
"fport" => 85, "fport" => 1,
"data" => $payload "data" => $payload
]; ];
@@ -677,12 +693,13 @@ class LoraMlr003 extends IPSModule {
$payload = true; $payload = true;
} }
RequestAction($var_id, $payload); RequestAction($var_id, $payload);
IPS_SemaphoreLeave($ident); IPS_SemaphoreLeave($ident);
return true;
return true;
}else{ }else{
IPS_SemaphoreLeave($ident); IPS_SemaphoreLeave($ident);
return GetValue($var_id); return GetValue($var_id);
} }
IPS_SemaphoreLeave($ident); // !!! IMPORTANT !!! IPS_SemaphoreLeave($ident); // !!! IMPORTANT !!!
+1
View File
@@ -80,6 +80,7 @@ class LoraNovos3T extends IPSModule {
return "Fehler: Ungültiges JSON."; return "Fehler: Ungültiges JSON.";
} }
$temp = $this->CheckGetArrayValue($data,"TEMP"); $temp = $this->CheckGetArrayValue($data,"TEMP");
if ($temp != "failure") { if ($temp != "failure") {
$adressmodAmbient_Temperature = $this->ReadPropertyInteger("modAmbient_Temperature"); $adressmodAmbient_Temperature = $this->ReadPropertyInteger("modAmbient_Temperature");
+2 -2
View File
@@ -7,7 +7,7 @@
"version": "6.0", "version": "6.0",
"date": 1491343200 "date": 1491343200
}, },
"version": "1.2", "version": "1.5",
"build": 1, "build": 2,
"date": 0 "date": 0
} }