belias Posted November 5, 2013 Posted November 5, 2013 (edited) 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. Functionality1a - 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 Sensor2a - Add the leak sensor device to the ISY, for this example we'll call it Kitchen Sink2b - Create a state variable called sLeakKitchenSink; set Init = 1 and Value = 12c - 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 ComponentsThese 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-UPIf $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 ActivationIf $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 ProblemIf ( 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 sent4. Brief Explanation4a - 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 Sensor5a - Add device5b - Add state variable (sLeakSensorName)5c - Add programs: Variable Control 1, Variable Control 2, Variable Control 35d - Modify Leak Startup program5e - Modify Leak Sensor Activation program and Leak Sensor Activation notification5f - Modify Leak Sensor Problem program and Leak Sensor Problem notification5g - Test leak sensor in "wet" mode and ensure notification is sentEdit 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. Edited December 15, 2014 by belias 8 2
Michel Kohanim Posted November 5, 2013 Posted November 5, 2013 Hi belias, This is excellent and thanks so very much for sharing. May I have your permission to put a link to this post in our Wiki under examples? Thanks again. With kind regards, Michel
belias Posted November 5, 2013 Author Posted November 5, 2013 Sure - hope it's useful. Thanks. - Brian
Michel Kohanim Posted November 5, 2013 Posted November 5, 2013 Thanks so very much Brian! With kind regards, Michel
chrsb Posted November 15, 2013 Posted November 15, 2013 Thank you for the detailed post!! I just got my 2 sump pump sensors installed no problems, everything works!
bleepblorp Posted November 15, 2013 Posted November 15, 2013 I agree! Thanks for sharing. I just set this up with my leak sensors. I've not implemented a watchdog in any of my previous ISY projects. Very cool!
jzsjr Posted November 23, 2013 Posted November 23, 2013 Thank you for this excellent program. I had a very simple on/off send email notification for my leak sensors before but have switch them all over to your setup. thanks again, Jim
jzsjr Posted November 26, 2013 Posted November 26, 2013 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
LeeG Posted November 26, 2013 Posted November 26, 2013 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')
belias Posted November 26, 2013 Author Posted November 26, 2013 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
jzsjr Posted November 26, 2013 Posted November 26, 2013 My firmware is current (4.0.5) but my leak sensors were installed before 4.0.1 so I'll have to re-install. Thank you for the information. If anyone is interested Costco.com is selling the leak sensors for 4 for $99.99 for members. thanks again, Jim
jzsjr Posted November 27, 2013 Posted November 27, 2013 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
MikeD Posted November 28, 2013 Posted November 28, 2013 If anyone is interested Costco.com is selling the leak sensors for 4 for $99.99 for members. Thanks, I was about to order some with the 20% Smarthome sale going on. Costco is a better deal! ~Mike
MWareman Posted November 28, 2013 Posted November 28, 2013 If anyone is interested Costco.com is selling the leak sensors for 4 for $99.99 for members.thanks again, Jim That's a great deal. Thanks!
Teken Posted November 28, 2013 Posted November 28, 2013 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
The_Penguin Posted November 30, 2013 Posted November 30, 2013 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.
PurdueGuy Posted November 30, 2013 Posted November 30, 2013 Thanks belias! I just set mine up for my one leak sensor, with 2 more on the truck for delivery from SmartHome!
MikeD Posted December 1, 2013 Posted December 1, 2013 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
MWareman Posted December 2, 2013 Posted December 2, 2013 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.
tome Posted December 8, 2013 Posted December 8, 2013 I'll add my thanks as well!! I just added three and they seem to be working great. Tom
benpeart Posted December 10, 2013 Posted December 10, 2013 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 1
belias Posted December 10, 2013 Author Posted December 10, 2013 Sure - hopefully this helps. It's in the "Schedule" section but a little hidden... 1 1
Teken Posted December 12, 2013 Posted December 12, 2013 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. 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. - 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? Has anyone seen such a thing? All the others are white but this one unit looks like a busted *** banana. 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 . . .
nadler Posted December 18, 2013 Posted December 18, 2013 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
MikeD Posted December 19, 2013 Posted December 19, 2013 - I also received a unit that has a yellow stained antenna? Has anyone seen such a thing? All the others are white but this one unit looks like a busted *** banana. 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
Recommended Posts