# Water alert notify

**URL:** <https://discourse.nodered.org/t/water-alert-notify/39207>\
**Category:** General\
**Created:** [15 January 2021 22:58 UTC](https://discourse.nodered.org/t/water-alert-notify/39207 "2021-01-15T22:58:14Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![melrose](https://avatars.discourse-cdn.com/v4/letter/m/d26b3c/32.png) [@melrose](https://discourse.nodered.org/u/melrose)\
**Post date:** [15 January 2021 22:58 UTC](https://discourse.nodered.org/t/water-alert-notify/39207/1 "2021-01-15T22:58:15Z")

</div>

Hello  
following question:  
i have a water counter that ticks every 0,25 litre. This means if somebody draws water, it will signal 4 times when somebody gets one litre.  
So now i think of a alert function. if there is a constant flow off let us say

> 0,25l / minute  
> and this over a timespan of 1h for example  
> and reset if first is not reached  
> then this is suspicious. This could mean something is wrong and I want to give an allert.  
> So my question is , what node red subsystems exist that i can use to get the functionality?

my passwort is asdfycxv#1 i just paste it here so that i cant for get.

---

<div class="post-metadata">

**Author:** ![melrose](https://avatars.discourse-cdn.com/v4/letter/m/d26b3c/32.png) [@melrose](https://discourse.nodered.org/u/melrose)\
**Post date:** [15 January 2021 23:41 UTC](https://discourse.nodered.org/t/water-alert-notify/39207/2 "2021-01-15T23:41:06Z")

</div>

ip[date=2021-01-16 timezone="Africa/Algiers"]

---

<div class="post-metadata">

**Author:** ![melrose](https://avatars.discourse-cdn.com/v4/letter/m/d26b3c/32.png) [@melrose](https://discourse.nodered.org/u/melrose)\
**Post date:** [16 January 2021 09:20 UTC](https://discourse.nodered.org/t/water-alert-notify/39207/3 "2021-01-16T09:20:26Z")

</div>

up[date=2021-01-05 timezone="Africa/Algiers"]

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [16 January 2021 09:50 UTC](https://discourse.nodered.org/t/water-alert-notify/39207/4 "2021-01-16T09:50:55Z")

</div>

First off a piece of advice: Don't keep posting on the thread to bump it, it won't get you attention any faster and might annoy people so they won't help you out.

> [@melrose](#):
>
> what node red subsystems exist that i can use to get the functionality?

The short answer is "none".

However you can build it yourself. But you haven't told us what you have tried yet, what hardware you are using, what version of NR you have or what node you are using to measure the water flow or how you want an alert (email, LED flashing, message on your phone, bell ringing, popup on a terminal)

Without any of that it's pretty hard go give you any advice other than general suggestions. I'd used a flow variable to store the start time and another to store the number of 'ticks' and a flow that would run at some interval to see if the start time is over an hour ago and if the 'ticks' exceeds the limit and then send the alert.

---

<div class="post-metadata">

**Author:** ![melrose](https://avatars.discourse-cdn.com/v4/letter/m/d26b3c/32.png) [@melrose](https://discourse.nodered.org/u/melrose)\
**Post date:** [16 January 2021 10:12 UTC](https://discourse.nodered.org/t/water-alert-notify/39207/5 "2021-01-16T10:12:22Z")

</div>

thank you for your ideas

> [@zenofmud](#):
>
> But you haven't told us what you have tried yet, what hardware you are using, what version of NR you have or what node you are using to measure the water flow or how you want an alert (email, LED flashing, message on your phone, bell ringing, popup on a terminal)

I always have the lastest version of node red.  
The water level is a numeric value as input and as output i only need a logical signal, any other processing I can do my own.  
I would have used now a custom function node that gets triggered by a water level update.  
But im wondering what existing blocks i could use to come to a more profesional level.  
Your algorithm is sensing high water consumption, what i need is an algorithm to detect unexpected permanent (even low) flow. Because the situation in my etablishment is that someone takes water for a limited time and most of the time it is sero.  
Something like integrate in a time grid when an increment is assumend in the fault case, maybe 1 min and window over it for the time it is expected or guaranteed that flow is zero, maybe half hour (to be tested) and altert if in the window are always non sero.  
What existing nodes could i use?

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [16 January 2021 12:36 UTC](https://discourse.nodered.org/t/water-alert-notify/39207/6 "2021-01-16T12:36:06Z")

</div>

For input it depends on the sensor you are using. For the calculation you could use a function node. For the output it depends on what you do with it.

I would have two flows, one to collect the data and a second (to run at a certain interval) to calculate the usage - probably using a function node - and sending out the data you want

---

<div class="post-metadata">

**Author:** ![melrose](https://avatars.discourse-cdn.com/v4/letter/m/d26b3c/32.png) [@melrose](https://discourse.nodered.org/u/melrose)\
**Post date:** [16 January 2021 14:13 UTC](https://discourse.nodered.org/t/water-alert-notify/39207/7 "2021-01-16T14:13:34Z")

</div>

> [@zenofmud](#):
>
> ds on the sensor you are using. For the calculation you could use a function node. For the output it depends on what you do with it.
> 
> I would have two flows, one to collect the data and a second (to run at a certain interval) to calculate the usage - probably using a function node - and sending out the data you want

with your help now i have made the flow thank you very much

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/a/5a9044558df9535a5ce6ae0343b686dcadbec1a1.png)

---

<div class="post-metadata">

**Author:** ![melrose](https://avatars.discourse-cdn.com/v4/letter/m/d26b3c/32.png) [@melrose](https://discourse.nodered.org/u/melrose)\
**Post date:** [16 January 2021 16:18 UTC](https://discourse.nodered.org/t/water-alert-notify/39207/8 "2021-01-16T16:18:37Z")

</div>

Big thank yous for all for asking me lot of questions on details on my algorithm in Mails.  
I have more idea to build in and when i finish i give it out to you in a combined package.

My next idea is a new warning algorithm.  
I live in a wealthy residence. The number of water taping locations is limited:  
-one dunghole, lets assume a session is 10 minutes and with a worst case number of 3 flushings we have unsage of 30l + 5l handwashing / 10 min max  
-someone can drink 1l per mintute, so in the kitchen the max. is 10l/10 min  
-garden is maybe more  
-bathroom is 10l/10m  
-wath mashene is 10l/10lmin  
-dish washer is 10l/10 min

so in the worst case everything together is 100l/10 min. If this is exceeded I will give a high level alert out to the rescue

---

<div class="post-metadata">

**Author:** ![melrose](https://avatars.discourse-cdn.com/v4/letter/m/d26b3c/32.png) [@melrose](https://discourse.nodered.org/u/melrose)\
**Post date:** [19 January 2021 22:05 UTC](https://discourse.nodered.org/t/water-alert-notify/39207/9 "2021-01-19T22:05:44Z")

</div>

question: a toilet flush has a known flow of water in a known period of time,  
dish washer, washer maschine etc. has a somehow known pattern;  
now i want to go to the data over a past timespan and find out what has happened, e.g. a bar chart  
with colors for 2x flushing, 1 shower, washer.  
How can I do this?  
Thank you

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [20 January 2021 08:12 UTC](https://discourse.nodered.org/t/water-alert-notify/39207/10 "2021-01-20T08:12:49Z")

</div>

Are you able to define _exactly_ how to tell the different event apart?

---

<div class="post-metadata">

**Author:** ![melrose](https://avatars.discourse-cdn.com/v4/letter/m/d26b3c/32.png) [@melrose](https://discourse.nodered.org/u/melrose)\
**Post date:** [20 January 2021 18:18 UTC](https://discourse.nodered.org/t/water-alert-notify/39207/11 "2021-01-20T18:18:06Z")

</div>

no, off course not. Nobody could tell how long somebody flushes. Im thinking of something adaptive like a kalman filter

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [20 January 2021 18:38 UTC](https://discourse.nodered.org/t/water-alert-notify/39207/12 "2021-01-20T18:38:42Z")

</div>

I doubt whether a Kalman would do it. I suspect it would need an AI technique which can be taught what the events look like.

---

<div class="post-metadata">

**Author:** ![melrose](https://avatars.discourse-cdn.com/v4/letter/m/d26b3c/32.png) [@melrose](https://discourse.nodered.org/u/melrose)\
**Post date:** [20 January 2021 22:28 UTC](https://discourse.nodered.org/t/water-alert-notify/39207/13 "2021-01-20T22:28:32Z")

</div>

yes, do you have a node for that?

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [21 January 2021 07:20 UTC](https://discourse.nodered.org/t/water-alert-notify/39207/14 "2021-01-21T07:20:59Z")

</div>

Sadly it needs a lot more than a node. Google for TensorFlow both here and on the internet. There may be other options, I am not an expert on this subject.

---

<div class="post-metadata">

**Author:** ![melrose](https://avatars.discourse-cdn.com/v4/letter/m/d26b3c/32.png) [@melrose](https://discourse.nodered.org/u/melrose)\
**Post date:** [21 January 2021 17:43 UTC](https://discourse.nodered.org/t/water-alert-notify/39207/15 "2021-01-21T17:43:02Z")

</div>

oh, do you have a link where someone programmed something what i have

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [21 January 2021 18:47 UTC](https://discourse.nodered.org/t/water-alert-notify/39207/16 "2021-01-21T18:47:21Z")

</div>

Actually this is a hard problem. It is a variation of the "knapsack problem" and is considered NP hard. Most of the versions I have seen tend to be around electricity consumption and device profiles - eg - [https://www.researchgate.net/publication/308764100\_Real\_Time\_Identification\_of\_Electrical\_Devices\_through\_Power\_Consumption\_Pattern\_Detection](https://www.researchgate.net/publication/308764100_Real_Time_Identification_of_Electrical_Devices_through_Power_Consumption_Pattern_Detection) and  
[https://www.researchgate.net/publication/310829132\_Electrical\_Devices\_Identification\_Through\_Power\_Consumption\_Using\_Machine\_Learning\_Techniques](https://www.researchgate.net/publication/310829132_Electrical_Devices_Identification_Through_Power_Consumption_Using_Machine_Learning_Techniques)

But the principles could potentially be extended to water as well.  
So yes machine learning may well be one good way to get fairly good results.

---

<div class="post-metadata">

**Author:** ![melrose](https://avatars.discourse-cdn.com/v4/letter/m/d26b3c/32.png) [@melrose](https://discourse.nodered.org/u/melrose)\
**Post date:** [26 January 2021 19:48 UTC](https://discourse.nodered.org/t/water-alert-notify/39207/17 "2021-01-26T19:48:03Z")

</div>

yes it is hard but i keep on reading the topic

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [27 March 2021 19:48 UTC](https://discourse.nodered.org/t/water-alert-notify/39207/18 "2021-03-27T19:48:56Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
