Mike Fisher
Established Member
Code is relative to municipality. Fail closed solenoid valves are safe.
I was assuming the OP was in the USA. The American National Standard is the Uniform Plumbing Code (UPC). Most cities defer to that, but some cities have more restrictive rules that they add to it.
And I've had two sprinkler valves fail open. One fully, and the other one partial. Had I been draining to a bucket there would have been a problem. So yes, if you set it up this way, figure out your drainage first.
I think a safer way would not use sprinkler parts at all. The fill solenoid in your washing machine is a very reliable device and is rated for indoor use.