Changed to percent fbk
This commit is contained in:
@@ -3,9 +3,9 @@ from dualactuator import PLC_IP_ADDRESS
|
|||||||
|
|
||||||
tags = [
|
tags = [
|
||||||
PLCChannel(PLC_IP_ADDRESS, "open_cmd","Open_Cmd","BOOL", 1, 3600, plc_type="Micro800"),
|
PLCChannel(PLC_IP_ADDRESS, "open_cmd","Open_Cmd","BOOL", 1, 3600, plc_type="Micro800"),
|
||||||
PLCChannel(PLC_IP_ADDRESS, "v1_open_fbk","V1_Open_FBK","BOOL", 1, 3600, plc_type="Micro800", map_={0: "Closed", 1: "Open"}),
|
PLCChannel(PLC_IP_ADDRESS, "v1_open_fbk","Val_V1_POS_FBK","REAL", 0.2, 600, plc_type="Micro800"),
|
||||||
PLCChannel(PLC_IP_ADDRESS, "v1_closed_fbk","V1_Closed_FBK","BOOL", 1, 3600, plc_type="Micro800"),
|
PLCChannel(PLC_IP_ADDRESS, "v1_closed_fbk","V1_Closed_FBK","BOOL", 1, 3600, plc_type="Micro800"),
|
||||||
PLCChannel(PLC_IP_ADDRESS, "v2_open_fbk","V2_Open_FBK","BOOL", 1, 3600, plc_type="Micro800", map_={0: "Closed", 1: "Open"}),
|
PLCChannel(PLC_IP_ADDRESS, "v2_open_fbk","Val_V2_POS_FBK","REAL", 0.2, 600, plc_type="Micro800"),
|
||||||
PLCChannel(PLC_IP_ADDRESS, "v2_closed_fbk","V2_Closed_FBK","BOOL", 1, 3600, plc_type="Micro800"),
|
PLCChannel(PLC_IP_ADDRESS, "v2_closed_fbk","V2_Closed_FBK","BOOL", 1, 3600, plc_type="Micro800"),
|
||||||
PLCChannel(PLC_IP_ADDRESS, "sep_valve_cmd","sep_valve_cmd","BOOL", 1, 3600, plc_type="Micro800"),
|
PLCChannel(PLC_IP_ADDRESS, "sep_valve_cmd","sep_valve_cmd","BOOL", 1, 3600, plc_type="Micro800"),
|
||||||
PLCChannel(PLC_IP_ADDRESS, "v1_open_cmd","V1_Open_Cmd","BOOL", 1, 3600, plc_type="Micro800"),
|
PLCChannel(PLC_IP_ADDRESS, "v1_open_cmd","V1_Open_Cmd","BOOL", 1, 3600, plc_type="Micro800"),
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
"file4": "Tags.py"
|
"file4": "Tags.py"
|
||||||
},
|
},
|
||||||
"deviceName": "dualactuator",
|
"deviceName": "dualactuator",
|
||||||
"releaseVersion": "4",
|
"releaseVersion": "5",
|
||||||
"driverFileName": "dualactuator.py",
|
"driverFileName": "dualactuator.py",
|
||||||
"driverId": "0100"
|
"driverId": "0100"
|
||||||
}
|
}
|
||||||
@@ -40,7 +40,7 @@ class start(threading.Thread, deviceBase):
|
|||||||
mqtt=mqtt, Nodes=Nodes)
|
mqtt=mqtt, Nodes=Nodes)
|
||||||
|
|
||||||
self.daemon = True
|
self.daemon = True
|
||||||
self.version = "4"
|
self.version = "5"
|
||||||
self.finished = threading.Event()
|
self.finished = threading.Event()
|
||||||
self.force_send = False
|
self.force_send = False
|
||||||
self.public_ip_address = ""
|
self.public_ip_address = ""
|
||||||
@@ -75,6 +75,9 @@ class start(threading.Thread, deviceBase):
|
|||||||
for chan in CHANNELS:
|
for chan in CHANNELS:
|
||||||
val = chan.read()
|
val = chan.read()
|
||||||
if chan.check(val, self.force_send):
|
if chan.check(val, self.force_send):
|
||||||
|
if chan.mesh_name in ["v1_open_fbk","v2_open_fbk"]:
|
||||||
|
self.sendtodbDev(1, chan.mesh_name, str(round(chan.value,2)) + '%', 0, 'dualactuator')
|
||||||
|
else:
|
||||||
self.sendtodbDev(1, chan.mesh_name, chan.value, 0, 'dualactuator')
|
self.sendtodbDev(1, chan.mesh_name, chan.value, 0, 'dualactuator')
|
||||||
#time.sleep(TAG_DATAERROR_SLEEPTIME) # sleep to allow Micro800 to handle ENET requests
|
#time.sleep(TAG_DATAERROR_SLEEPTIME) # sleep to allow Micro800 to handle ENET requests
|
||||||
|
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ class start(threading.Thread, deviceBase):
|
|||||||
mqtt=mqtt, Nodes=Nodes)
|
mqtt=mqtt, Nodes=Nodes)
|
||||||
|
|
||||||
self.daemon = True
|
self.daemon = True
|
||||||
self.version = "23"
|
self.version = "24"
|
||||||
self.finished = threading.Event()
|
self.finished = threading.Event()
|
||||||
self.force_send = False
|
self.force_send = False
|
||||||
self.public_ip_address = ""
|
self.public_ip_address = ""
|
||||||
@@ -152,6 +152,13 @@ class start(threading.Thread, deviceBase):
|
|||||||
self.sendtodbDev(1, chan.mesh_name, chan.value, 0, 'PiFlow')
|
self.sendtodbDev(1, chan.mesh_name, chan.value, 0, 'PiFlow')
|
||||||
self.sendtodbDev(1,"today_"+chan.mesh_name, today_total,0,'PiFlow')
|
self.sendtodbDev(1,"today_"+chan.mesh_name, today_total,0,'PiFlow')
|
||||||
self.sendtodbDev(1,"yesterday_"+chan.mesh_name, yesterday_total,0,'PiFlow')
|
self.sendtodbDev(1,"yesterday_"+chan.mesh_name, yesterday_total,0,'PiFlow')
|
||||||
|
elif chan.mesh_name == "volume_flow" and not PERSIST['drive_enabled']:
|
||||||
|
if chan.check(val, self.force_send):
|
||||||
|
self.sendtodbDev(1, chan.mesh_name, chan.value, 0, 'PiFlow')
|
||||||
|
if chan.value > 0:
|
||||||
|
self.sendtodbDev(1, "run_status", "Running", 0, 'PiFlow')
|
||||||
|
else:
|
||||||
|
self.sendtodbDev(1,"run_status", "Stopped", 0, 'PiFlow')
|
||||||
else:
|
else:
|
||||||
if chan.check(val, self.force_send):
|
if chan.check(val, self.force_send):
|
||||||
self.sendtodbDev(1, chan.mesh_name, chan.value, 0, 'PiFlow')
|
self.sendtodbDev(1, chan.mesh_name, chan.value, 0, 'PiFlow')
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
"driverFileName":"PiFlow.py",
|
"driverFileName":"PiFlow.py",
|
||||||
"deviceName":"piflow",
|
"deviceName":"piflow",
|
||||||
"driverId":"0280",
|
"driverId":"0280",
|
||||||
"releaseVersion":"23",
|
"releaseVersion":"24",
|
||||||
"files": {
|
"files": {
|
||||||
"file1":"PiFlow.py",
|
"file1":"PiFlow.py",
|
||||||
"file2":"Channel.py",
|
"file2":"Channel.py",
|
||||||
|
|||||||
Reference in New Issue
Block a user