MexicanRadio Posted June 13, 2014 Posted June 13, 2014 Ok, I thought this was going to be simple. But it's not: If Status 'GarageSideDoor.1 - DoorSenso' is not Off Then Wait 2 minutes Send Notification to 'uh-oh_squad_cell' content 'SecuritySMS' Else No Actions Apparently, (as the topic title says) I have brain damage, because after trying multiple variations, I can't get this program to work correctly. If I right click the program and "Run If", it works. Beyond that it never triggers. I'm trying to make this a general alert that this door, which gets left open way to often around here, lets me know it's been left open. Program is enabled. ISY-994i, version 4.2.3 (recently upgraded to ZS) is on the ISY and the UI, cache was cleared after install. The sensor is a hidden door sensor, and it seems that it correctly indicates state (pushing the button results in on/off shown on the ISY as one would expect). What am I doing wrong?
Michel Kohanim Posted June 13, 2014 Posted June 13, 2014 MexicanRadio, You would want to use Control and not Status. Programs based on Status are evaluated IF AND ONLY IF the status changes from its previous state. With Control, the programs are evaluated based on events generated by the device (i.e. the sensor is tripped, etc.). With kind regards, Michel
MexicanRadio Posted June 13, 2014 Author Posted June 13, 2014 Thanks Michel. I'm trying that now. The only line changed is the first, which now reads: If Control 'GarageSideDoor.1 - DoorSenso' is not switched Off I've just waited out the timeout and have received no notice.
MexicanRadio Posted June 13, 2014 Author Posted June 13, 2014 Note that I am not trying to detect a transition of state from door closed to door open, but rather to determine if it is staying/still open. The door has stayed open through the change. Later I'd like to add logic to only check during a certain time period, but first have to get the (I thought) simpler case working reliably. After Michel's suggested change, I believe this is the relevant portion of the Events log (Level 3): Fri 06/13/2014 15:46:06 : [iNST-SRX ] 02 50 2B.01.E7 00.00.04 C7 13 04 LTOFFRR(04) Fri 06/13/2014 15:46:06 : [std-Group ] 2B.01.E7-->Group=4, Max Hops=3, Hops Left=1 Fri 06/13/2014 15:46:06 : [D2D EVENT ] Event [2B 1 E7 4] [DOF] [4] uom=0 prec=-1 Fri 06/13/2014 15:46:06 : [ 2B 1 E7 4] DOF 4 Fri 06/13/2014 15:46:06 : [D2D EVENT ] Event [2B 1 E7 4] [sT] [0] uom=0 prec=-1 Fri 06/13/2014 15:46:06 : [ 2B 1 E7 4] ST 0 Fri 06/13/2014 15:46:07 : [MOD 5 5 1 16] 9810.000000 SmartMeter - Inst Demand = 0.9810kW-kWh Fri 06/13/2014 15:46:07 : [iNST-SRX ] 02 50 2B.01.E7 00.00.04 C7 13 04 LTOFFRR(04) Fri 06/13/2014 15:46:07 : [std-Group ] 2B.01.E7-->Group=4, Max Hops=3, Hops Left=1 Fri 06/13/2014 15:46:07 : [iNST-DUP ] Previous message ignored. Fri 06/13/2014 15:46:07 : [iNST-SRX ] 02 50 2B.01.E7 1C.FA.98 41 13 04 LTOFFRR(04) Fri 06/13/2014 15:46:07 : [std-Cleanup ] 2B.01.E7-->ISY/PLM Group=4, Max Hops=1, Hops Left=0 Fri 06/13/2014 15:46:07 : [iNST-DUP ] Previous message ignored. Fri 06/13/2014 15:46:07 : [iNST-SRX ] 02 50 2B.01.E7 13.01.04 C7 06 00 (00) Fri 06/13/2014 15:46:07 : [std-Group ] 2B.01.E7-->13.01.04, Max Hops=3, Hops Left=1 Fri 06/13/2014 15:46:07 : [iNST-INFO ] Previous message ignored. Fri 06/13/2014 15:46:08 : [iNST-SRX ] 02 50 2B.01.E7 13.01.04 C7 06 00 (00) Fri 06/13/2014 15:46:08 : [std-Group ] 2B.01.E7-->13.01.04, Max Hops=3, Hops Left=1 Fri 06/13/2014 15:46:08 : [iNST-INFO ] Previous message ignored.
LeeG Posted June 13, 2014 Posted June 13, 2014 What type of device is monitoring the door? The trace shows it issued an Off command ]Fri 06/13/2014 15:46:06 : [iNST-SRX ] 02 50 2B.01.E7 00.00.04 C7 13 04 LTOFFRR(04) which would not trigger the Program when using If Control and would drive the Else clause if using If Status (assuming the device was originally On)
MexicanRadio Posted June 13, 2014 Author Posted June 13, 2014 Hi Lee, It's a Hidden Door Sensor. What normally happens is that someone in the family opens the door (causing the the hidden door sensor, correctly, to turn ON) and then forgets it. So the door stands open all day (as it has today) and does NOT get a change on the sensor after the initial opening. This has resulted in everyone going off to bed, on multiple occasions, and leaving the door open all night (which, for what I am sure are obvious reasons, I would like to have not happen). What I want to do is receive a notice that the door has been left open, after some period of time (currently set at 2 minutes for test purposes). Eventually I intend to have it notify me as part of putting the house to bed for the night, along with other notices I'd like to have then. I believe I've tried both control and status commands at this point, and both testing for "On" and for "not OFF" as well as "Off" and "not On", with no luck. When I was earlier looking for status instead of control, the program ran and notified me properly (using the "Then" clause) if I right clicked it and select "Run iF" but it ONLY ran correctly under that circumstance.
LeeG Posted June 14, 2014 Posted June 14, 2014 Is the event trace of the door opening or closing? Is the Hidden Door Sensor set for 1 or 2 node operation (has no affect on how many nodes the ISY defines when adding to the ISY)?
MexicanRadio Posted June 14, 2014 Author Posted June 14, 2014 The event trace was made when no change in door position had occurred, just a change in the programming (see earlier messages in this thread). The door sensor is unmodified from as shipped, other than to set it to not waste battery operating the LED (which can't be seen when it is installed. I believe it ships as "single node".
LeeG Posted June 14, 2014 Posted June 14, 2014 The event trace is of the Heartbeat signal. It would not trigger If Control nor If Status. My error for not catching that sooner. Fri 06/13/2014 15:46:06 : [iNST-SRX ] 02 50 2B.01.E7 00.00.04 C7 13 04 LTOFFRR(04)
LeeG Posted June 14, 2014 Posted June 14, 2014 Here is an example of what needs to be coded in program If Control '2B.09.AE.1 - Door Sensor' is switched On And Control '2B.09.AE.1 - Door Sensor' is not switched Off Then Send X10 'A1/On (3)' Wait …. Else Send X10 'A1/Off (11)' When the door is opened the Then clause is driven. It would have Wait and whatever you want to happen if no Off (door closed) is received. When the Off is received the Else clause is driven. Assuming the Off is sent before the Wait completes in the Then nothing past the Wait happens. The X10 messages are a simple way to see which clause is driven. Not needed in actual implementation.
MexicanRadio Posted June 14, 2014 Author Posted June 14, 2014 Thanks, Lee. I'll give that a try as soon as I get a little time free, again. You would think, having been a maintenance coder many, many years ago, that this sort of thing would come back to me much more quickly than it is.... but, nooo...
MexicanRadio Posted July 14, 2014 Author Posted July 14, 2014 Follow up: Many issues kept me from returning to this topic for far too long. Here's the revised code that does what I need: If From 9:00:00PM To 7:00:00Am (Next Day) And Status 'GarageSideDoor.1 - DoorSenso' is On Then Wait 2 minutes Send Notification to 'uh-oh_squad_cell' content 'SecuritySMS' Else -No Actions Now if only my cellular service would deliver SMS in a consistent, timely fashion... Thanks for all the assistance. It was instrumental in helping me figure out what I needed to do.
Recommended Posts