It's rare that an Apex question stumps me. I had to put some thought into this one, and I think I have a solution for you. It will require creating 2 virtual outputs; one will act as a 2 minute timer, and the other will perform a logical AND condition to see if the skimmer is on but the 2 minutes has not yet elapsed. The ATO will then use the status of that 2nd virtual output to know when to disable the ATO:
[Skimmer_Start] — virtual output
Set OFF
If Output Skimmer = ON Then ON
Defer 002:00 Then ON
[ATO_Delay] — virtual output
Set OFF
If Output Skimmer = ON Then ON
If Output Skimmer_Start = OFF Then OFF
[ATO] (put this command at the bottom of your current ATO program)
If Output ATO_Delay = ON Then OFF
Just change the name "Skimmer" to the actual name of your skimmer's output.
Here are the various states of each output depending on the skimmer's state:
| Output | State | t = 0:00 | t = 2:00 |
| Skimmer | OFF | ON | ON |
| Skimmer_Start | OFF | OFF | ON |
| ATO_Delay | OFF | ON | OFF |
| ATO | ON | OFF | ON |
If you're not familiar with virtual outputs, see my tutorial:
https://www.reef2reef.com/ams/neptune-apex-programming-tutorials-part-5-virtual-outputs.703/