ghaynes27 Posted July 13, 2016 Posted July 13, 2016 I finally understand the difference between control and status but I need some help with this basic program. I just want to have a set of lights turn on if they were already not on and then turn off 2 hours later. I also want to make sure if someone physically turns off the light during this timeframe for it to not turn back on. Will the program below work? Is there anything else I should check for? Pendants - [ID 0003][Parent 0001] If Time is Sunset - 15 minutes And Status 'Kitchen / Kitchen Pendants' is Off And Control 'Kitchen / Kitchen Pendants' is not switched Off Then Set 'Kitchen / Kitchen Pendants' On Wait 2 hours Set 'Kitchen / Kitchen Pendants' Off Else - No Actions - (To add one, press 'Action')
Xathros Posted July 13, 2016 Posted July 13, 2016 I finally understand the difference between control and status but I need some help with this basic program. I just want to have a set of lights turn on if they were already not on and then turn off 2 hours later. I also want to make sure if someone physically turns off the light during this timeframe for it to not turn back on. Will the program below work? Is there anything else I should check for? Pendants - [ID 0003][Parent 0001] If Time is Sunset - 15 minutes And Status 'Kitchen / Kitchen Pendants' is Off And Control 'Kitchen / Kitchen Pendants' is not switched Off Then Set 'Kitchen / Kitchen Pendants' On Wait 2 hours Set 'Kitchen / Kitchen Pendants' Off Else - No Actions - (To add one, press 'Action') No. Several reasons, Status changes during run causing re-evaluation, Control anded etc. I would not worry about the current status of the light. Does it matter if it was off to begin with? If it's already On, turning it on does no harm right? If you are trying to avoid it going off via program when it was turned on manually, there is a different approach that involves another program to enable/disable the time based program: Timer program: Pendants Timer - If Time is Sunset - 15 minutes Then Set 'Kitchen / Kitchen Pendants' On Wait 2 hours Set 'Kitchen / Kitchen Pendants' Off Else - No Actions - (To add one, press 'Action') Then the Override program: Pendants Override- If Control 'Kitchen / Kitchen Pendants' is switched On And Control 'Kitchen / Kitchen Pendants' is not switched Off Then Disable Program 'Pendants Timer' Else Enable Program 'Pendants Timer' Hope this helps. -Xathros
oberkc Posted July 13, 2016 Posted July 13, 2016 I just want to have a set of lights turn on if they were already not on and then turn off 2 hours later. I also want to make sure if someone physically turns off the light during this timeframe for it to not turn back on. I also subscribe to xathros' theory that if the lights are already on, there is little harm in turning them on. The opposite is also true, in my mind. If all you want them to do is turn on at a certain time, then turn off 2 hours later, what is the problem with a program such as: if from a certain time (such as sunset -15 minutes in your case) to 2 hours later (or sunset plus 105 minutes in your case) then turn on lights else turn off lights A program such as the one above will turn the lights on at a certain time (if they were already on, does it matter?). Two hours later, the program will turn them off (if somebody already turned them off manually, does it really matter?). Is there anything else I should check for? I would like the option to keep the lights ON somehow. Check to see if the lights were manually turned ON and, if so, keep the ON until manually turned off. Xathros' example override program appeared to address this issue
ghaynes27 Posted July 14, 2016 Author Posted July 14, 2016 Xathros your solution worked and I like how simple it is. The only thing that I don't understand is in the second program (the override one) is if the first program becomes disabled what will make it enabled again? What I want is for the light to come on and off after x minutes but if want to turn the light off manually earlier than the program by hitting the switch I don't want the program to the turn the light back on since its still in the window of time. So I like override piece but I want it to reset everyday so the next day the light comes on again. Right now it seems like its going to be disabled forever.
oberkc Posted July 14, 2016 Posted July 14, 2016 What I want is for the light to come on and off after x minutes but if want to turn the light off manually earlier than the program by hitting the switch I don't want the program to the turn the light back on since its still in the window of time. Neither the program I suggested, nor xathros' timer program, would turn the light back on. xathros override program would re-enable the timer program when the switch is manually turned OFF.
Xathros Posted July 14, 2016 Posted July 14, 2016 (edited) The timer program will only turn the lights on at the start of the window. If you turn them off after sunset-15, they'll stay off until sunset-15 tomorrow night. The override program watches for both on and off commands from the switch. On triggers the then section disabling the timer program. Off triggers the else and re-enabled the timer program. It does not run the timer however. Only trigger for the timer is sunset-15. -Xathros Sent from my iPhone using Tapatalk Edited July 14, 2016 by Xathros
larryllix Posted July 14, 2016 Posted July 14, 2016 Although Xathros has a black belt in ISY logic, I like to add an all-else-fails timer to that logic. Pendants Override If Control 'Kitchen / Kitchen Pendants' is switched On And Control 'Kitchen / Kitchen Pendants' is not switched Off Then Disable Program 'Pendants Timer' Wait 4 hours Run Program (else) Pendants Override Else Enable Program 'Pendants Timer'
Recommended Posts