Help with PLEG on water detection system

Here is are my water detection schemes that I plan on implementing:

Devices in system:

[Manual shutoff valve from meter (not Z-wave controllable) on inside water line, after bifurcation into inside and outside water lines)

Automated shutoff valve (downstream of manual shutoff valve, and on inside water line)

Flow meter capable of detecting flow (on or off) as well as too much (default set at 5 gem(downstream of automated shutoff valve) and on inside water line)

8 water leak sensors/detectors inside house near plumbing:

Scenario #1. Water flow for too long (30 minutes will be initial time used to trigger shut off valve)
a. Water flow detected on flow meter → Timer begins counting
b. If timer ≥ 30 minutes → Automated water valve turns off water
c. No water flow detected on flow meter (for first 30 minutes) → Timer reset to zero (Automated water valve would then need to be turned on manually for leak detection and then again after repair).

Scenario #2. Water flow rate too high. [
a. Water flow rate of ≥ 5 gpm → Automated water valve turns off water (Automated water valve would then need to be turned on manually for leak detection and then again after repair)

Scenario 3. Water detection in house
a. Water sensors detect water → Automated water valve turns off water (Automated water valve would then need to be turned on manually for leak detection and then again after repair)

I am pretty certain scenarios 2 and 3 can be handled in scenes on my Vera Plus (uI7). However, I don’t think scenario #1 can be handled in scenes. So am I on the right track for handling it with PLEG and are there other issues with which I should be concerned?

#1 you maybe able to do it in Scenes and in PLEG you won’t need a timer (but can use one if you choose). Timer will be on the 30 min on the dot. NOW is within a min. of the 30 min and should be easier and good enough for what you need.

Check out this thread and download the PDF “PLEG BASICS” for help.
http://forum.micasaverde.com/index.php?topic=21603.0

Working with time starts on Page 14 with some reading info.

The top of page 16 gives you an example of what you need but they used a light (on for more then 5 min.) being on instead of water running. It’s the same.

PLEG works off your inputs and more importantly the name you name them. Without seeing what you have everything named we can only give you ideas vs give you the exact copy and paste answer.

You should start by posting a status report.

Also did you end up getting everything installed?

[quote=“integlikewhoa, post:2, topic:196392”]#1 you maybe able to do it in Scenes and in PLEG you won’t need a timer (but can use one if you choose). Timer will be on the 30 min on the dot. NOW is within a min. of the 30 min and should be easier and good enough for what you need.

Check out this thread and download the PDF “PLEG BASICS” for help.
http://forum.micasaverde.com/index.php?topic=21603.0

Working with time starts on Page 14 with some reading info.

The top of page 16 gives you an example of what you need but they used a light (on for more then 5 min.) being on instead of water running. It’s the same.

PLEG works off your inputs and more importantly the name you name them. Without seeing what you have everything named we can only give you ideas vs give you the exact copy and paste[/quote]

I have read that basic PLEG PDFs file and have a sense of how PLEG works but it still foreign ground for me. I am trying to assimilate it. I was trying to outline the logic in how I would approach it. So you think I could handle scenario #1 in scenes and don’t need to use PLEG for that? I am uncertain as to how I could ensure that the water had flowed for 30 minutes continuously in Vera scenes and thus thought I needed PLEG to accomplish that. The other two scenarios should be able to be handled by Vera scenes though.

No, I haven’t installed these yet. Just trying to get a jump on I will handle scenario #1, presumably with PLEG. Just trying to get the logic down for how I would approach it when the time comes.

For me water is valuable … I only ha e rain water collection. In Vera if you have a 30 minute delayed action to turn off the water and vera reboots during that time … your water may run until the next time your scene runs.

[quote=“leedavidr, post:3, topic:196392”]I have read that basic PLEG PDFs file and have a sense of how PLEG works but it still foreign ground for me. I am trying to assimilate it. I was trying to outline the logic in how I would approach it. So you think I could handle scenario #1 in scenes and don’t need to use PLEG for that? I am uncertain as to how I could ensure that the water had flowed for 30 minutes continuously in Vera scenes and thus thought I needed PLEG to accomplish that. The other two scenarios should be able to be handled by Vera scenes though.

