Sensor House
Leak sensor recipe
Water on the floor at a water heater, a washer, a dishwasher, a sink or a toilet, the moment it gets there.
Water on the floor at a water heater, a washer, a dishwasher, a sink or a toilet, the moment it gets there. Flat on the floor at the lowest point beside the fixture, where a leak runs first. In Home Assistant it shows up as a binary_sensor, device class moisture. When the sensor reads wet, send you a notice to close the main valve. A moisture sensor turns on when it reads wet. The recipe fires on that change, closes the main valve first if you have one, then tells you.
What it catches
Water on the floor at a water heater, a washer, a dishwasher, a sink or a toilet, the moment it gets there.
Where it goes
Flat on the floor at the lowest point beside the fixture, where a leak runs first.
How it shows up in Home Assistant
As a binary_sensor, device class moisture. Battery sensors usually talk over a low-power mesh radio (Zigbee, Z-Wave or Thread) to a hub or a USB stick on the Home Assistant machine.
Why the recipe looks like this
A moisture sensor turns on when it reads wet. The recipe fires on that change, closes the main valve first if you have one, then tells you.
Write it for your sensor
Runs in your browser. Nothing you type is sent.
Leak sensor. When the sensor reads wet, send you a notice to close the main valve.
automations.yaml
- alias: "Leak: water detected"
mode: single
triggers:
- trigger: state
entity_id: binary_sensor.water_heater_leak
to: "on"
actions:
- action: notify.mobile_app_your_phone
data:
title: "Water detected"
message: "{{ trigger.to_state.name }} is wet. Close the main water valve."
Rename the entities to your own, then paste. Syntax: Home Assistant: Automation triggers.
Sources
- Home Assistant: Binary sensor (device classes moisture, door, garage door, battery) Home Assistant
- Home Assistant: Automation triggers Home Assistant
- Home Assistant: Valve (valve.close_valve) Home Assistant
- IBHS: State of the Risk, Interior Water Damage (white paper, December 2024) Insurance Institute for Business and Home Safety
Drafted with a language model on October 26, 2026 from the sources listed above. Every recipe on the page is written by the site's own code and parsed by a test. The editor samples pages after they publish; nothing here is advice from a licensed electrician or plumber.
Found an error? See Corrections.