updated change thresholds and added commands

This commit is contained in:
Nico Melone
2021-08-26 09:41:44 -05:00
parent c9f81a83d1
commit 3adf6d96b7
2 changed files with 44 additions and 3 deletions

View File

@@ -2,7 +2,7 @@ from Channel import PLCChannel, ModbusChannel
from tankalarms import PLC_IP_ADDRESS
tags = [
PLCChannel(PLC_IP_ADDRESS, "water_level","WaterTxLevel","REAL", 5, 3600, plc_type="Micro800"),
PLCChannel(PLC_IP_ADDRESS, "water_level","WaterTxLevel","REAL", 0.5, 3600, plc_type="Micro800"),
PLCChannel(PLC_IP_ADDRESS, "water_batt_volts","WaterTxBatVolts","REAL", 5, 3600, plc_type="Micro800"),
PLCChannel(PLC_IP_ADDRESS, "water_rssi","WaterTxRSSI","REAL", 5, 3600, plc_type="Micro800"),
PLCChannel(PLC_IP_ADDRESS, "water_hihi_spt","WaterTx_HHSP","REAL", 5, 3600, plc_type="Micro800"),
@@ -11,7 +11,7 @@ tags = [
PLCChannel(PLC_IP_ADDRESS, "water_hi_alm","WaterTx_HAlrm","BOOL", 0, 3600, plc_type="Micro800"),
PLCChannel(PLC_IP_ADDRESS, "water_batt_lolo_alm","WaterTxBatVolts_LLAlrm","BOOL", 0, 3600, plc_type="Micro800"),
PLCChannel(PLC_IP_ADDRESS, "water_comm_fail_alm","WaterTx_RF_CommFail","BOOL", 0, 3600, plc_type="Micro800"),
PLCChannel(PLC_IP_ADDRESS, "oil_level","OilTxLevel","REAL", 5, 3600, plc_type="Micro800"),
PLCChannel(PLC_IP_ADDRESS, "oil_level","OilTxLevel","REAL", 0.5, 3600, plc_type="Micro800"),
PLCChannel(PLC_IP_ADDRESS, "oil_batt_volts","OilTxBatVolts","REAL", 5, 3600, plc_type="Micro800"),
PLCChannel(PLC_IP_ADDRESS, "oil_rssi","OilTxRSSI","REAL", 5, 3600, plc_type="Micro800"),
PLCChannel(PLC_IP_ADDRESS, "oil_hihi_spt","OilTx_HHSP","REAL", 5, 3600, plc_type="Micro800"),

View File

@@ -77,7 +77,7 @@ class start(threading.Thread, deviceBase):
val = chan.read()
if chan.check(val, self.force_send):
self.sendtodbDev(1, chan.mesh_name, chan.value, 0, 'tankalarms')
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
# print("tankalarms driver still alive...")
if self.force_send:
@@ -151,3 +151,44 @@ class start(threading.Thread, deviceBase):
write_res = "Error writing to PLC..."
return write_res
return False
"""
def tankalarms_water_hihi_spt(self, name, value):
log.info("Value received is {}".format(value))
write_res = write_tag(str(PLC_IP_ADDRESS), "WaterTx_HHSP", 1, plc_type="Micro800")
log.info("Result of tankalarms_water_hihi_spt {}, {}, {}".format(name, value, write_res))
if write_res is None:
write_res = "Error writing to PLC..."
return write_res
def tankalarms_water_hi_spt(self, name, value):
log.info("Value received is {}".format(value))
if value == 1 or value == "1":
write_res = write_tag(str(PLC_IP_ADDRESS), "WaterTx_HSP", 1, plc_type="Micro800")
log.info("Result of tankalarms_water_hi_spt {}, {}, {}".format(name, value, write_res))
if write_res is None:
write_res = "Error writing to PLC..."
return write_res
return False
def tankalarms_oil_hihi_spt(self, name, value):
log.info("Value received is {}".format(value))
if value == 1 or value == "1":
write_res = write_tag(str(PLC_IP_ADDRESS), "OilTx_HHSP", 1, plc_type="Micro800")
log.info("Result of tankalarms_oil_hihi_spt {}, {}, {}".format(name, value, write_res))
if write_res is None:
write_res = "Error writing to PLC..."
return write_res
return False
def tankalarms_oil_hi_spt(self, name, value):
log.info("Value received is {}".format(value))
if value == 1 or value == "1":
write_res = write_tag(str(PLC_IP_ADDRESS), "OilTx_HSP", 1, plc_type="Micro800")
log.info("Result of tankalarms_oil_hi_spt {}, {}, {}".format(name, value, write_res))
if write_res is None:
write_res = "Error writing to PLC..."
return write_res
return False
"""