toddhutch Posted December 18, 2017 Posted December 18, 2017 (edited) Question about logic, and seems like a bug. (I'm wondering if this is an issue with this release, as I had other fan related programs (That I was using earlier this year) that I thought were working before I upgraded to 4.6.2) I have a wait at the beginning of the then because I don't want the house to go dark until enough time has passed for my wife to be in her car and pulling out of the garage. However because the Elk Zone Violated is only briefly positive, it appears that the then statement starts to run but is stopped. I changed the the Elk Zone to Physical Status is open, and leave the door open, and the then statement will complete. If I close the door before the second wait time completes, the remainder of the then status doesn't complete. It is a work around to put the actions in another program, and have this initial program just kick off the other program? Is this best practice or work around? Wan is gone lights off - [iD 004B][Parent 0022] If $Wan_Works_Today is 1 And From 6:15:00AM For 1 hour And Elk Zone 'Garage Home Door' is Violated Then Wait 15 seconds Set Scene 'Living Room' Off Set Scene 'Family Room' Off Send X10 'A4/Off (11)' Set 'Christmas Tree' Off Wait 1 minute and 30 seconds Set Scene 'Frontyard' Off $Wan_Works_Today = 0 Set Elk Output 'Output 103' Off Else - No Actions - (To add one, press 'Action') ******** Update ******* The below code is working. Just confirmed this is working, after I added a wait at the beginning, as a test. I changed it back, and it is correctly showing Running 'Then' in the Activity column on the program summary page.Lime Grow Light - [iD 0054][Parent 0021] If Time is Sunrise + 30 minutes Then Set 'Lime Tree Lights' On Wait 12 hours Set 'Lime Tree Lights' Off Else - No Actions - (To add one, press 'Action') Best regards, Todd Edited December 18, 2017 by toddhutch
G W Posted December 18, 2017 Posted December 18, 2017 (edited) When the status changes, the Elk Zone program IF is no longer true and therefore the THEN stops executing. Edited December 18, 2017 by Gary Funk
toddhutch Posted December 18, 2017 Author Posted December 18, 2017 So this is expected, and when you put in a time condition like 3 minutes after sunrise that behaves differently?
G W Posted December 18, 2017 Posted December 18, 2017 So this is expected, and when you put in a time condition like 3 minutes after sunrise that behaves differently?No. That will turn on. However I would not rely on wait. I'd either use two programs or use FROM and TO for the time.
stusviews Posted December 18, 2017 Posted December 18, 2017 Two programs, with the wait in the second program instead of the first, is the usual solution. That's because if something occurs during the wait that causes the first program to evaluate as false, then the second program won't be affected--it will continue to run. 1
G W Posted December 18, 2017 Posted December 18, 2017 (edited) I would do two programs. If Time is Sunrise + 30 minutes Then Set 'Lime Tree Lights' On Else - No Actions - (To add one, press 'Action') If Time is Sunrise + 12 hours 30 minutes Then Set 'Lime Tree Lights' Off Else - No Actions - (To add one, press 'Action') Edited December 18, 2017 by Gary Funk
toddhutch Posted December 18, 2017 Author Posted December 18, 2017 (edited) Is the goal not to use the wait command in case that the ISY994i reboots? So which way is the best practice? Before the two responses above I set it up this way- Lime Grow Light - [iD 0054][Parent 0021] If Time is Sunrise Then Run Program 'Lime Grow Light - Trigger' (Then Path) Else - No Actions - (To add one, press 'Action') Lime Grow Light - Trigger - [iD 0065][Parent 0021] If - No Conditions - (To add one, press 'Schedule' or 'Condition') Then Set 'Lime Tree Lights' On Wait 12 hours Set 'Lime Tree Lights' Off Else - No Actions - (To add one, press 'Action') If what I put is best practice, then I should remove the first program, and put the kickoff in my sunrise program which already turns other items on in the morning. Edited December 18, 2017 by toddhutch
G W Posted December 18, 2017 Posted December 18, 2017 There is no best practice. Everyone does what works for them. Personally, I avoid long wait periods for various reasons; one being the possibility of a reboot.
toddhutch Posted December 18, 2017 Author Posted December 18, 2017 This seems to be a mind bender, how can you do a 12 hour shut off based on sunrise without using a wait command?
G W Posted December 18, 2017 Posted December 18, 2017 This seems to be a mind bender, how can you do a 12 hour shut off based on sunrise without using a wait command?How about this : If Time is Sunrise + 12 hours 30 minutes Then Set 'Lime Tree Lights' Off Else - No Actions - (To add one, press 'Action')
toddhutch Posted December 18, 2017 Author Posted December 18, 2017 Doh..... I shouldn't multitask, you posted that earlier. I'll start using that instead of wait. Thank you!
G W Posted December 18, 2017 Posted December 18, 2017 Doh..... I shouldn't multitask, you posted that earlier. I'll start using that instead of wait. Thank you! That is just one of the methods to use and my personal choice. With ISY there are always several ways to accomplish a goal.
stusviews Posted December 19, 2017 Posted December 19, 2017 Sometimes a wait is necessary, sometimes it's more a convenience. In any case, the goal is to not let the wait cause an unexpected result.
DrLumen Posted December 26, 2017 Posted December 26, 2017 Just curious, would this not work? IfTime is Sunrise + 30 minutes For 12 hoursThenSet 'Lime Tree Lights' OnElseSet 'Lime Tree Lights' Off Am I missing the meaning or a pitfall of For?
oberkc Posted December 26, 2017 Posted December 26, 2017 (edited) Just curious, would this not work? If Time is Sunrise + 30 minutes For 12 hours Then Set 'Lime Tree Lights' On Else Set 'Lime Tree Lights' Off Am I missing the meaning or a pitfall of For? I do not know whether it will "work" or not, since I do not know what it is you are trying to accomplish. The program above will simply turn the lights on as sunrise+30 and turn them off 12 hours later. Gary Funk's approach in post 6 would do the same thing, albeit with two programs. Unlike Gary, I prefer the single-program approach all other things being equal. Edited December 26, 2017 by oberkc
oberkc Posted December 26, 2017 Posted December 26, 2017 (edited) Is the goal not to use the wait command in case that the ISY994i reboots? There is no problem with using the wait command, so long you understand the consequences. In some cases, the wait statement can actually be very helpful. The big thing is understanding that wait (and repeats) can be interrupted when the program triggers. Obviously, this makes it imperative that one understands WHAT causes a program to trigger and manage this. Edited December 26, 2017 by oberkc
stusviews Posted December 27, 2017 Posted December 27, 2017 Just curious, would this not work? If Time is Sunrise + 30 minutes For 12 hours Which ISY version are you using? I don't see For 12 house as a conditional option in v.4+.
DrLumen Posted December 27, 2017 Posted December 27, 2017 Which ISY version are you using? I don't see For 12 house as a conditional option in v.4+. On 5.0.11b here. I guess that's why...
G W Posted December 27, 2017 Posted December 27, 2017 Which ISY version are you using? I don't see For 12 house as a conditional option in v.4+.I wasn't expecting the 12 house option until 6.x.
ScottAvery Posted December 27, 2017 Posted December 27, 2017 On 5.0.11b here. I guess that's why... I don't use 5.x yet, but usually "For" is used to create a loop, which I assume is why the feature was added, allowing you to do more in one program where version 4.x requires multiple programs. For scheduled events, "From" x "To" y is the standard method to do it in one program. Post #6 has it in two independent programs. There is no need to have one program calling another. You only need to separate into nested programs if there are multiple conditions that need to be evaluated independently. That makes it curious that you went to the effort to put your lime tree schedule in two nested programs but didn't put the "Wan is gone lights off" in nested programs. As you yourself noted and Gary confirmed in post #2, the zone changing status again breaks the chain and stops the program. That is the time that you would want to break things up. If you still need help with that one you may need to explain exactly what behavior you are looking for and where else the variable gets manipulated.
apostolakisl Posted December 27, 2017 Posted December 27, 2017 (edited) You don't need a wait and you don't need two programs And a long wait is more susceptible to a reboot, but reboots of ISY don't happen spontaneously except, as I have learned on DST switch day (and unfortunately not just at 2 am). I have mine on a ups so the only reboots I get are when I update firmware or on DST day. If Time is from Sunrise + 30 minutes to Sunrise +12 hours Then Set 'Lime Tree Lights' On Else Set 'Lime Tree Lights' Off Edited December 27, 2017 by apostolakisl
apostolakisl Posted December 27, 2017 Posted December 27, 2017 Just curious, would this not work? If Time is Sunrise + 30 minutes For 12 hours Then Set 'Lime Tree Lights' On Else Set 'Lime Tree Lights' Off Am I missing the meaning or a pitfall of For? There is no "for" in the if clause on any version of firmware I'm aware of. The only "for" is in the then/else clause as part of a "repeat for x times" first introduced in the 5.x firmware.
toddhutch Posted December 27, 2017 Author Posted December 27, 2017 Good morning, The Lime Tree is working great, albeit, I've been rebooting the ISY a number of times while working on the Polyglot, so I want to make sure it does get shut off after 12 hours of being on. That was a test case for the original issue, the wan work item. The problems has been resolved for Wan work. I've since upgraded to 5.11 since I first posted this, so I need reevaluate with the new options in 5.x.
DrLumen Posted December 28, 2017 Posted December 28, 2017 There is no "for" in the if clause on any version of firmware I'm aware of. The only "for" is in the then/else clause as part of a "repeat for x times" first introduced in the 5.x firmware. This is in 5.0.11b.
ScottAvery Posted December 28, 2017 Posted December 28, 2017 This is in 5.0.11b. My guess is that is not the intended use. It will probably not reevaluate to use the else clause and will mean the program is active for 12 hours rather than active for 2 instants a day, as well as not recover from a reboot. Does the second pull down have a "To" option?
Recommended Posts