Stopping of pumps, or operating valves, on occurrence of unwanted conditions