remedy1234 Posted June 15, 2012 Posted June 15, 2012 Hello everyone, I wrote a program for my powder room with a motion sensor and a triggerlinc,I would like to be advised if there is a better way to do this.The problem I am having is the program does not enable sometimes.I want the light to stay on for 2 minutes if someone just walks in(I have the motion set on only programed light on to avoid the 1/2 sec. delay going through the ISY),stay on when the door closes,turns off in 20 seconds after the door opens,and override when switch it touched manually. Here it is Powder room on for 2 If Status '01-SLD-Powder Room' is On Then Wait 2 minutes Set '01-SLD-Powder Room' Off Else - No Actions - (To add one, press 'Action') Powder room door shut If Status '01-TL-Powder Room-Opened' is Off Then Stop program 'Powder Room Garage-2' Set '01-SLD-Powder Room' On Else - No Actions - (To add one, press 'Action') Powder Room Off If Status '01-SLD-Powder Room' is On And Control '01-TL-Powder Room-Opened' is switched On Then Disable Program 'Powder Room Garage-2' Wait 20 seconds Set '01-SLD-Powder Room' Off Enable Program 'Powder Room Garage-2' Enable Program 'Powder Room Garage-2' Else - No Actions - (To add one, press 'Action') Powder room override If Control '01-SLD-Powder Room' is switched On Or Control '01-SLD-Powder Room' is switched Off Then Stop program 'Powder Room Garage-2' Stop program 'Powder Rm. Door shut' Else - No Actions - (To add one, press 'Action')
TJF1960 Posted June 15, 2012 Posted June 15, 2012 Couple of questions. Which program doesn't enable sometimes? By enable do you mean another program is supposed to run and enable it and it is not? Or do you mean it doesn't run when it should based on status? How is the motion sensor set up. Sounds like it is directly linked to "01-SLD-Powder Room" is that correct? If so what is the timeout on the MS set for? What exactly happens when the program doesn't enable? The light stays on or doesn't turn on? Thanks, Tim
apostolakisl Posted June 16, 2012 Posted June 16, 2012 I can almost guarantee you that your problem is that during the 20 second wait, something happens that re-triggers the program to false. If Status '01-SLD-Powder Room' is On And Control '01-TL-Powder Room-Opened' is switched On The above 2 statements are triggers for the program. If the status of the light changes during the 20 second wait, then the program re-evaluates to false, and the enable lines below never get run. Then Disable Program 'Powder Room Garage-2' Wait 20 seconds Set '01-SLD-Powder Room' Off Enable Program 'Powder Room Garage-2' Enable Program 'Powder Room Garage-2' The way to avoid this problem is to split the program into 2. If Status '01-SLD-Powder Room' is On And Control '01-TL-Powder Room-Opened' is switched On Then Run program 2 then clause Program 2 If blank Then Disable Program 'Powder Room Garage-2' Wait 20 seconds Set '01-SLD-Powder Room' Off Enable Program 'Powder Room Garage-2' Enable Program 'Powder Room Garage-2'
oberkc Posted June 16, 2012 Posted June 16, 2012 I have no major logic change suggestions. However, like some of the others, I suspect your problems are related to "status" of some devices, rather than "control", and how this can interrupt execution of your programs. I have not given it great thought, but my first suggested change: Powder room on for 2 If Control 'motion sensor' is On [color=#BF0040]<<< try using a control from the motion sensor[/color] Then Wait 2 minutes Set '01-SLD-Powder Room' Off Else - No Actions - (To add one, press 'Action') I also agree with apostolakisl...something is interrupting your 20-second wait and I suspect it has to do with the "status" condition in your third program. Try, instead: Powder Room Off If Control '01-TL-Powder Room-Opened' is switched On [color=#BF0000]<<< Then Disable Program 'Powder Room Garage-2' <<< am not sure that this serves any useful purpose Wait 20 seconds Set '01-SLD-Powder Room' Off Enable Program 'Powder Room Garage-2' [color=#BF0040]<<<< One time is enough[/color] Else - No Actions - (To add one, press 'Action')
remedy1234 Posted June 16, 2012 Author Posted June 16, 2012 TJF1960 Wrote: Couple of questions. Which program doesn't enable sometimes? By enable do you mean another program is supposed to run and enable it and it is not? Or do you mean it doesn't run when it should based on status? How is the motion sensor set up. Sounds like it is directly linked to "01-SLD-Powder Room" is that correct? If so what is the timeout on the MS set for? What exactly happens when the program doesn't enable? The light stays on or doesn't turn on? It does not enable "powder room garage 2",The motion is directly linked to the SLD and is set for ON only.Time out is set for .5 and the light sometimes stays on. apostolakisl wrote: I can almost guarantee you that your problem is that during the 20 second wait, something happens that re-triggers the program to false. If Status '01-SLD-Powder Room' is On And Control '01-TL-Powder Room-Opened' is switched On The above 2 statements are triggers for the program. If the status of the light changes during the 20 second wait, then the program re-evaluates to false, and the enable lines below never get run. I think the problem is kids or company hitting the switch in the 20 seconds oberkc wrote: I have no major logic change suggestions. However, like some of the others, I suspect your problems are related to "status" of some devices, rather than "control", and how this can interrupt execution of your programs. I have not given it great thought, but my first suggested change: I changed it to what you suggested,thank you it solves all the problems I have a question about changing "status" to "control" on the motion sensor or any device.What is the protocol for setting it to control? Again thank you everybody I'll try to come up with a better one!
oberkc Posted June 17, 2012 Posted June 17, 2012 What is the protocol for setting it to control? "Status" will trigger an evaluation (and resultant execution) on ANY status change (on, off, brighten, dim, etc...) for ANY reason (directly controlled, or otherwise). "Control" will trigger an evaluation only upon reciept of the specific command ("control is set to on" will response only to "on" commands), and, I believe, based only upon that specific device initiating the change (not when the device is, itself, responding to another controller).
thruster999 Posted June 17, 2012 Posted June 17, 2012 Hello Below are the programs I wrote to deal with my Bathroom Light and different length timeouts to deal with specific situtations. I also use a Motion Sensor and a Triggerlinc. NOTE: My Motion Sensor is setup to be always ON (ON Commands only), to detect as Motion is Sensed. IOW I have programed timers. I use the Motion Sensor to detect initial presence in the room and the TriggerLinc to determine if the Bathroom Door has been closed at some point. The Motion Detection programs are also used for FAN timers in the Bathroom as well. So - this is what it does 1. If the Batroom door is not closed (detected w Triggerlinc) a variable short timer is tiggered on movement. So if you walk in and out quick, ie you took a leak and left - the timer is short 2. If the door is closed after exiting, the timer remains short 3. If there is motion in the bathroom and the door is closed, you are taking a dump or putting on makup, a long timer is activated 4. The long timer is deactivated when you leave the room, regardless of the length of time you are in the bathroom, and a short timer is reactivated ie You open the door and leave. First Setup an "empty" program call 'Motion Bathroom' which will be set to True when there is motion sensed in the bathroom Setup a State variable called Door_Closed_Bathroom which is set to 1 when Triggerlinc is Closed, and 0 when Open (you have to write this program) Motion Detected Program: If Control 'Bathroom-Sensor' is switched On And Program 'Motion Bathroom' is False Then Run Program 'Motion Bathroom' (Then Path) Else - No Actions - (To add one, press 'Action') ============================ Reset Bathroom Motion Program: (All timers are FALSE ie have timed out because there is no more motion - Set Motion Bathroom to False) If Program 'Timer Motion Bathroom Default' is False And Program 'Timer Motion Bathroom Overide' is False Then Wait 10 seconds Set 'Bathroom Light' Off Run Program 'Motion Bathroom' (Else Path) Else - No Actions - (To add one, press 'Action') ================================= Timer Programs Timer Motion Bathroom Default: Overide is Off, iow Door is not closed, short timer If ( $Door_Closed_Bathroom is 0 And ( Control 'Bathroom-Sensor' is switched On Or Status 'Bathroom Light' is not Off ) ) Or ( Status 'Bathroom Light' is not Off And $Door_Closed_Bathroom is 1 ) Then Wait 2 minutes and 15 seconds Run Program 'Timer Motion Bathroom Default' (Else Path) Else - No Actions - (To add one, press 'Action') =========================================== Timer Motion Bathroom Overide: Motion is detected while you are in the bathroom after the door has been closed - turn the long timer on If $Door_Closed_Bathroom is 1 And Control 'Bathroom-Sensor' is switched On Then Stop program 'Timer Motion Bathroom Default' Run Program 'Timer Motion Bathroom Default' (Else Path) Wait 1 hour Run Program 'Timer Motion Bathroom Overide' (Else Path) Else - No Actions - (To add one, press 'Action') BTW with these programs its easy to add Fan Timers and an Overide (ie I double tap the lights) keeping the lights on whether the door is open or not. Also I kept this example simple with only two timers. I actually have 4 for different times of the day. For example I have a slightly longer timer than the Default timer for morning prep. Just make sure to make sure these are aslo False when resetting the Motion Detection programs.
remedy1234 Posted June 19, 2012 Author Posted June 19, 2012 Hi oberkc, Thanks for the info on the control/status! After using the changed program If Control '01-TL-Powder Room-Opened' is switched On [color=#BF0000]<<< Then Disable Program 'Powder Room Garage-2' <<< am not sure that this serves any useful purpose Wait 20 seconds Set '01-SLD-Powder Room' Off Enable Program 'Powder Room Garage-2' [color=#BF0040]<<<< One time is enough[/color] Else - No Actions - (To add one, press 'Action') I had to put the Disable Program 'Powder Room Garage-2' Back in,when the door closed and there was movement the If Status '01-SLD-Powder Room' is On Then Wait 2 minutes Set '01-SLD-Powder Room' Off Else - No Actions - (To add one, press 'Action') Would kick in, I think I got it now.Thanks again for everyones help.
Recommended Posts