Hello all!
First, AHP 3.318, CM15.
I created 4 macros for controlling my HVAC fan and outside air intake damper.
Three of the macros are pretty much identical except for the time delay, and the fourth turns the fan off and closes the damper.
MACRO 1,2,3....
*************
P15 on (or P15 off or P16 on) TRIGGER
condition... IF flag 10 OFF
end IF
delay 1 sec. (needed as per bug)
A16 on HVAC fan ON and damper OPEN
SET flag 10 so multiple macros will not run resulting in multiple OFF's being sent
DELAY 1 hour (macro 2 is delay 2 hours, macro 3 is delay 4 hours)
A16 OFF HVAC fan OFF and damper CLOSE
CLEAR flag 10 enables macros to run
***************
**********
MACRO 4
P16 OFF trigger (manually turns off fan and closes damper)
CLEAR flag 10 (enables macros to run again)
A16 OFF HVAC fan OFF and damper CLOSE
**********
The problem I have stumbled on is:
1) IF I run MACRO 1 or 2 or 3, flag 10 gets set.... ok
2) Try to run MACRO 1,2,3 during the 1,2,4 hour delay, another A16 ON does NOT get sent because flag 10 is still set and the conditions fail..... ok
3) Run macro 4 (resets flag 10)... ok
4) Run MACRO 1,2,3 again.... ok... BUT FLAG 10 DOESN'T SET! it is still cleared and I can run the macros again!!!
It seems the only way the flag will set again is after the 1,2,4 hour delay has timed out, and macro 1 or 2 or 3 clears the flag, NOT macro 4 (that is supposed to clear the flag as well).
Another clue might be that if I use Tools/Purge macro delayed events, then flag 10 will set like it should THE FIRST TIME THE MACRO(s) ARE RUN, but ONLY the first time!
This could/would be a possible problem that others are having using flags, and wondering why the flag doesn't work as expected.