---
title: "A smart guest apartment: leak protection while you're away"
description: "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."
canonical: "https://realhomeautomations.com/en/projects/smart-guest-apartment-leak-protection/"
language: en-US
updated: 2026-11-23T16:24:03+00:00
---

# 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.

> Canonical HTML page: https://realhomeautomations.com/en/projects/smart-guest-apartment-leak-protection/

- **Difficulty:** Beginner
- **Build time:** 20–45 minutes
- **Reading time:** 3 minutes

## Tools required

- Leak sensor (Sonoff SNZB-05P with a sensing cable, 1 pc)
- Zigbee hub or adapter (or Home Assistant with a Zigbee adapter; not included in the product)
- Home Assistant (with the Zigbee integration (ZHA) or Zigbee2MQTT)
- Two phones with the Home Assistant app (yours and one of a person who can check the apartment)


## What readers will learn

- Choose where to put the sensor
- Make a critical notification that repeats every 10 minutes on two phones
- Test the sensor once a month


## Skill requirements

- Add a Zigbee device to Home Assistant
- Paste YAML into an automation

## Project kit

- [Flood sensor Sonoff SNZB-05P, with flood detection cable included](https://realhomeautomations.com/en/product/flood-sensor-sonoff-snzb-05p-with-flood-detection-cable-included/index.md)

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](https://realhomeautomations.com/bg/produkt/flood-sensor-sonoff-snzb-05p-with-flood-detection-cable-included/): 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_sensor` for 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 `off` and 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 `notify` is 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`, not `off` → check the signal and the battery.
- False alarms → condensation or a damp floor → move the sensor or dry it.

 ## Sources

- [Home Assistant: State trigger](https://www.home-assistant.io/docs/automation/trigger/#state-trigger)
- [Home Assistant: Repeat](https://www.home-assistant.io/docs/scripts/#repeat-a-group-of-actions)
- [Home Assistant: ZHA](https://www.home-assistant.io/integrations/zha/)
- [Companion: Critical notifications](https://companion.home-assistant.io/docs/notifications/critical-notifications/)