This is what you need to do.
First, lower your optical sensors so that only one is covered and verify that it shows CLOSED in the dashboard (be patient, it may take up to 1 min to see the value change). Then submerge the other one and see it change to CLOSED. If this fails for any reason, go through the setup task, check your connections. If successful, change the names to something meaningful no more than 6 characters such as ATOlow and ATOhig
Next, enter this code to verify initial function.
Fallback OFF
Set OFF
If ATOlow OPEN Then ON
If ATOhig CLOSED Then OFF
Move the ATO so that the low sensor is just barely out of the water. Once you see the pump kick on, time how long it takes to turn back off. Note this time for a later step.
Position your ATO where you want the final water level to be with the low sensor covered to the tip of the pyramid.
Allow the water level to fill enough to reach this point.
Remember the value you times earlier. This is where your first set of failsafes comes in. Take the larger of either 4 times that earlier time or 2 minutes. This will go in the When Statement below (example shows 2 minutes)
Fallback OFF
Set OFF
If ATOlow OPEN Then ON
If ATOhig CLOSED Then OFF
Defer 000:30 Then ON
Defer 000:10 Then OFF
Min Time 060:00 Then OFF
When ON > 002:00 Then OFF
Add this line to your email alert to notify you if it runs longer than your maximum run time. Reset by making sure the ATO is functioning normally and then set back to AUTO.
If Error ATOoutletname Then ON
For additional failsafes and more background information, check out my guide here (note Neptune created the When Statement to make the manually resetting latch part of my guide easier when they released the ATK. That part is superceded by the When statement)
This Thread explains the different fail-safes that can be used in an automatic top off (ATO) code that can improve reliability and prevent catastrophic failure. It is important to use protective code in order to prevent the ATO pump from sticking in the ON position when a float switch fails...
forum.neptunesystems.com