Jump to content

Leak Sensors - A (Suggested) Complete Program Package


belias

Recommended Posts

I have 6 leak sensors that I have spent the past few months integrating in with the ISY. It took a while to get them to perform as I wanted, and I figured this might be helpful to others trying to figure out the same thing. Here goes...

1. Functionality
1a - A notification is sent twice a day for any problem with a leak sensor (i.e. missed heartbeat) at 9:00am and 6:00pm. This avoids the inevitable single email that I ignore and the problem goes uncorrected for weeks...
1b - A notification is sent immediately when a leak sensor is activated (and also again twice daily as above). This email is not sent repeatedly even if the sensor is "fluttering" at first activation, which it commonly does.
1c - The email notification shows the status of EVERY leak sensor (heartbeat received as expected, heartbeat missed, sensor activation, etc.)
1d - If the program monitoring heartbeat signals somehow fails or is shut down, a problem notification is sent.
1e - All functionality should survive an ISY reboot without user intervention.

2. Setup - First Leak Sensor
2a - Add the leak sensor device to the ISY, for this example we'll call it Kitchen Sink
2b - Create a state variable called sLeakKitchenSink; set Init = 1 and Value = 1
2c - Create a program called KitchenSink - Variable Control 1:

If
Status 'Leak Sensors / Kitchen Sink-Wet' is On

Then
$sLeakKitchenSink = 9

Else
Wait 10 seconds
$sLeakKitchenSink = 1

2d - Create a program called KitchenSink - Variable Control 2:
If
Control 'Leak Sensors / Kitchen Sink-Heartbeat' is switched On
Or Control 'Leak Sensors / Kitchen Sink-Heartbeat' is switched Off

Then
$sLeakKitchenSink = 1
Wait 25 hours
$sLeakKitchenSink = 2

Else
- No Actions - (To add one, press 'Action')

2e - Create a program called KitchenSink - Variable Control 3:
If
$sLeakKitchenSink is 1
And Time is Last Run Time for 'KitchenSink - Variable Control 2' + 26 hours

Then
Wait 5 seconds
$sLeakKitchenSink = 3

Else
- No Actions - (To add one, press 'Action')

Note: For ease of explanation, assume a second leak sensor named "Storage Room" has also been added using the steps above.

3. Setup - Core Components
These only have to be set-up once, regardless of the number of leak sensors.

3a - Create an integer variable called iStartUp; set Init = 0 and Value = 1.
3b - Create a custom notification called "Leak Sensor Activation". This is the content I use:
A water leak has been detected at the location below with a status value of "9":

Kitchen Sink: (((Use "add variable" to add your sLeakKitchenSink variable here)))
Storage Room: (((Use "add variable" to add your sLeakStorageRoom variable here)))


---Status Key---
1 = Heartbeat OK (normal status)
2 = Heartbeat missed
3 = Heartbeat check program not running
9 = Leak detected
-----------------

3c - Create a custom notification called "Leak Sensor Problem". This is the content I use:
A problem has been detected with a leak sensor. Details below:

Kitchen Sink: (((Use "add variable" to add your sLeakKitchenSink variable here)))
Storage Room: (((Use "add variable" to add your sLeakStorageRoom variable here)))


---Status Key---
1 = Heartbeat OK (normal status)
2 = Heartbeat missed
3 = Heartbeat check program not running
9 = Leak detected
----------------

Note 1: It may take up to 36 hours for a "heartbeat missed" signal to clear.

Note 2: Status Code 3 indicates the "Variable Control 2" program is not running for some reason.

3d - Create a program called Leak Startup and ENABLE RUN AT START-UP
If
$iStartUp is 0

Then
Run Program 'KitchenSink - Variable Control 2' (Then Path)
Run Program 'StorageRoom - Variable Control 2' (Then Path)
Wait 5 seconds
$iStartUp = 1

Else
- No Actions - (To add one, press 'Action')

** Set to run at start-up **

3e - Create a program called Leak Sensor Activation
If
$sLeakKitchenSink is 9
Or $sLeakStorageRoom is 9

