calberrt Posted September 10, 2015 Posted September 10, 2015 Hi All, If anyone can provide me with a bit of advice here it would be greatly appreciated. I have a program that turns the back door lights on when the sliding door is open to let the dog out between 9:15 pm to 15 minutes after sunset. Anyone have any idea why or things I could check to make sure it's setup right on my ISY. Here's the program Backyard Lights Night - [iD 0018][Parent 0060]If From 9:15:01PM To Sunrise + 15 minutes (next day) And ( Control 'Sliding Door Open' is switched On And $Dog_Out is 0 ) Then Set 'Backyard Keypad' On Set Scene 'Main Floor / Landscape Lights On' On Wait 15 seconds $Dog_Out = 1 Else - No Actions - (To add one, press 'Action') I also have a program that will turn the lights off and set Dog_Out = 0 again. I will include incase that is where the issue is. Backyard Lights Night Off - [iD 0019][Parent 0060]If From 9:15:01PM To Sunrise + 15 minutes (next day) And ( Control 'Sliding Door Open' is switched On And $Dog_Out is 1 ) Then Wait 20 seconds Set 'Backyard Keypad' Off Set Scene 'Main Floor / Landscape Lights On' Off Wait 15 seconds $Dog_Out = 0 Else - No Actions - (To add one, press 'Action') Any input would be appreciated. Thanks
LeeG Posted September 10, 2015 Posted September 10, 2015 (edited) The lights will not turn Off if that is the symptom you are asking about. As a side note it is good to to use $i.... and $s..... to indicate Integer or State variable Assuming $Dog_Out is a State variable, by the time the variable is set to 1 the "Control" event will be long gone so the second Program is never True. If From 9:15:01PM To Sunrise + 15 minutes (next day) And $Dog_Out is 1Then If there are other symptoms adding that information would help. Actually dropping the time range would avoid the small chance the time range would expire before the Then Wait completed. If $Dog_Out is 1Then Edited September 10, 2015 by LeeG
Xathros Posted September 10, 2015 Posted September 10, 2015 (edited) The lights will not turn Off if that is the symptom you are asking about. As a side note it is good to to use $i.... and $s..... to indicate Integer or State variable Assuming $Dog_Out is a State variable, by the time the variable is set to 1 the "Control" event will be long gone so the second Program is never True. If From 9:15:01PM To Sunrise + 15 minutes (next day) And $Dog_Out is 1 Then If there are other symptoms adding that information would help. Actually dropping the time range would avoid the small chance the time range would expire before the Then Wait completed. If $Dog_Out is 1 Then I don't actually see anything wrong with the logic here aside from the possibility of the lights being stuck on after sunrise+15. Even if $Dog_Out is a state var, the logic seems to work for me. That said, it would work just as well with an integer var. calberrt- What exactly is the problem you see? Why not make the keypad part of the landscape scene to simplify things. Why start the time range at 9:15 rather than sunset +20 mins or something similar that would adjust for the seasons automatically? -Xathros Edited September 10, 2015 by Xathros
LeeG Posted September 10, 2015 Posted September 10, 2015 $Dog_Out must be a State variable. Otherwise the second Program does not trigger.
Xathros Posted September 10, 2015 Posted September 10, 2015 $Dog_Out must be a State variable. Otherwise the second Program does not trigger. Here is the If copied from the OP's second program: If From 9:15:01PM To Sunrise + 15 minutes (next day) And ( Control 'Sliding Door Open' is switched On And $Dog_Out is 1 ) Both the programs include a Control event to trigger on. I don't think the intent was for the variable to trigger but rather the Control event. Only using the variable to track the dog's location (in / out). In this case state or int should work just as well no ? -Xathros
LeeG Posted September 10, 2015 Posted September 10, 2015 Yes. My initial analysis of how the two Programs interact was wrong. It does take two door open actions for the Programs to work. Now I don't know what the issue is.
calberrt Posted September 10, 2015 Author Posted September 10, 2015 Hi Everyone, sorry for the delayed response as work rules my life until the evening time. I'm sure we can all relate The problem that I am having is this. The program will work flawlessly prior to midnight but doesn't seem to work after midnight. The variable Dog_Out is set up as a state variable, This variables intention was solely to track the state of our dog, 0 - inside, 1 - outside I intended the trigger to be the opening of the sliding door (controlled by a open/close sensor) Xathros - The program will work flawlessly prior to midnight but doesn't seem to trigger after midnight and I'm not quite sure why The two items are not included in the same scene after 9:15pm as "from sunset to 9:15pm", I don't want to control them together as the landscape lighting is linked to not only the backyard landscape lighting but also controls the front landscape lighting as well (run off the same transformer and appliancelinc) The program for pre-9:15pm (programmed similar with only different time constraints) functions fine. I hope this helps. Again, for some reason, it works fine prior to midnight but does not seem to trigger when I wake up first thing in the morning to let the dog out. Any ideas?
Xathros Posted September 10, 2015 Posted September 10, 2015 (edited) Again, for some reason, it works fine prior to midnight but does not seem to trigger when I wake up first thing in the morning to let the dog out. Any ideas? My initial guess would be that something is preventing the ISY from hearing the control events. Next step would be to capture a level 3 event trace of the sliding door opening and closing a few times after midnight. Post the results and we should be able to learn something from that. Any folder conditions that might include a time range by chance? Yes. My initial analysis of how the two Programs interact was wrong. It does take two door open actions for the Programs to work. Now I don't know what the issue is. Phew! Had me worried I was missing something there... -Xathros Edited September 10, 2015 by Xathros
calberrt Posted September 13, 2015 Author Posted September 13, 2015 Hi Everyone, Just wanted to let you know that I got everything sorted out. I'm not quite sure what happened by the program now just works. Thanks for confirmation that my programming logic was correct
Recommended Posts