spa temperature email help

I don't see how that email being sent because you have two goto loop in the main routine:
START
set ram1 0
set ram2 0
loop:
callsub resetrams
delay 1000
tstle t3 800
callsub send_em1
delay 1000
goto loop            <<----   first goto loop
tstge t5 1050
callsub send_em2
delay 1000
goto loop             <<-----second goto loop
 
Is that possible you thought em1 was actually em2?  To avoid confusion, during debugging, put EM1, EM2, etc to the either subject line or begingin of the email body.
 
 
In this section of code. you have

tstle t3 800
callsub send_em1
 
which is when T3 is less than 80.0 degree you will send email. I thought you want to tstgt t3 800
 
Also in your

resetrams:
tstle t3 790
set ram1 0
tstle t5 1048
set ram2 0
ret
 
You reset the t5 at 104.8 degree, that is very close to 105 degree.  You may consider to have bigger range than just 0.2 degree.
But I don't see how did your get EM2 to send, since your first "goto loop" already jumpped to the begining of the code.
 
Without knowing the details about what does what, this is what I would have started with...
START
        loop:
        callsub resetrams
        delay 1000
        tstlt t3 800
        callsub send_em1
        delay 1000
        tstgt t5 1050
        callsub send_em2
        delay 1000
    TSTEQ OP1 1  
    CALLSUB MANUAL_ON
        tstgt t5 1050  
    CALLSUB PH_OFF   
    TSTLT T5 1000  
    CALLSUB HEAT_ON   
    TSTGT T5 1040  
    CALLSUB HEAT_OFF
      goto loop  
    END
 
resetrams:
        tstgt t3 790
        set ram1 0
        tstgt t5 1048
        set ram2 0
        ret
send_em1:
        tsteq ram1 0
        email em1
        set ram1 1
        delay 2000
        ret
send_em2:
        tsteq ram2 0
        email em2
        set ram2 1
        delay 2000
        ret
 
MANUAL_ON:
    SET OP7 1  
    TSTLT T5 1035  
    SET OP8 1  
    TSTGT T5 1040  
    SET OP8 0     
    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 OP7 0  
    SET OP8 0  
        email em1
    RET

 
I do agree with CAI_Support and use a greater tolerance to prevent flapping.  Using "TSTLT" AND "TSTGT" gives you a little more room for temp bouncing.  I would use more like 2 or 3 degrees before sending emails or turning off/on heat.  Open the door to the spa and you loose at least 3 degrees in about 2 seconds.  I could be wrong, I don't know, just guessing.
 
I think this line need to be changed:
 
START
loop:
callsub resetrams
delay 1000
tstlt t3 800   <<-- this is less than 80 degree, do you really want to do "tstgt t3 800" instead?

 
 
T3 is temp sensor right on pipe where heater is 
T5 is in water
 
so if T3 "pipe" gets to hot maybe water pump stopped and heater stayed on so email me, now i know there is a problem
 
Dedicated Cocooner
 
I tried your code but same thing happens      
                        
                             when T3 temp goes above i get email but as long as it is above set temp email does not stop coming 
    
   set ram1 0
        set ram2 0
        loop:
        callsub resetrams
        delay 1000
        tstgt t3 800                  ~~~~I changed "tstle" to "tstgt" 
        callsub send_em1
        delay 1000
 
got it working thanks everyone,  here is the code
 
 
 
START    
    SET RAM1 0  
    SET RAM2 0  
LOOP:
    CALLSUB RESETRAMS   
    DELAY 1000   
    TSTGT T3 800  
    CALLSUB SEND_EM1   
    DELAY 1000   
    TSTGT T5 1050  
    CALLSUB SEND_EM2   
    DELAY 1000   
    TSTEQ OP1 1  
    CALLSUB MANUAL_ON   
    TSTGT T5 1050  
    CALLSUB PH_OFF   
    TSTLT T5 1000  
    CALLSUB HEAT_ON   
    TSTGT T5 1040  
    CALLSUB HEAT_OFF   
    GOTO LOOP   
    END    
 
RESETRAMS:
    TSTLT T3 790  
    SET RAM1 0  
    TSTLT T5 1040  
    SET RAM2 0  
    RET    
 
SEND_EM1:
    TSTEQ RAM1 0  
    EMAIL EM1   
    SET RAM1 1  
    DELAY 2000   
    RET    
 
SEND_EM2:
    TSTEQ RAM2 0  
    EMAIL EM2   
    SET RAM2 1  
    DELAY 2000   
    RET    
 
