How to Automate Water Shutoff for Leak Prevention