Then
Send Notification to 'Brian' content 'Leak Sensor Activation'

Else
- No Actions - (To add one, press 'Action')

3f - Create a program called Leak Sensor Problem
If
(
Time is 9:00:00AM
Or Time is 6:00:00PM
)
And (
$sLeakKitchenSink is not 1
Or $sLeakStorageRoom is not 1
)

Then
Send Notification to 'Brian' content 'Leak Sensor Problem'

Else
- No Actions - (To add one, press 'Action')

3g - Test leak sensor in "wet" mode and ensure a notification is sent

4. Brief Explanation
4a - The 10 second wait in Variable Control 1 serves to stop multiple emails from being generated if the sensor "flutters" when it first activates.
4b - The Variable Control 2 program should always be in a "Running Then" state, looking for the heartbeat signal. If it's missed then it changes the variable to status = 2 which triggers a notification email.
4c - The Variable Control 3 program serves as a "watch-dog" for Variable Control 2. If it's stopped (manually, ISY issue, etc.), then it changes the variable to status = 3 which triggers a notification email.
4d - The iStartUp variable is initialized to 0 on start-up and this triggers the "Leak Startup" program to run. Without this program, the potential exists for a "dead" leak sensor to go undetected after the ISY starts up.

5. Procedure for Adding a New Leak Sensor
5a - Add device
5b - Add state variable (sLeakSensorName)
5c - Add programs: Variable Control 1, Variable Control 2, Variable Control 3
5d - Modify Leak Startup program
5e - Modify Leak Sensor Activation program and Leak Sensor Activation notification
5f - Modify Leak Sensor Problem program and Leak Sensor Problem notification
5g - Test leak sensor in "wet" mode and ensure notification is sent

Edit 11/26/2013: Variable Control 2 program now allows either an Off or On signal for the heartbeat. Thanks LeeG.

Edit 12/15/2014:  Added Wait 5 seconds to top of Variable Control 3 program.

Link to comment
  • 2 weeks later...
  • 2 weeks later...

Belias,

 

My variable control 2 program tripped the other day. I thought it had been more than 36 hours with no reset so I manually ran the if statement and now it is sitting back on "Running then." How is the automatic reset suppose to occur? How do I know manually if the heartbeat is actually working?

 

A question I should of asked earlier, in your variable control 2 program you show:

If

Control 'Leak Sensors / Kitchen Sink-Heartbeat' is switched On

 

Is kitchen-sink-heartbeat what you changed the default name of your leak sensor (dry) to? The sensors I have, for example, are called furnace-dry and furnace-wet. When I modified your program I used my furnace-dry in the variable control 2 program. Is this correct or am I missing something?

 

thanks,

Jim

Link to comment

The heartbeat message can contain On or Off depending on the Wet/Dry state of the Leak Sensor when the heartbeat message is sent. A Program testing for heartbeat should check for both conditions.

 

If
       Control 'Leak Sensor-Heartbeat' is switched On
    Or Control 'Leak Sensor-Heartbeat' is switched Off

Then
       Wait  25 hours 
       Send X10 'A10/All Lights On (5)'

Else
  - No Actions - (To add one, press 'Action')

Link to comment

Thanks for the positive feedback...glad people are finding this useful.

 

jzsjr: If you only see 2 nodes (wet and dry) for your leak sensors, you may have to update your ISY Firmware and remove/re-install the leak sensors. As of Firmware 4.0.1 (viewtopic.php?f=25&t=10770) the leak sensors should add with 3 nodes: dry, wet, and heartbeat. Then the programs should make more sense...

 

LeeG: Thank you - I didn't realize heartbeat messages could be either on or off...

 

 

- Brian

Link to comment

I added my two sensors back in and they are showing the appropriate, wet, dry and heartbeat. My next question and hopefully the last one is if I was to add an automatic shutoff valve would you simply add another then statement to the Leak Sensor Activation program or would it call for something more elaborate that escapes my abilities?

thanks,

Jim

Link to comment

Would anyone be willing to purchase and send this item to Canada for a fellow member?

 

