Compare commits
10
Commits
dc1b5a13f1
..
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
28605b231a | ||
|
|
59ac7efdba | ||
|
|
b69958b2d7 | ||
|
|
7f88ce0009 | ||
|
|
03f74cac69 | ||
|
|
417b3a728d | ||
|
|
9cb39c194c | ||
|
|
e1ac7c9077 | ||
|
|
27a0bee822 | ||
|
|
873f390f00 |
@@ -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":
|
||||||
[
|
[
|
||||||
|
|||||||
+29
-12
@@ -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);
|
||||||
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
@@ -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
|
||||||
];
|
];
|
||||||
|
|
||||||
@@ -679,6 +695,7 @@ class LoraMlr003 extends IPSModule {
|
|||||||
|
|
||||||
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);
|
||||||
|
|||||||
@@ -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
@@ -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
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user