Automations / Home Assistant 2026.8
Water-leak alert
A persistent Home Assistant warning and an immediate phone notification when water is detected.
Replace your entities↓Outcome
Build a dual local and mobile alert with a stable ID that prevents duplicate dashboard notices.
Before you start
- A leak binary_sensor whose state is on when wet.
- The Companion app connected with notifications allowed.
- Your phone’s exact notify.mobile_app action name.
02 / Workflow
Guided installation
Follow the steps in order. The configurator below generates the block you need to paste.
- 01
Create an empty automation
Go to Settings → Automations & scenes, create a new automation, and choose the empty option.
- 02
Open the YAML editor
From the top-right menu, select Edit in YAML.
- 03
Configure and paste
Enter entities, thresholds, and labels below, then replace the existing YAML.
- 04
Save and test
Save, use Run actions for a controlled test, and inspect Traces after a real trigger.
YAML configurator
Replace your entities
Enter the real entity IDs from your installation. The code updates immediately and flags invalid values.
alias: "Safety · water leak"
description: ""
triggers:
- trigger: state
entity_id: binary_sensor.perdita_acqua_lavatrice
from: "off"
to: "on"
conditions: []
actions:
- action: persistent_notification.create
data:
notification_id: perdita_acqua_lavatrice
title: "Water leak alert"
message: "Water was detected near the washing machine. Check it now."
- action: notify.mobile_app_telefono
data:
title: "Water leak alert"
message: "Water was detected near the washing machine. Check it now."
mode: singleEntity map
Where to find entity IDs and actions
- 01
Open Settings → Devices & services → Entities.
- 02
Find the device and copy its full ID, such as sensor.living_room_temperature.
- 03
For notifications, open Settings → Developer tools → Actions and search for notify.mobile_app.
- 04
Paste each value into the matching field and copy the YAML only when every check is green.
Source first
Official references
The syntax and components in this project were checked against these Home Assistant pages.