Exemple #1
0
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	
Exemple #2
0
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
        }
Exemple #4
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)
Exemple #6
0
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}
Exemple #7
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)