alrolarry Posted February 10, 2013 Posted February 10, 2013 I am new to the ISY world. I am trying to turn a light on at a given time and then turn it off again 2 hours latter. Here is my coding: If From Sunset + 45 minutes For 2 hours Then set 'Family room lights' 55% set 'Kitchen lights' 55% Else no actions Then lights come on, but have to be manualy turned off. What am I doing wrong?
LeeG Posted February 10, 2013 Posted February 10, 2013 The Program has no statements to turn the devices Off. The Then clause is invoked at the From Time because the If evaluates to True. The Program is triggered again at the +2 hours invoking the Else clause because the If is now False. The current time is outside the time range, albeit seconds outside the range, which is why the If is False driving the Else. The Else contains the statements to turn the devices Off. If From Sunset + 45 minutes For 2 hours Then set 'Family room lights' 55% set 'Kitchen lights' 55% Else set 'Family room lights' Off set 'Kitchen lights' Off
oberkc Posted February 10, 2013 Posted February 10, 2013 If I may make another observation, you may also benefit from a scene. If you were to create a scene (giving the name of you choice) that includes the family room and kitchen lights, as responders, with 55% on levels each, then your program could be even more simplified. It might even be more responsive. if time if from sunset + 45min for 2 hours then set scene on else set scene off
arw01 Posted February 10, 2013 Posted February 10, 2013 One other observation, is do you want the lights to ALWAYS turn off 2 hours later, e.g. someone is in the kitchen cutting with a knife and the lights go OFF. Might be a good idea to check for a control of the kitchen light in another program and stop this program from turning them off.
Recommended Posts