Humidity monitor email

siafu

Active Member
Hello,
 
I'm trying to have the board send me one email when the humidity is above certain %, then send another email when it is below a certain %
 
Below is the complete code, Marked in RED, All other code is working fine.
 
The Email for Humidity, are not working.
 
Can someone please help me with this? Thank you in advance.
 
This board Version: v03.01.03
 
START    
    TSTLT AIP1 4  
    SET OP1 1  
    TSTGT AIP1 8  
    SET OP1 0  
    TSTLT T3 1130  
    SET OP2 1  
    TSTGT T3 1210  
    SET OP2 0  
    XOR OP1 VAR1  
    BZ  TEMPTEST  
    TSTEQ OP1 1  
    EMAIL 1   
    TSTEQ OP1 0  
    EMAIL 2   
    TSTGT H1 27  
    EMAIL 5   
    TSTLT H1 20  
    EMAIL 6   

TEMPTEST:
    XOR OP2 VAR2  
    BZ  DONE  
    TSTEQ OP2 1  
    EMAIL 3   
    TSTEQ OP2 0  
    EMAIL 4   
DONE:
    SET VAR1 OP1  
    SET VAR2 OP2  
    END 
 
siafu,
 
You will need to set a flag for email sent, so that it is no longer sending email for about certain humidity level.  Then you need to set another flag for below certain level. Having those two functions interlocked, so that only after sending high level email notice, it will unlock sending email for low humidity.  Similarly, only when sending low humidity level email notice you will reset the high humidity level notice flag.
 
here is a basic email setup,i took me a long time to get it but once you do it will be easy
 
 
Start  
   set var1 0
 
loop:
    callsub reset
    tsteq op8 1
    callsub email
    goto loop
    end
 
reset:
     tsteq op8 0
     set var1 0
     ret
 
email:
     tsteq var1 0
     email em1
     delay 100
     set var1 1
     ret
 
thank you for taking the time pittom, however, I have other logit that uses those emails, here is the entire logit. the text marked in RED is the logit I'm trying to incorporate.
 
START    
    TSTLT AIP1 4  
    SET OP1 1  
    TSTGT AIP1 8  
    SET OP1 0  
    TSTLT T3 1130  
    SET OP2 1  
    TSTGT T3 1210  
    SET OP2 0  
    XOR OP1 VAR1  
    BZ  TEMPTEST  
    TSTEQ OP1 1  
    EMAIL 1   
    TSTEQ OP1 0  
    EMAIL 2   
    TSTGT H1 27  
    EMAIL 5   
    TSTLT H1 20  
    EMAIL 6   

TEMPTEST:
    XOR OP2 VAR2  
    BZ  DONE  
    TSTEQ OP2 1  
    EMAIL 3   
    TSTEQ OP2 0  
    EMAIL 4   
DONE:
    SET VAR1 OP1  
    SET VAR2 OP2  
    END 
 
sorry to sound like a broken record but what you posted dones not show  me anything anything to fix,but maby try changing
 
tsteq h1 27
email 5
tsteq h1 20
email 6
 
 
   TSTGT H1 27  
    EMAIL 5   
    TSTLT H1 20  
    EMAIL 6   
 
Hi pittom, no appologies needed, I appriciate that time you are taking trying to help me with this.
 
OK, I'll change the logit to what you have suggested and give it ago.
 
Thanks again.
 
I have old hottub that is out side in pa and use all winter and this is how i keep track of it.
 
email is sent as text to phone so i get it right a way
 
Code:
START    
	SET RAM1 10  
	SET RAM2 0  
	SET RAM3 0  
	SET op4 0  
	SET VAR5 0  
	SET RAM5 0  
	SET VAR6 0  
	SET VAR7 0  
	SET VAR8 0  
