Aquarium controller with a debounce on the temperature sensor

Rule 1: Do NOT use delay(...) or you will lose the ability to check on other things while the delay is timing out.

Rule 2:
Each time through the loop() function, check the state of the float.
If the float is normal, reset a timer variable (declared as unsigned long) to the current time given by the millis() function, else determine whether a sufficient interval (declared const unsigned long) has passed (greater than or equal to).
If sufficient time has passed, activate the pump, else shut the pump off. (Shutting the pump off if the pump is already off should be harmless.)

This scheme only activates the pump if the float is NOT in the normal state for a sufficient interval of time. If the float goes into the normal state during the interval, the interval starts fresh. Once the pump gets activated, it will stay activated until the float gets into the normal state. The only problem I foresee is that the float could get back into the normal state either due to the pump starting up or due to waves. Eventually, you may want to insist that once the pump gets activated, it stays activated unless the float is in the normal state for a sufficient interval. Come back to us for further help if you want it.