Water sensing and electrical plug switch

Hi, I would like to use HA for two projects in my house.

  1. if the laundry machine overflows, cut the power to the electrical switch.

  2. if a toilet overflows, turn off water to toilet.

Can you please refer me to the hardware that I can look into integrating into home assistant. I just watched the Pycon video, so please excuse my ignorance (I have a lot of reading to do for HA), but I am redoing my basement, and the walls are open now, but will be closed soon. So, I am hoping to install the hardware while the walls are open.

Much appreciated.


Putting hardware behind a wall that will be inaccesible in the future doesn’t seem like a very good idea to me.

Fibaro has a Z-Wave flood sensor for example, but it works on batteries i thought. But something else to consider: what if you need to re-include it again or something. Good luck on breaking open your wall then.

You can do both of these with off the shelf stuff.

For #1 - get a smart switch like the aeotec and a water sensor; you’ll need to set up an automation for it, obviously. You can do these at any time as neither of them have to be in the wall.

For #2 - this one is a little more difficult as you would need a solenoid valve that would fit your feed to the toilet and it would have to either be connected to a computer (Pi, Arduino, etc.) or some other interface so that HA can access it and another water sensor.

I would strongly suggest you seek the advice of a commercial plumber on this. If you already have a good relationship with your plumbing contractor, he may be able to advise you or put you in touch with someone who can. It won’t be cheap or easy, but it can be done.

You need to go with a known brand designed for this use case; pipes in your wall are nothing to hack. I lost an entire house in PA in 24 hours because of a burst pipe. The house became so unstable, I had 15 minutes to go in and survey the damages and then leave as it was creaking and shifting around us. They spent the entire night shoring up the house so it wouldn’t collapse until they could demo it, which they did the next day. It was surreal doing TV new interviews when something as trivial as a burst pipe caused me to lose the first home I ever bought.

In case you think I’m overemphasizing, here’s a picture of them shoring up the house:

Here it is 48 hours later:

Hi rpitera,

Thanks for the insights. That is some crazy stuff. I hope you had some good home insurance. These pics will actually make me check my water damage insurance for my house. I think we only have an upper limit of $25K.

Taking what happened into consideration, would that make you want to put in the #2 idea more or less? I guess alternatively, I could have water sensors at key areas in the house and if they got wet to turn off the main water supply to the house. That makes me think that maybe I wouldn’t even need to solder the think in, but to have a mechanism that hooks over the main water valve in the house that could be shut off if water was sensed. I’m new to HA, so I’m not sure if I am overthinking this.

Can you please suggest any good water sensor companies? I am unsure of which companies in the space are trustworthy.

I am keen in doing #1 because my laundry machine is about 3 meters away from the closest drain.

All the best,



Thanks for the info. I’ll take a look at Fibaro. I am unclear on what “reinclude it” means. I suppose something to do with connecting the item to the wifi?


Yes, I was lucky to have a really good insurance company that arranged for the emergency construction and take down and settled the claim amazingly fast. Harleysville Insurance; unfortunately not available in my new area otherwise I’d still be with them.

I would definitely go route number two and in fact I’m going to Home Depot today to pick up a LeakSmart kit if I can find one. HD is putting them on clearance (they’re paring down their SmartHome offerings and the kit with one sensor and the solenoid valve is going for $73.00 at the moment. If you’re interested, I’d suggest going today as someone posted the sale on Reddit and they’ll go fast.