# Flooding - early warning system

**URL:** <https://discourse.nodered.org/t/flooding-early-warning-system/91196>\
**Category:** General\
**Created:** [23 September 2024 05:14 UTC](https://discourse.nodered.org/t/flooding-early-warning-system/91196 "2024-09-23T05:14:22Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [24 September 2024 06:17 UTC](https://discourse.nodered.org/t/flooding-early-warning-system/91196/21 "2024-09-24T06:17:59Z")

</div>

Reading it initially:

> [@krambriw](#):
>
> It's about that there is a blockage in the street. So this is about a pre-warning system to give you additional time, bring in all the buckets you can find or whatever other actions to take to avoid flooding damage as much as possible

Alas I fear that is not really possible.

UNLESS you have ANOTHER sensor outside that can detect the water BEFORE it gets to your place.

The closest I think I came to that is with the third value/output.

From the sump being EMPTY, water comes in, the sump fills  
When it reaches the second value the pump/s turn on.  
If they are ON and the level keeps rising it gets to level 3, then alarms go off.

Though that time would not be long - depending on many factors:  
How big the sump is.  
How fast the water is coming in.  
How far help is away from arriving.

The _other problem_ is the existing pump's output and how clear they are.  
If there is any problems with that: there's a whole other can of worms opened.

I am not saying my solution is better than anyone else's.  
But when I read the thread, there are graphs and all this statistical stuff.  
I guess if you really wanted to be a bit more analytical about things:

## New idea:

Sensor has 3 values  
empty - turn pumps off  
high - turn pumps on  
high + _margin_ - this is a value above the _high_ that if he water exceeds, alarms go off.

Factors:  
In _normal_ emptying of the sump, let's say 10L / Min. (example)  
The sump is 30L capacity. Not much good having one with a 11L capacity. You need a fairly good difference there. Say 50%  
So 15L is the minimum.  
And that needs to be as closer fitting to the pumps as possible.  
Not a 4m x 4m pit 1m deep. (bad example, but I hope it conveys the importance of the sump's shape)  
`empty` is 5L. Could be maybe 3L  
So, `high` is triggered.  
That starts a `timer` to ...... _wait a minute!_  
All this is nice in theory, but it is over complicating things.  
`high` is reached. the pumps turn on.  
The level of the water is monitor - as per usual.  
If the level gets below `empty` the pumps are turned off.  
However, if not, the pumps stay on.  
(more time and water)  
The level rises from the _high_ (of say 7L) to 10L  
When this happens the value is noted and alarms go off.  
_Trends_ are not useful in this situation.  
If there is water: you want the pumps on and pumping at full capacity until it is _empty_.  
(at a low level but the pumps are still in water)  
So the pumps turn on at 7L and when the sump gets to 10L of water, the alarms go off and you DO THINGS.

Yes, if the sump goes from 2L to 15L in 10 seconds, buy an arc. (sorry.)  
You can't control that.

All you do it set a value just above the `turn on` value so if the water goes above that, you are told.

To explain another way:

The sump is _empty_.  
Water starts coming in at 15L/min - you don't / can't know this.  
It quickly goes above the `high` level and the pumps turn on.  
They are extracting water a 10L/Min.  
Your net is +5L/Min.  
It will take about 40 seconds to fill the sump.  
In those 40 seconds (near the end) the inflow reduces to 10L/Min.  
(That's breaking even with the pumps)  
So they will stay on ..... _forever_ if nothing else changes.  
ALSO you will NOT get flooded.  
So after...... 10 minutes of that....... the inflow reduces to 8L/Min.

Now you are winning.  
The pumps will stay on until the level gets below the `empty` mark then turn off.

Does that help with anyone understanding from where I'm coming?

Oh, sorry. P.S.  
The _margin_ needs to be enough that any water falling into the sump won't _corrupt_ the value.  
If it does, you may get _false positives_ on one hand and _delayed calls for help_ on the other.

---

<div class="post-metadata">

**Author:** ![krambriw](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/krambriw/32/5429_2.png) [@krambriw](https://discourse.nodered.org/u/krambriw)\
**Post date:** [24 September 2024 06:24 UTC](https://discourse.nodered.org/t/flooding-early-warning-system/91196/22 "2024-09-24T06:24:26Z")

</div>

Not sure that is the problem, @hazymat need then to clarify if so

I have understood that the situation is such that you are not able to drain any longer, the exit to the street is clearly stated as blocked. Where do you then drain the waste water, the sumps are already full? Like putting a pump in the ocean and hope the barrier reef becomes dry land

---

<div class="post-metadata">

**Author:** ![hotNipi](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hotnipi/32/383_2.png) [@hotNipi](https://discourse.nodered.org/u/hotNipi)\
**Post date:** [24 September 2024 06:41 UTC](https://discourse.nodered.org/t/flooding-early-warning-system/91196/23 "2024-09-24T06:41:31Z")

</div>

A function to analyse cycle times (collected with the function I shared above) and rise alert with different levels.  
Run as separate mini flow , trigger node with repeat interval maybe every 5 or 10 seconds.

Adjust by your needs and **definitely test before use !!!!**

```auto
//alert level based on how many consecutive periods are short enough to indicate malfunction
// alert level then may indicate how serious the problem is.

let store = global.get('cycleStore') || {}
if(store.cycles == undefined){
    return
}
//milliseconds 
const warn = 5000 // slightly too often
const alert = 3000 // critically too often

let alertLevel = 0

const records = store.cycles

// convert cycle times to periods between cycles
const results = records.slice(1).map((e, i) => records[i + 1] - records[i])
// reverse to get newest to beginning
results.reverse()

// check consecutive periods against triggerpoints and rise alert level
let add = 1
results.forEach(function(time) {
    if (time > warn){
        // last period is long enough so considered the malfuction is over
        add = 0
    }
    if(add){
        if (time < alert) {
            //short period - bigger problem
            alertLevel += 2
        }
        else{
            //medium period - maybe can handle
            alertLevel += 1
        }
    }
});

msg.payload = alertLevel
return msg;

```

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [24 September 2024 06:57 UTC](https://discourse.nodered.org/t/flooding-early-warning-system/91196/24 "2024-09-24T06:57:54Z")

</div>

> [@krambriw](#):
>
> the exit to the street is clearly stated as blocked. Where do you then drain the waste water

Then you need a longer hose on the outside of the pump that will _reach_ an unobstructed point to where the water can be pumped.

If the output is _blocked/clogged/obstructed_ then the bottom line is the pump's output capacity is reduced.

---

<div class="post-metadata">

**Author:** ![hazymat](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hazymat/32/108159_2.png) [@hazymat](https://discourse.nodered.org/u/hazymat)\
**Post date:** [24 September 2024 07:07 UTC](https://discourse.nodered.org/t/flooding-early-warning-system/91196/25 "2024-09-24T07:07:24Z")

</div>

> [@krambriw](#):
>
> Not sure that is the problem, @hazymat need then to clarify if so

You’re correct. @Trying_to_learn seems to be talking about the logic required to turn a sump pump on and off. Don’t need that. All professionally installed sump pumps come with floats, so this is handled directly by the pumps themselves. Pls refer to graphs posted in my opening post, they show the pumps operate when a certain water level is reached. I already have a sump pump system with detailed monitoring set up, have done for years. It works for normal use but we are talking here about something completely different which is a sewage back surge into the house, causing pumps to not physically be able to pump water out into the sewage system. It’s about dealing with that scenario.

Re the points made about flow of water in vs out of the building. This is not relevant. It’s not possible to predict how quickly a given volume of water will enter. In this case water is coming in through the soil and walls of basement (groundwater) as well as back through sewage pipe (at a rate determined by the pressure of the surge which can’t be predicted). This is about detecting an error state and notifying me, so I know there’s a problem sooner.

Note I already have rainfall alerts in place! Also I already have sump overflow or sump error alerts in place.

This is about me knowing as soon as possible that there’s a disaster scenario, so I can prepare with more time.

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [24 September 2024 07:12 UTC](https://discourse.nodered.org/t/flooding-early-warning-system/91196/26 "2024-09-24T07:12:26Z")

</div>

> [@hazymat](#):
>
> It works for normal use but we are talking here about something completely different which is a sewage back surge into the house,

So this isn't storm water... it is sewage. Eeew.

You should have _NRV_ (Non return valves) installed.  
(Academic at this point in time, but maybe for future reference.)

And that opens the can of worms:  
_What happens in the mean time?_  
If the sewage is not working and you need to _go_?

I am sorry I went off on the tangent.

Here (in Oz) we have a _boundary trap_ which is where your place connects to the system.  
That is where you would put the NRV.

---

<div class="post-metadata">

**Author:** ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)\
**Post date:** [24 September 2024 07:19 UTC](https://discourse.nodered.org/t/flooding-early-warning-system/91196/27 "2024-09-24T07:19:26Z")

</div>

> [@Trying\_to\_learn](#):
>
> If the sewage is not working and you need to _go_?

I think there is some sort of arrangement in UK whereby you can just dump in the river.  
Not sure if that applies to individuals or just at corporate level.

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [24 September 2024 07:21 UTC](https://discourse.nodered.org/t/flooding-early-warning-system/91196/28 "2024-09-24T07:21:19Z")

</div>

Yeah, but

> [@hazymat](#):
>
> but we are talking here about something completely different which is a sewage back surge into the house

where the pipes all join together to connect to the main sewer....

Put a valve to stop backflows sending stuff back into your place.

THEN - in this scenario:  
You make a _pipe_ \* to pump your sewage into said river.  
But I don't know the full story on exactly what's happening.  
I was wrong thinking it was storm water.

- pipe tube/hose/what ever

---

<div class="post-metadata">

**Author:** ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)\
**Post date:** [24 September 2024 07:27 UTC](https://discourse.nodered.org/t/flooding-early-warning-system/91196/29 "2024-09-24T07:27:29Z")

</div>

Hazymat does have a non-return valve

> [@hazymat](#):
>
> But when the sewage system in the street fails, our non-return valve closes,

Though it's not clear if it's working properly

> [@hazymat](#):
>
> the pump operates, then almost immediately the water filters back in.

---

<div class="post-metadata">

**Author:** ![hazymat](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hazymat/32/108159_2.png) [@hazymat](https://discourse.nodered.org/u/hazymat)\
**Post date:** [24 September 2024 07:40 UTC](https://discourse.nodered.org/t/flooding-early-warning-system/91196/30 "2024-09-24T07:40:13Z")

</div>

Yes all buildings here have non return valves.

It’s working fine. It prevents free flow of liquid back towards the house, as there’s a simple flap which closes when liquid flows in that (wrong) direction.

(Note @jbudd this is different to the non return valve in the sump. That one is not very good and I should replace it. The sump non return valve is plumbed into the exit pipe from the sump pump. To be fair, the fact it’s not very good is actually giving me something here - it’s giving me the useful data I posted in my opening post with that blue line - which can be used as an early warning system. If the non return valve was better the sump wouldn’t fill back up so quickly and so I wouldn’t as easily know there’s a problem.)

This is a sewage surge scenario. It’s a disaster scenario. It’s where sewage literally pushes through protection measures like triple sealed manhole covers that are bolted down, and probably tests the non return valve to its limit but to be honest there’s no way of knowing how that little valve performs when you are knee deep in sh1t at 3am. The valve is accessible but it’s irrelevant by this point anyway. Rainwater from the roof outside is already pouring into the courtyard and mixing with foul water presumably already in the system before it’s left to the street, so the whole lot stinks anyway. Who knows how much of it comes back from the street. I know it does though as I have a different manhole beyond that non return valve and that fills up to the brim inside my basement and overflows as well. Note this one is bolted down. How does it therefore leak? Extremes pressures!

Yes if this happens then you can’t use the toilet or shower. It’s astonishing that it happens in London. Many of our sewers are still from the Victorian era and funding has not been adequate to ensure upgrades. It has been a hot political topic for over a decade but nothing gets done as there’s no money.

To be fair it only affects people with basements and who are in places near sewage lines susceptible to blockages.

It never happened for 8 years of me living in this specific part of town. Then it happened and I was amazed. Then again two years later. Then another 2 years later (now).

We also have to go through the trauma of getting the wastewater company to BELIEVE that it is indeed a sewage surge, which they hate doing as it’s a huge liability for them to admit. This alone takes weeks of investigations. Last night I had to wait on a phone queue for 50 minutes!

---

<div class="post-metadata">

**Author:** ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)\
**Post date:** [24 September 2024 07:52 UTC](https://discourse.nodered.org/t/flooding-early-warning-system/91196/31 "2024-09-24T07:52:03Z")

</div>

Could you get useful info from Thames Water's sewage discharge API? If your sewer is blocked, presumably somewhere nearby they will be discharging.

It's startling to look at [sewagemap.co.uk](http://sewagemap.co.uk) though. After a couple of wet days the entire Thames catchment looks like it's running with raw sewage. So the API might give a fair few false positives.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/c/9/c9913a377db528d9145cd6e3b25e02c9bc77cf9a.jpeg)

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [24 September 2024 07:52 UTC](https://discourse.nodered.org/t/flooding-early-warning-system/91196/32 "2024-09-24T07:52:09Z")

</div>

Well, that is good to hear that you do have NRV's (or what ever you want to call them) in the system.

But what sort of amazes me is that _they_ weren't smart enough to have pressure valves that would vent to ...... the street (for example) if there is any sewage blockages and the associated back pressures.

You need to talk to your _council_ (water board/local member) and discuss this with them that these valves should be put on the _downstream_ side of the NRV's from buildings.  
That is: on the main pipe side.

---

<div class="post-metadata">

**Author:** ![hazymat](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hazymat/32/108159_2.png) [@hazymat](https://discourse.nodered.org/u/hazymat)\
**Post date:** [24 September 2024 08:05 UTC](https://discourse.nodered.org/t/flooding-early-warning-system/91196/33 "2024-09-24T08:05:53Z")

</div>

> [@jbudd](#):
>
> Could you get useful info from Thames Water's sewage discharge API?

Super idea. More data the better. That data looks good. Although they do tend to lie about things in my experience.

Perhaps "lie" is the wrong word, but they do everything in their power to evade. That means calling on as many legal loopholes in reporting data as possible. Given the fines they are now subject to.

I don't know the above to be true absolutely, but in my experience dealing with them from this end (consumer who has to behave like a lawyer / detective just to get them to admit to something without randomly closing complaint cases with no reason etc...) it's what I think must be happening on a corporate level. Knowing how Thames Water is funded it would make sense.

---

<div class="post-metadata">

**Author:** ![hazymat](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hazymat/32/108159_2.png) [@hazymat](https://discourse.nodered.org/u/hazymat)\
**Post date:** [24 September 2024 08:12 UTC](https://discourse.nodered.org/t/flooding-early-warning-system/91196/34 "2024-09-24T08:12:53Z")

</div>

> [@Trying\_to\_learn](#):
>
> But what sort of amazes me is that _they_ weren't smart enough to have pressure valves that would vent to ...... the street (for example) if there is any sewage blockages and the associated back pressures

Definitely not something we can do. Our local council (and many in London / UK now) are completely unresponsive. We have elected councillors, some are excellent but fighting an uphill struggle themselves. Wow the more I talk on this thread the more I realise our poor country is failing (I kind of know it already.) I think maybe I'll move to Aus, or better still to NZ? 🙂

Either way, venting to the street is not a good idea if the street is also flooding due to flash floods. Best keep the sewage below ground for health reasons... we have some history with sewage causing disease here in London 🙂

---

<div class="post-metadata">

**Author:** ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)\
**Post date:** [24 September 2024 08:17 UTC](https://discourse.nodered.org/t/flooding-early-warning-system/91196/35 "2024-09-24T08:17:58Z")

</div>

Sorry - off topic rant.

If I was CEO of a water company, I would probably be secretly maximising discharges to underline the truism that nothing can be done without huge increases in bills.

After all, the CEO's responsibility is the share price and dividend levels not environmental/health impact.

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [24 September 2024 08:19 UTC](https://discourse.nodered.org/t/flooding-early-warning-system/91196/36 "2024-09-24T08:19:01Z")

</div>

So it is better to back wash it into people's houses?

(Shudder)

It has to go somewhere.  
And if the preferred _route_ is blocked venting it to an unobstructed outlet is the best thing to do.  
Takes stress off the pipes that are already blocked.

> [@hazymat](#):
>
> we have some history with sewage causing disease here in London

I've heard something like that.

Basiljet (spelling?) was the one who first did the sewage.  
His .... grandson (or someone down the tree) owns Endemol....  
And so that family have gone from taking $hit from your house to pumping it back to you.

---

<div class="post-metadata">

**Author:** ![hazymat](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hazymat/32/108159_2.png) [@hazymat](https://discourse.nodered.org/u/hazymat)\
**Post date:** [24 September 2024 08:22 UTC](https://discourse.nodered.org/t/flooding-early-warning-system/91196/37 "2024-09-24T08:22:38Z")

</div>

> [@jbudd](#):
>
> the CEO's responsibility is the share price and dividend levels not environmental/health impact

#offtopic

Yes completely right, well we know that's what they have been doing. It's a dangerous strategy though when the political mood is to hugely increase fines for discharge. Well maybe it's not - investors can just bail out at any time. I think the new Labour government will step this up, they will probably increase fines to the point it's no longer viable for these investor led companies to continue, then use it as political leverage to take ownership.

They certainly have popular opinion behind them in terms of clamping down on dumping sewage into our waterways. Nobody likes that. So - it could work out well for a labour government. I'm not left wing generally but actually I do think the gov should have greater control over our utilities. I'm sure many would disagree...

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [24 September 2024 08:25 UTC](https://discourse.nodered.org/t/flooding-early-warning-system/91196/38 "2024-09-24T08:25:00Z")

</div>

So what's the story with the sewage tunnel that is/was being dug near the Thames?

---

<div class="post-metadata">

**Author:** ![hazymat](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hazymat/32/108159_2.png) [@hazymat](https://discourse.nodered.org/u/hazymat)\
**Post date:** [24 September 2024 08:25 UTC](https://discourse.nodered.org/t/flooding-early-warning-system/91196/39 "2024-09-24T08:25:47Z")

</div>

> [@Trying\_to\_learn](#):
>
> So it is better to back wash it into people's houses?

Well no, but it's only a very small proportion of people's houses, and in the most part this is an "outside case".

> [@Trying\_to\_learn](#):
>
> It has to go somewhere.

I suppose the main aim is to get the sewage to where it should rightly, morally, go... into the river (/sarcasm)

> [@Trying\_to\_learn](#):
>
> So what's the story with the sewage tunnel that is/was being dug near the Thames?

I literally have no idea. We were due to have a section of the so called "super sewer" built literally 40 metres from our house, leading south to the Thames. (We are not far from river... thankfully far enough that I'm not writing here about Thames flooding which is a different story!)  
Netheravon Road (Chiswick), if you are looking on google maps....

Rumour started about this a decade ago. It hasn't happened, I can tell you that.

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [24 September 2024 08:27 UTC](https://discourse.nodered.org/t/flooding-early-warning-system/91196/40 "2024-09-24T08:27:03Z")

</div>

> [@hazymat](#):
>
> Wow the more I talk on this thread the more I realise our poor country is failing (I kind of know it already.)

Darn it, you are in danger of triggering a rant from me! About the state of our private water companies and the disgusting things that some top members of the Conservative party were/are up to. Turning back the clock to the worst excesses of the Victorian era.

> [@hazymat](#):
>
> maybe I'll move to Aus, or better still to NZ?

I've been to both - they both have their own issues to deal with I'm afraid. I'd be more likely to move to Norway. 🙂

> [@hazymat](#):
>
> I suppose the main aim is to get the sewage to where it should rightly, morally, go

Into the houses of the water company execs!! 😈

[Previous page](https://discourse.nodered.org/t/flooding-early-warning-system/91196.md?page=1)

[Next page](https://discourse.nodered.org/t/flooding-early-warning-system/91196.md?page=3)