LOOP:
	CALLSUB RESETRAMS   
	DELAY 2000   
	TSTEQ OP5 1  
	CALLSUB OVERIDE   
	TSTEQ OP2 1  
	CALLSUB PH_OFF   
	SET OP3 VAR5  
	TSTEQ CT 23:11:11  
	CALLSUB BEDTIME   
	TSTLT VAR1 1000  
	SET VAR1 1000  
	TSTGT VAR1 1041  
	SET VAR1 1040  
	SUB VAR1 RAM1 VAR2 
	DELAY 2000   
	TSTGT T3 950  
	CALLSUB SEND_EM7   
	DELAY 1000   
	TSTLT T3 350  
	CALLSUB SEND_EM3   
	DELAY 1000   
	TSTGT T5 1055  
	CALLSUB SEND_EM1   
	DELAY 1000   
	TSTLT T5 700  
	CALLSUB SEND_EM5   
	DELAY 1000   
	TSTGT T2 1000  
	CALLSUB SEND_EM6   
	DELAY 1000   
	TSTLT T2 350  
	CALLSUB SEND_EM2   
	DELAY 1000   
	TSTGE T5 VAR1  
	CALLSUB SEND_EM8   
	DELAY 1000   
	TSTEQ OP1 1  
	CALLSUB MANUAL_ON   
	TSTLT T5 900  
	CALLSUB HEAT_ON   
	TSTGT T5 1000  
	CALLSUB HEAT_OFF   
	SET VAR5 0  
	GOTO LOOP   
	END    

RESETRAMS:
	TSTLT T5 1000  
	SET op4 0  
	TSTGT T2 400  
	SET RAM2 0  
	TSTGT T3 400  
	SET RAM3 0  
	TSTGT T5 730  
	SET RAM5 0  
	TSTLT T2 950  
	SET VAR6 0  
	TSTLT T3 900  
	SET VAR7 0  
	TSTLT T5 1045  
	SET VAR8 0  
	DELAY 2000   
	RET    

SEND_EM1:
	TSTEQ VAR8 0  
	EMAIL EM1   
	DELAY 2000   
	SET VAR8 1  
	SET VAR5 1  
	DELAY 2000   
	CALLSUB PH_OFF   
	RET    

SEND_EM2:
	TSTEQ RAM2 0  
	EMAIL EM2   
	DELAY 2000   
	SET RAM2 1  
	DELAY 2000   
	RET    

SEND_EM3:
	TSTEQ RAM3 0  
	EMAIL EM3   
	DELAY 2000   
	SET RAM3 1  
	DELAY 2000   
	RET    

SEND_EM5:
	TSTEQ RAM5 0  
	EMAIL EM5   
	DELAY 2000   
	SET RAM5 1  
	SET VAR5 1  
	DELAY 2000   
	CALLSUB PH_OFF   
	RET    

SEND_EM6:
	TSTEQ VAR6 0  
	EMAIL EM6   
	DELAY 2000   
	SET VAR6 1  
	SET VAR5 1  
	DELAY 2000   
	CALLSUB PH_OFF   
	RET    

SEND_EM7:
	TSTEQ VAR7 0  
	EMAIL EM7   
	DELAY 2000   
	SET VAR7 1  
	SET VAR5 1  
	DELAY 2000   
	CALLSUB PH_OFF   
	RET    

SEND_EM8:
	TSTEQ op4 0  
	EMAIL EM8   
	DELAY 2000   
	SET op4 1  
	DELAY 2000   
	RET    

BEDTIME:
	SET OP1 0  
	RET    

OVERIDE:  
	GOTO LOOP   
	RET    

MANUAL_ON:
	SET OP7 1  
	TSTLT T5 VAR2  
	SET OP8 1  
	TSTGE T5 VAR1  
	SET OP8 0  
	GOTO LOOP   
	RET    

HEAT_ON:
	SET OP7 1  
	SET OP8 1  
	RET    

HEAT_OFF:
	SET OP8 0  
	DELAY 10000   
	SET OP7 0  
	RET    

PH_OFF:
	SET OP1 0  
	SET OP8 0  
	SET OP7 0  
	SET var5 1  
	GOTO LOOP   
	RET
 
Back
Top