gfrnd Posted October 8, 2007 Posted October 8, 2007 Everything I set up that is simple is working fine but I'm having trouble with conditionals. The challenge, I want to turn something on at a regular time but on the weekend, a later time. That part is easy. But, let's say I take Monday off and want the weekend times to run. I tried a control program: If Control 'ControlLinc2' is switched On And Control 'ControlLinc2' is not switched Off Or On Sat From 5:00:00AM To 6:00:00PM (next day) Then - No Actions - (To add one, press 'Action') Else - No Actions - (To add one, press 'Action') When I use a reference to this in a program: If Program 'DayOff' is True And Time is 6:30:00AM Then Set 'HW Circulator' On Else - No Actions - (To add one, press 'Action') The program always runs; it sees program "DayOff" as always true. The other program, for Weekdays (and non days off) required "DayOff" to be false, it doesn't run. Hope this makes sense. Thanks for any help. This new versions will work great, but folks will see a learning curve. Quote
Chris Jahn Posted October 9, 2007 Posted October 9, 2007 I think this is basicaly what you are trying to accomplish; run something at 8:00AM on weekends and days off, otherwise run at 6:00AM. Days Off is set when the '07.EB.6D.1' button is On. Although you could use 'Control' to make 'Days Off' work, it is much easier using 'Status'. Essentially, the status of the button determines whether or not its a day off or not. Control is more suited to performing an action at the time the control is pressed, rather than retaining a certain on/off state over a period of time. There is a schedule bug (already fixed for the next drop), where the Time continues to be true long after the time has passed. To temporarily fix this, change the 'Time is 8:00am' to 'From 8:00am to 8:00am (same day)' for the 'Day Off' program. Note: For this workaround, you do not need to change simple schedules, only those with a combination of conditions. Program 'Day Off' If Status '07.EB.6D.1' is On And Time is 8:00:00AM Then Run program 'Weekend' Else - No Actions - (To add one, press 'Action') Program 'Weekday': If Status '07.EB.6D.1' is Off And On Mon, Tue, Wed, Thu, Fri Time is 6:00:00AM Then - No Actions - (To add one, press 'Action') Else - No Actions - (To add one, press 'Action') Program 'Weekend': If On Sat, Sun Time is 8:00:00AM Then - No Actions - (To add one, press 'Action') Else - No Actions - (To add one, press 'Action') Quote
gfrnd Posted October 10, 2007 Author Posted October 10, 2007 Chris Many thanks; I had spotted 'status' and started using that, but you suggestions are very helpful. Could I clarify one thing: If a program is 'run' from another, then the 'then' is run, ignoring the 'if' statement that may be present in the called program. Is that correct? That is what I am assuming is behavior based on experiments so far. Am I correct in the above statement? I am really enjoying working with this new approach to triggers/schedules. It is providing great flexibility. Many thanks for all of your hard work Quote
Chris Jahn Posted October 10, 2007 Posted October 10, 2007 Thanks, I'm glad to hear this is working well for you! You are correct in your assumption, here is a more complete description: 'Run' - 'Then' is run - Program is set 'True' 'Run Else' - 'Else' is run - Program is set 'False' 'Stop' - Stops 'Then' or 'Else' (if one of them is running) - Program true/false setting is not changed The 'If' comes into play again whenever a relevant event occurs. Therefore, while the program is running its possible that it may be stopped, restarted, etc. if the 'If' condition changes. Relevant events: - Button press (button + action match) - X10 message (house/unit/command match) - Status change (device/button matches) - Enter a time range/Time (From/Time is) - leaving a time range (To/For) Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.