MANUAL_ON:
    SET OP7 1  
    TSTLT T5 1035  
    SET OP8 1  
    TSTGT T5 1040  
    SET OP8 0  
    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 OP7 0  
    SET OP8 0  
    RET 
 
Someone asked me if i could explain how my code worked,here is what i did     what do you think
 
I added var1 so i can put water temp i want in there100 to 104
 
 
START    
    SET RAM1 0  --sets all rams incase power wentout 
    SET RAM2 0  -- "
    SET RAM3 10 -- "(see note 2)
LOOP:
    CALLSUB RESETRAMS  --check befor continues
    DELAY 1000 ----------gives it time to check
    SUB VAR1 RAM3 VAR3 --var1(i set water temp from phone)sudtract ram3 put results in var3(1040-10=1030)same as104-1=103
    DELAY 2000  ---------give it time to do 
    TSTGT T3 800 --------check if t3(pipe temp)is greater then 800(80f)
    CALLSUB SEND_EM1 ----if it is go to here 
    DELAY 1000 ----------give it time to do
    TSTGT T5 1050 -------check if t5(water temp)is greater then 1050(105f)
    CALLSUB SEND_EM2 ----if it is go to here  
    DELAY 1000 ----------give it time to do
    TSTEQ OP1 1  --------check if op1(manual switch)is on
    CALLSUB MANUAL_ON  --if so go to here 
    TSTGT T5 1050  ------check if t5(water temp)is greater then 1050(105f)
    CALLSUB PH_OFF --- --if so go to here 
    TSTLT T5 950  -------check if t5(water temp)is less then 950(95f)
    CALLSUB HEAT_ON -----if so go to here 
    TSTGT T5 VAR1  ------check if t5(water temp)is greater then var1(the temp you set from phone)
    CALLSUB HEAT_OFF ----if so go to here  
    GOTO LOOP  ----------go back to top(not start but where loop: is) 
    END    
 
RESETRAMS:
    TSTLT T3 790 --------check if t3(pipe temp)is less then 790(79f)  
    SET RAM1 0  ---------if so set ram1 to 0
    TSTLT T5 1040 -------check if t5(water temp)is less then 1040(104f) 
    SET RAM2 0  ---------if so set ram2 to 0
    RET    
 
SEND_EM1:
    TSTEQ RAM1 0 --------check if ram1 is 0
    EMAIL EM1 -----------if ram1 is true email em1
    SET RAM1 1-----------set ram1 to 1(see note 1)  
    DELAY 2000 ----------give it time to do  
    RET    
 
SEND_EM2:
    TSTEQ RAM2 0 --------check if ram2 is 0 
    EMAIL EM2  ----------if ram2 is true email em2 
    SET RAM2 1 ----------set ram2 to 1
    DELAY 2000 ----------give it time to do    
    RET    
 
MANUAL_ON:
    SET OP7 1 -----------turn op7(pump) on 
    TSTLT T5 VAR3 -------check if t5(water temp) is less then var3(103) (104-10=103) 
    SET OP8 1  ----------is so turn op8(heater) on
    TSTGE T5 VAR1 -------check if t5(water temp)is greater then var1(104) 
    SET OP8 0  ----------if so turn op8(heater)off
    GOTO LOOP -----------go back to top(not start but where loop: is)  
    RET    
 
HEAT_ON:
    SET OP7 1 -----------turn op7(pump)on 
    SET OP8 1 -----------turn op8(heater)on 
    RET    
 
HEAT_OFF:
    SET OP8 0 -----------turn op8(heater)off 
    DELAY 10000----------give it time to do(let pump run to cool down heater )   
    SET OP7 0 -----------turn op7(pump)off 
    RET    
 
PH_OFF:
    SET OP1 0 -----------turn op1(manual switch)off 
    SET OP8 0 -----------turn op8(heater)off
    SET OP7 0 -----------turn op7(pump)off 
    RET
 
 
                         note 1
 all rams (ram 1,ram2,ram3)you can not see, in this case ram1 was 0 so a email was sent, then we set ram1 to 1 so when it
 goes back to loop(run program again)and t3(pipe temp) is still greater then 80f it will see ram1 is 1 so no eamil
 will be sent.Not untill t3(pipe temp)gets below 79f,then ram1 will be reset to 0 and ready to send email if t3(pipe temp)
 goes above 80f again 
the same goes for ram2
 
                note2
ram3 is set to 10 which if 1degree, so var1 the temp you put in will sub from ram3 and put that number in var3 so when 
you put op7 manual on it will only let t5 water temp drop 1degree from what you set var1 the water temp to   
 
Back
Top