Taco's WAGS valve, is totally mechanical...no electicity required to shut off the water supply if there's a leak and, it can be often wired to disable the gas valve, preventing the WH from turning on with an empty tank.
www.wagsvalve.com. It uses a disolvable pellet that releases a spring loaded valve...the same pellet thing that is used on life vests for airplanes when they get wet.
I have been thinking of adding something like that to my tankless.
On Thankgiving morning I took a shower. After the shower, I kept hearing this noise in the water pipes like a valve was just barely turning on. Kind of a higher pitch whining noise. Checked all the fixtures in the house, but I still heard the noise.
Went downstairs to check the laundry area, and then I find the tankless running with no demand. There was HOT water coming out the T&P valve, and the tankless kept on heating the water. I shut off the gas and let things cool down.
The next day I went though the heater. Checked water valve and thermostat. It turns out that the T&P valve just started to leak near the thermostat setting. After the hot water demand was turned off, the water temperature at the T&P rose just enough to make the T&P valve leak. Then the point was hit where the burner came back on. So the unit was acting like there was hot water demand, but it was only a defective T&P.
Good thing I noticed the noise before I left the house for the day!