How to setup a sensor to detect a mains water leak overnight?

Hi everyone
I am using a sensor to read the water use off my main water meter.
While checking the stats today I saw that there was a constant use of 3L/h over night. Once I saw that I check all the taps and found that one of the outdoor ones was not fully closed (kids)
So I want to get an alert if such leak is detected.

I was thinking of checking if the use overnight over 2 consecutive hours is the same and send an alert.

I want to avoid false triggers in case someone uses the toilet after midnight etc.
Any ideas on how to achieve it?
All mixed up in a head - stat sensors, trigger based etc etc =)

How about this?

trigger:
  - platform: numeric_state
    entity_id: sensor.your_flow_sensor_here
    above: 2.9
    for:
     hours: 1
condition:
  - condition: time
    after: '0:00:00'
    before: '06:00:00'
action:
 <notify yourself here>

You probably don’t even need the time condition. So it could trigger at any time.

Do you have any water use items that run over 2.9L/h continuously for more than an hour?

Check the history graph for your flow sensor.

1 Like

Hi @tom_l
I dont have anything that would use water for more than hour. But it is not an instantaneous water flow sensor that I have, but incremental. Physical sensor resolution is only 1L.
I have an hourly utility sensor already and was thinking of combining something like these into a trigger condition

{% if (states('sensor.utilities_water_meter_hourly') | int) > 0 and state_attr('sensor.utilities_water_meter_hourly', 'last_period') | int > 0 %} true
{% else %} false
{% endif %}

Ok, use a template trigger:

trigger:
  - platform: template
    value_template: "{{ states('sensor.utilities_water_meter_hourly') | int(0) > 0 and state_attr('sensor.utilities_water_meter_hourly', 'last_period') | int(0) > 0 }}"