automatic three way valve