Just a bit of advice from someone who just had a minor flood with solenoid programming. I use this routine to fill my ATO reservoir with a solenoid when it hits the bottom and my optical sensor didn't close the very first time this routine triggered so it kept filling until it ran over my floor.
I added the "when on>" statement to make sure it doesn't keep running indefinitely if the sensor fails like mine did. Thankfully it was a cement basement floor with a drain and simply an ATO reservoir and not my tank! I also added a float valve so I'm doubly protected - fool me once, shame on me....
I would also suggest a defer command or two to make sure it's not going on and off every 2 seconds. Mine waits 10 seconds to make sure the sensor is solidly open before initiating, then it runs for 50 minutes as that's how long it takes to fill my reservoir. If you're using this to top your tank, I'd also set a min time off for 30 or 60 minutes or something like that so it's not constantly opening and closing every few seconds and wearing out your solenoid.
Fallback OFF
Set OFF
If RsvLow CLOSED Then OFF
If RsvLow OPEN Then ON
Defer 000:10 Then ON
Defer 050:00 Then OFF
When On > 060:00 Then OFF
This is what I use to top my tank:
Fallback OFF
Set OFF
If SumpLo OPEN Then ON
If SumpHi CLOSED Then OFF
If Output SumpMaint = ON Then OFF
If RsvLow OPEN Then OFF
When On > 003:00 Then OFF
Defer 000:10 Then ON
Defer 000:04 Then OFF
Min Time 030:00 Then OFF