This video discusses how to mount a switch in your catchment riser to detect when there is water in your pond.
The above video starts by assuming that you have a switch mounted in a protective housing. If you need to build this, the following video provides some suggested guidance.
To automate the drain valve you attach an actuator to the valve that is located at the end of your catchment plumbing. These actuators have to be aligned to the valve to properly position it for both the open and closed position. This requires setting some keys on a cam shaft in the actuator. If you have not done this it can be a bit tricky. This video helps walk you through the process.
When you're done with the alignment, the handle should always be either perpendicular to the catchment plumbing or parallel to it after the cycle has completed.