Six Aqara leak sensors, one automation: zone-aware alerts that nag until the leak is fixed

I have six Aqara Water Leak Sensors: kitchen sink, two in the laundry room, changing room, and two in the training room. One sensor beeping in an empty room doesn’t help much, so I tied them together in Home Assistant and wanted to pass my automations along to forum members.

What it does:

One group, one trigger. All six sensors live in a single group. One automation watches the group, so adding a seventh sensor means adding one line to the group and nothing else.
It tells me where. I made a small group for each room. When something trips, the script checks which sensors are wet and which rooms they belong to. The alert says “Leak detected at Laundry Room Sink East Sensor (Zone: Laundry),” not just “water leak.”
It hits everything at once: a push to our phones, an Alexa announcement, and a dashboard notification.

It nags. A single push gets swiped away at 2 AM. While any sensor is still wet, it repeats every 5 minutes and names the sensors that are still wet. It stops on its own when they dry.
Maintenance mode. One toggle swaps the loud alert for a silent note. If a plumber is under the sink, the whole house doesn’t go off.
All-clear. When the last sensor dries, I get a message so I’m not left wondering.

The part you’ll probably copy:

The repeat loop. It re-checks the group each pass, so the message always lists the sensors that are wet right now:

  • id: water_leak_repeat_alert
    alias: Water Leak Repeat Alert
    mode: restart
    triggers:
    • trigger: state
      entity_id: input_boolean.water_alarm_active
      to: “on”
      actions:
    • repeat:
      while:
      - condition: state
      entity_id: group.grp_water_leak_sensors
      state: “on”
      sequence:
      - delay: “00:05:00”
      - action: notify.mobile_app_your_phone
      data:
      title: “Water Leak Still Active”
      message: >-
      Still wet:
      {{ expand(‘group.grp_water_leak_sensors’)
      | selectattr(‘state’,‘eq’,‘on’)
      | map(attribute=‘name’) | list | join(', ') }}

Swap in your own notify service and group name.

What it doesn’t do (yet):

No auto-shutoff. I built a toggle and a spot in the script for a valve-close action, but I haven’t connected a valve.

A second sensor can be late. The trigger is the group turning on. If one sensor is already wet and another trips later, the group stays on and there’s no instant alert for the second one. It shows up in the next 5-minute repeat.

Batteries. A dead leak sensor is a silent one. I have a separate battery-monitoring automation for every sensor, boorbell, lock, etc. in the house with batteries.

Hope this inspires some new automations for you all.

3 Likes

Thanks for sharing!