No, I haven’t installed these yet. Just trying to get a jump on I will handle scenario #1, presumably with PLEG. Just trying to get the logic down for how I would approach it when the time comes.[/quote]

I can’t really confirm or deny that #1 does work or is a way for it to work on the stock scenes. I thought you might be able to but I very well could be wrong.

PLEG is a 3 step process that start by you adding your Inputs or triggers.

Then creating a condition based on those triggers

Then creating a action to do when the condition is true.

In order for someone to write out a condition for you, we need to know the inputs/triggers and names and if its true or false. So you will see general ideas on how to write a condition but it won’t be a copy paste.

So on page 16 opf the pdf at the top you can use this example

LightOff = LightOn and (LightOn; Now > 5:00)

Changed a bit to fit your needs.

WaterFlowing30 = WaterFlowing and (WaterFlowing; Now > 30:00)

This says water is “currently flowing” and “Water has been flowing for more then 30 min.”

Now “WaterFlowing30” is just the name of the condition (I made up) and “WaterFlowing” is the name of the trigger or input (I also made up) and its based on when the meter shows flowing, you have to tie those together in step one creating the input/triggers.

Vera’s reboot randomly? ;D

For me the pool dribbles and runs all day so the water says running 90% of the day anyways. I have sprinklers that run more then 30 min. Showers are less but any combination can easily throw me over a 30min time. I have had to abandon much use of the flowing vs. not flowing mostly due to pool. Sprinklers and water softner flushes can be scheduled and vera can ignore them. Other things can be based on being away so showers, sinks, and normal water usage devices can be set to ignore if your home.

Also the meter can be set to how often it updates when water is flowing, default is every min.

