eyost Posted March 14, 2015 Posted March 14, 2015 Hi all, I currently have a program that will turn a device on at sunset and then wait four hours before turning them off. What I would like to do is to have the device to turn on at sunset and then off at a specific time. This sounds to me like a nested IF statement or an IF statement within the ELSE statement but I can't seem to determine how to add it. Any thoughts on the best way to accomplish this or do I need to call another program for the Off? Thanks for any help. Ed
madman Posted March 14, 2015 Posted March 14, 2015 You can do If From Sunset To 10:21:00PM (same day) Then Set 'Front Room / Front Rm Lamp' On Else Set 'Front Room / Front Rm Lamp' Off You might need a "timer" program in case someone turns off the light while the program is between sunset and stipulated time to turn it back on
eyost Posted March 14, 2015 Author Posted March 14, 2015 You can do If From Sunset To 10:21:00PM (same day) Then Set 'Front Room / Front Rm Lamp' On Else Set 'Front Room / Front Rm Lamp' Off You might need a "timer" program in case someone turns off the light while the program is between sunset and stipulated time to turn it back on Ahh - now I see how this works. Good thing is that the device is plugged into an outdoor ApplianceLinc so it is a far chance that someone would turn of the device; only thing would be a power outage. Thanks so much! Ed
paulbates Posted March 14, 2015 Posted March 14, 2015 (edited) Another thing to think about, from a safety perspective, is your house appearing too predictable when the lights go off at exactly the same time every night. You can use a randomized 'wait' command before the Set Off to have that vary over a period you specify: Wait 15 minutes (Random) Set 'Front Room / Front Rm Lamp' Off Edited March 14, 2015 by paulbates
eyost Posted March 15, 2015 Author Posted March 15, 2015 Another thing to think about, from a safety perspective, is your house appearing too predictable when the lights go off at exactly the same time every night. You can use a randomized 'wait' command before the Set Off to have that vary over a period you specify: Wait 15 minutes (Random) Set 'Front Room / Front Rm Lamp' Off Excellent point; I will implement the wait command/
Recommended Posts