Hello all,
Below is the logic cript I have to run lights on and off and send email alerts to me when lights come on and when lights go off. This has been working great for some time.
What I wanted to add is email notification from Temperature sensor 3. Basically would like an email sent when temp sensor 3 goes below a certain temperature.
I tried adding the same setup as for the lights, but I get continuous email one after the other when temp reaches the setting I've entered.
Any idea why this does not work for the temp sensor?
START
TSTLT AIP1 4
CALLSUB LIGHT_ON
TSTGT AIP1 8
CALLSUB LIGHT_OFF
TSTEQ OP1 1
CALLSUB MAILON
TSTEQ OP1 0
CALLSUB MAILOFF
END
LIGHT_ON:
SET OP1 1
RET
LIGHT_OFF:
SET OP1 0
RET
MAILON:
SET VAR2 0
TSTEQ VAR1 0
GOTO MAILON1
RET
MAILON1:
EMAIL 1
SET VAR1 1
RET
MAILOFF:
SET VAR1 0
TSTEQ VAR2 0
GOTO MAILOFF1
RET
MAILOFF1:
EMAIL 2
SET VAR2 1
RET
Below is the logic cript I have to run lights on and off and send email alerts to me when lights come on and when lights go off. This has been working great for some time.
What I wanted to add is email notification from Temperature sensor 3. Basically would like an email sent when temp sensor 3 goes below a certain temperature.
I tried adding the same setup as for the lights, but I get continuous email one after the other when temp reaches the setting I've entered.
Any idea why this does not work for the temp sensor?
START
TSTLT AIP1 4
CALLSUB LIGHT_ON
TSTGT AIP1 8
CALLSUB LIGHT_OFF
TSTEQ OP1 1
CALLSUB MAILON
TSTEQ OP1 0
CALLSUB MAILOFF
END
LIGHT_ON:
SET OP1 1
RET
LIGHT_OFF:
SET OP1 0
RET
MAILON:
SET VAR2 0
TSTEQ VAR1 0
GOTO MAILON1
RET
MAILON1:
EMAIL 1
SET VAR1 1
RET
MAILOFF:
SET VAR1 0
TSTEQ VAR2 0
GOTO MAILOFF1
RET
MAILOFF1:
EMAIL 2
SET VAR2 1
RET