I assume the timer when either continue counting upon reboot or would start over again. I guess you think it wouldn’t start again until the flow was shut off and restarted. I don’t know the answer to that, but note that there is some redundancy in the system with the 8 water leak sensors (scenario #3).

And it is ironic that I have water issues from plumbing in a house that’s in the desert.

[quote=“integlikewhoa, post:5, topic:196392”][quote=“leedavidr, post:3, topic:196392”]I have read that basic PLEG PDFs file and have a sense of how PLEG works but it still foreign ground for me. I am trying to assimilate it. I was trying to outline the logic in how I would approach it. So you think I could handle scenario #1 in scenes and don’t need to use PLEG for that? I am uncertain as to how I could ensure that the water had flowed for 30 minutes continuously in Vera scenes and thus thought I needed PLEG to accomplish that. The other two scenarios should be able to be handled by Vera scenes though.

No, I haven’t installed these yet. Just trying to get a jump on I will handle scenario #1, presumably with PLEG. Just trying to get the logic down for how I would approach it when the time comes.[/quote]

I can’t really confirm or deny that #1 does work or is a way for it to work on the stock scenes. I thought you might be able to but I very well could be wrong.

PLEG is a 3 step process that start by you adding your Inputs or triggers.

Then creating a condition based on those triggers

Then creating a action to do when the condition is true.

In order for someone to write out a condition for you, we need to know the inputs/triggers and names and if its true or false. So you will see general ideas on how to write a condition but it won’t be a copy paste.

So on page 16 opf the pdf at the top you can use this example

LightOff = LightOn and (LightOn; Now > 5:00)

Changed a bit to fit your needs.

WaterFlowing30 = WaterFlowing and (WaterFlowing; Now > 30:00)

This says water is “currently flowing” and “Water has been flowing for more then 30 min.”

Now “WaterFlowing30” is just the name of the condition (I made up) and “WaterFlowing” is the name of the trigger or input (I also made up) and its based on when the meter shows flowing, you have to tie those together in step one creating the input/triggers.[/quote]

Thanks. That’s a big help. The issue about rebooting is one that I will need to work on as well depending on how the flow meter reacts to that. I can test that.

The flow meter has a battery backup and it will just keep on counting up. When Vera is back up the next report will be the new number.

The issue with VERA rebooting is the NOW vs. using a timer. I think what Richard was trying to say is that the easier way of using NOW does not work if during that time vera crashes or reboots. Timers I think will pick right back up and continue ticking vs. just starting over.

Richard can give more help on that area.

Waterflowing30 = Waterflowing and (Waterflowing; Now > 30.00).

So I got to thinking about this condition/ trigger. Does this means the condition would be met 30 minutes after water flowed or would the water need to be flowing that entire time in order for that condition to be met? Hopefully the latter.

In terms of there being issues with sprinklers or other things outside (like a pool), remember ithis would be for the inside the house line only and not for the outside line. So inside I cannot think of anything that would run continuously that long. Showers, baths, washing machines, dishwashers all would take less time than that, and that number could be titrated up or down, depending on one’s needs.

And finally the Vera going down issue: if the modem goes down, then I think Everything would be fine, since the zwave network should still be viable. However if my Vera plus goes down, there would be no connectivity between any of these devices in the system. Neither the sensors nor the flow meter would be able to send shutoff messages to the automated shutoff valve. The water would be turned off manually when we aren’t there for prolonged periods of times and we could shutoff the automated valve when we leave the property using a geofence.

One last question: I recieve messages 3-4 times per week indicating that my controller is down, frequently followed almost immediately by messages indicating that it is back up. Does this mean the controller is actually down or just remote access to it is down?

[quote=“leedavidr, post:10, topic:196392”]Waterflowing30 = Waterflowing and (Waterflowing; Now > 30.00).

So I got to thinking about this condition/ trigger. Does this means the condition would be met 30 minutes after water flowed or would the water need to be flowing that entire time in order for that condition to be met? Hopefully the latter.[/quote]

Latter, which is what we don’t only do
Waterflowing30 = Waterflowing; Now > 30.00

That would be the Former. And say only 30 min after water was flowing.

The Later has the a double condition or “AND” in it to help say it’s still flowing and has been flowing for 30min now. If the water stops flowing the condition goes false and when it restarts so does the timer.

[quote=“leedavidr, post:10, topic:196392”]In terms of there being issues with sprinklers or other things outside (like a pool), remember ithis would be for the inside the house line only and not for the outside line. So inside I cannot think of anything that would run continuously that long. Showers, baths, washing machines, dishwashers all would take less time than that, and that number could be titrated up or down, depending on one’s needs.[/quote] Yes, was more on my side then yours.

[quote=“leedavidr, post:10, topic:196392”]And finally the Vera going down issue: if the modem goes down, then I think Everything would be fine, since the zwave network should still be viable. However if my Vera plus goes down, there would be no connectivity between any of these devices in the system. Neither the sensors nor the flow meter would be able to send shutoff messages to the automated shutoff valve. The water would be turned off manually when we aren’t there for prolonged periods of times and we could shutoff the automated valve when we leave the property using a geofence.[/quote] Problem is not that it goes down and stays down or that you loose connection. It just that the “Now > 30.00” is going to start over if vera reboots. So if its 25 min into water flowing and it reboots it will have to run another 30 on top the 25 before it will trip your condition. I think a timer is based more on the clock and when it reboots it will recover and pickup where it left off. Rich will need to help you out more in this area. But I think rich was saying its better to use a timer not the “NOW”.

[quote=“leedavidr, post:10, topic:196392”]One last question: I recieve messages 3-4 times per week indicating that my controller is down, frequently followed almost immediately by messages indicating that it is back up. Does this mean the controller is actually down or just remote access to it is down?[/quote] Not sure.

Waterflowing; Now > 30.00
Will behave virtually the same way if Vera runs continuously or reboots 10 times before the 30 minute interval. [b]Now[/b] evaluates every minute, in this expression the the result can change anywhere from 30 to 31 minutes later. The only variation, is that last 60 seconds of variability is based on (even minutes) from when your Vera last restarted ..

[quote=“RichardTSchaefer, post:12, topic:196392”]

Waterflowing; Now > 30.00

Will behave virtually the same way if Vera runs continuously or reboots 10 times before the 30 minute interval.
Now evaluates every minute, in this expression the the result can change anywhere from 30 to 31 minutes later.
The only variation, is that last 60 seconds of variability is based on (even minutes) from when your Vera last restarted …[/quote]

So my understanding of this is that the use of “Now” would circumvent any issues with the Vera resetting except for the down time? Sorry, I just want to ensure I understand your answer.

PLEG does not have any problems with a Vera restarting.
The only problem that PLEG has is with triggers that are based on a specific time of the Day, say 10:15 and Vera is down at 10:15, It will not trigger until the next day.