Recently I noticed that there is a leakage in my watering system because I was able to see that the pump was active way more frequently while the system did nothing, therefore trying to keep the pressure in the pipes high.
I only found this because I looked at the charts, but it would be great to have an automation that would find those short peaks and check their frequency. If the frequency is too high, there must be something wrong and I want to trigger a notification. I tried my luck with regular automation, however, did not find a way to check for a recent peak.
In general those peaks have typically a duration of about 2 seconds.
Since the peaks are so few and temporary then I would think a statistics sensor would work.
If you have it set to say 10 minutes or so then you should see a larger average consumption than when its normal.
Normal should be close to 0 even when the pump runs, but perhaps you will get 100-150-ish average when there is a leak.
Perhaps not at the start but at the morning of May 16 I guess it would be noticeable.
EDIT;
I just remembered that is not how the statistics sensor calculates the average.
But I believe there is a HACS sensor that do calculate it that way.
Or you could use an automation to increment a counter every time the pump power goes above 200W (numeric state trigger), reset the the counter at midnight (time trigger) and alert you if the counter exceeds 10 (or whatever) counts a day (another numeric state trigger).
Thank you! Both suggestions seem to be great, however, I chose the counter-based approach simply because I do not need any additional sensor or complicated calculation that might be error-prone ( if done by me )
alias: Pumpe Wasserzisterne Leakage Detection Notification
description: >-
Notifies you when the pump turns on/off over 20x per day which indicates
frequent pressure loss.
trigger:
- platform: time
at: "12:00:00"
condition: []
action:
- if:
- condition: numeric_state
entity_id: counter.eg_garten_pumpe_wasserzisterne_aktiv_zaehler
above: 20
then:
- service: notify.mobile_app_iphone
metadata: {}
data:
message: Wasserzisterne Pumpe Leakage Detection!
- service: counter.reset
target:
entity_id: counter.eg_garten_pumpe_wasserzisterne_aktiv_zaehler
data: {}
mode: single
One thing that I have not figured out yet is if it is possible to check for a minimal peak duration. This would be useful because in case somebody uses the water more frequently (= more peaks) it would result in a false positive. If I could filter for short peak duration (eg. 1-2 seconds) I would reduce the risk to almost zero. Am I lucky and is there an option that I am not aware of?
Consider also adding a long run cutoff. If the pipe completely burst it may never get back up to pressure.
Long Run cutoff - if the well runs for more than X minutes generate an alert and turn it off. You’ll need to derive what X should be based on your usage. Use an input number for X so its easy to tweak. Based on your description if its running for 1 minute you have a problem.
You can use a wait_for_trigger to check how long the pump has been on for.
This is an automation I wrote yesterday for a similar type of question, you should be able to adapt the concept to your needs. But if you have trouble or questions just ask.
alias: Test Hold
description: ""
trigger:
- platform: state
entity_id: input_boolean.test
from: "off"
to: "on"
condition: []
action:
- variables:
timeout: 10
- wait_for_trigger:
- platform: state
entity_id: input_boolean.test
from: "on"
to: "off"
continue_on_timeout: false
timeout: "{{ timeout }}"
- variables:
press_duration: "{{ timeout - wait.remaining }}"
- choose:
- conditions:
- condition: template
value_template: "{{ press_duration < 2 }}"
sequence:
- service: notify.mobile_phone
data:
message: Less than 2 seconds
default:
- service: notify.mobile_phone
data:
message: Greater than or equal to 2 seconds
mode: single
Thank you for all the great suggestions. This is what I ended up with so far not taking into account “Long Run cutoff” yet (still not fully tested, but could be a good starting point for others)
Had posted about something like this a year or so ago but never got around to doing it. A spigot got left on again so back to being important.
Rather than the counter approach above, would a derivative helper sensor be another option? Haven’t worked much with them but looking at kwh vs w, seems like it would work?