A smart guest apartment: leak protection while you’re away
A leak sensor protects the apartment while the guests are inside and you are far away. A critical notification on two phones, repeated every 10 minutes until the sensor is dry.
- Level
- Beginner
- Active time
- 20–45 minutes
- Home Assistant required
- Yes
The guests leave, you are in another city, and water is boiling over in the bathroom. A washing machine hose or a burst trap can flood the apartment, and the neighbors below as well. Here we put in a sensor that detects water and sounds the alarm on two phones at once.
What you will get
A critical notification on two phones when the sensor senses water. It repeats every 10 minutes until the sensor is dry. If Home Assistant is running, the first notification comes within seconds.
What we need
- 1 pc Sonoff SNZB-05P: a Zigbee 3.0 leak sensor, with the sensing cable included. For more places you need more sensors.
- A working Home Assistant and two phones with the Home Assistant app: yours and one of a person who can check the apartment.
You need a Zigbee hub or Home Assistant with a Zigbee adapter.
The hub or adapter is not included in the product. Setup time: 20–45 minutes. No electrical installation is touched.
How it works
When the sensor senses water, Home Assistant receives binary_sensor with the state on (class “moisture”). The automation sends a critical notification to both phones, waits 10 minutes and sends again. It repeats until the sensor shows off, which means dry.
On iOS the notification is critical: it sounds even when Do Not Disturb is on.
Steps
- Pair the sensor in Home Assistant through ZHA or Zigbee2MQTT. You expect
binary_sensorfor moisture. Give it a name by place, for example Bathroom leak. - Put the sensor on the lowest dry point at the most likely place for a leak, where water would arrive first: under the sink, next to the washing machine, next to the water heater. The sensing cable goes where water collects.
- Open Developer tools → Actions, find the action
notify.mobile_app_…of each phone and send a test message. On iOS the critical notification is turned on from the Companion app settings. - Automation (the entity ID and the phone names are examples):
alias: Leak - critical notification every 10 minutes
mode: single
triggers:
- trigger: state
entity_id: binary_sensor.leak_bathroom
to: "on"
actions:
- repeat:
until:
- condition: state
entity_id: binary_sensor.leak_bathroom
state: "off"
sequence:
- action: notify.mobile_app_phone_1
data:
title: Leak!
message: The sensor detected water. Check the apartment.
data:
ttl: 0
priority: high
push:
sound:
name: default
critical: 1
volume: 1
- action: notify.mobile_app_phone_2
data:
title: Leak!
message: The sensor detected water. Check the apartment.
data:
ttl: 0
priority: high
push:
sound:
name: default
critical: 1
volume: 1
- delay: "00:10:00"
- Save and test with a damp cloth on the sensor (without immersing it).
Checking the result
- Lightly wet the cable or the sensor’s contacts: a critical notification comes on both phones.
- Leave the sensor wet: the notification comes again after 10 minutes. Dry it and check that the entity returns to
offand the repetitions stop. - Repeat the test once a month, write down the date, and replace the battery on time.
If it doesn’t work
- No notification comes → the name of the
notifyis wrong or notifications are off → send a test one from Developer tools. - The notifications don’t stop although there is no water → the sensor is
unavailable, notoff→ check the signal and the battery. - False alarms → condensation or a damp floor → move the sensor or dry it.
Sources
Need a hand?
We can set up and install everything in this project. In some regions we install it ourselves — ask us.
Contact us