I would pay for the shipping and the device cost via Pay Pal.

 

Please let me know as I just purchased four via SH today.

 

Teken . . .

 

 

Encrypted By: Phoenix Security Solutions

Link to comment
Would anyone be willing to purchase and send this item to Canada for a fellow member?

 

I would pay for the shipping and the device cost via Pay Pal.

 

Please let me know as I just purchased four via SH today.

 

 

A good Canadian source is aartech.ca, not as cheap as the Costco deal, but reasonable shipping from ON.

Link to comment

Thank you belias for posting. Just implemented your programs into my system. I currently only have one leak sensor although I do have 4 more on the way. Your programs are more elaborate than what I was running and are greatly appreciated!

~Mike

Link to comment

Belias,

 

I want to add to the chorus of thanks. I had a very basic program running the mostly worked, but given the importance of this I wanted something more reliable. I now have my 2 sensors under your programs control, and took advantage of the Costco deal to get 4 more. Most of my potential leak locations will soon be monitored.

 

Thanks again.

 

Michael.

Link to comment

I'm sure this is obvious but I've been beating my head against it for too long now without success. Hopefully someone can give me the simple answer.

 

In the code, you reference something called "Time" (example below):

 

And Time is Last Run Time for 'KitchenSink - Variable Control 2' + 26 hours

 

Where do I find this? I've searched every option but can't find any reference to it anywhere. Is this some special module I'm missing?

 

Thanks,

 

Ben

Link to comment

Belias,

 

I too would like to extend my thanks for such a well crafted program! I just completed all the variable programming and so far all appears to work just fine. :mrgreen: Some observations about this new sensor which many have noted before.

 

- I have no clue how anyone could use this sensor with out the aid of the ISY. During testing of the first 4 leak sensors, showed the change of state (wet/dry) to be instantaneous via the ISY UI?

 

- Others have indicated that they see their leak sensors when placed in water starts to flash the green LED? Mine simply flickers once when its placed in water and nothing else happens. :|

 

- If there wasn't a method to *monitor* the wet, dry, heart beat via e-mail / sms. I have no clue how anyone would start to trouble shoot these devices. :evil:

 

- Not all of the sensors are created equal. If I didn't have AP's in key locations the signal would never travel and be received by the Insteon network. So, make sure you have AP's in the areas, floors, zones you plan on using these devices. Otherwise you will not receive an alert from these devices.

 

- I also received a unit that has a yellow stained antenna? :shock: Has anyone seen such a thing? All the others are white but this one unit looks like a busted *** banana. :x

 

Once again the ISY has proven its power, flexibility, and community support in another Insteon product that could have went down the toilet! I am not sure how many people have wasted their time trying to trouble shoot this silly device. But, its safe to say I would have thrown these things straight into the garbage with out the support of all of you!

 

Thank You

 

Teken . . .

Link to comment

This might be of interest to some. In my email notifications I was able to add:

 

Leak Detected on ${sys.date} at ${sys.time12}

 

${sys.node.XX XX XX 2.name}: ${sys.node.XX XX XX 2.ST}

 

${sys.node.YY YY YY 2.name}: ${sys.node.YY YY YY 2.ST}

 

${sys.node.ZZ ZZ ZZ 2.name}: ${sys.node.ZZ ZZ ZZ 2.ST}

 

This gives me the ISY date and time the leak was detected (first line) and the name and status of the WET signal from each of my 3 sensors (one sensor per line). ON means a wet condition was sensed and OFF means status quo.

 

XX XX XX is the device ID. The 2 after the device ID indicates the condition of the WET sensor. Use 1 or 3 if you want the status of the heartbeat or Dry sensor.

 

Noel

Link to comment
- I also received a unit that has a yellow stained antenna? :shock: Has anyone seen such a thing? All the others are white but this one unit looks like a busted *** banana. :x

I also received one like this. Received three with an address beginning with 25 and this one has an address beginning with 21 so maybe it is from an older run. :?:

~Mike

Link to comment

Archived

This topic is now archived and is closed to further replies.


×
×
  • Create New...