def automationcheck(refsensor): logger.info('Starting Automation Evaluation, Sensor: %s' , refsensor) # iterate among the actuators elementlist= automationdbmod.getelementlist() for element in elementlist: automationexecute(refsensor,element) return
def automationcheck(refsensor): logger.info('Starting Automation Evaluation, Sensor: %s', refsensor) # iterate among the actuators elementlist = automationdbmod.getelementlist() for element in elementlist: automationexecute(refsensor, element) return
def cycleresetall(): global AUTO_data elementlist = automationdbmod.getelementlist() for element in elementlist: waitingtime = hardwaremod.toint( automationdbmod.searchdata("element", element, "pausebetweenwtstepsmin"), 0) AUTO_data[element] = { "lastactiontime": datetime.now() - timedelta(minutes=waitingtime), "status": "ok", "actionvalue": 0, "alertcounter": 0, "infocounter": 0 }
import logging from datetime import datetime, time, timedelta import hardwaremod import os import subprocess import emailmod import automationdbmod import sensordbmod import actuatordbmod import autofertilizermod import statusdataDBmod logger = logging.getLogger("hydrosys4." + __name__) # status array, required to check the ongoing actions elementlist = automationdbmod.getelementlist() AUTO_data = {} # dictionary of dictionary AUTO_data["default"] = { "lastactiontime": datetime.utcnow(), "actionvalue": 0, "alertcounter": 0, "infocounter": 0, "status": "ok" } def cyclereset(element): global AUTO_data waitingtime = hardwaremod.toint( automationdbmod.searchdata("element", element, "pausebetweenwtstepsmin"), 0)
def cycleresetall(): elementlist= automationdbmod.getelementlist() for element in elementlist: waitingtime=hardwaremod.toint(automationdbmod.searchdata("element",element,"pausebetweenwtstepsmin"),0) #print("Cycle reset all ------------------------------------_>", waitingtime , " ", element) cyclereset(element)
def cycleresetall(): global AUTO_data elementlist= automationdbmod.getelementlist() for element in elementlist: waitingtime=hardwaremod.toint(automationdbmod.searchdata("element",element,"pausebetweenwtstepsmin"),0) AUTO_data[element]={"lastactiontime":datetime.now() - timedelta(minutes=waitingtime),"status":"ok","actionvalue":0, "alertcounter":0, "infocounter":0}
import hardwaremod import os import subprocess import emailmod import automationdbmod import sensordbmod import actuatordbmod import autofertilizermod import statusdataDBmod logger = logging.getLogger("hydrosys4."+__name__) # status array, required to check the ongoing actions elementlist= automationdbmod.getelementlist() AUTO_data={} # dictionary of dictionary AUTO_data["default"]={"lastactiontime":datetime.now(),"actionvalue":0, "alertcounter":0, "infocounter":0, "status":"ok"} def cyclereset(element): global AUTO_data waitingtime=hardwaremod.toint(automationdbmod.searchdata("element",element,"pausebetweenwtstepsmin"),0) AUTO_data[element]={"lastactiontime":datetime.now() - timedelta(minutes=waitingtime),"status":"ok","actionvalue":0, "alertcounter":0, "infocounter":0} def cycleresetall(): global AUTO_data elementlist= automationdbmod.getelementlist() for element in elementlist: waitingtime=hardwaremod.toint(automationdbmod.searchdata("element",element,"pausebetweenwtstepsmin"),0)