TomG Posted January 15, 2017 Posted January 15, 2017 Hello, new user here. I wrote a simple program to turn on a lamp when either of two entry doors are opened and would like to add a condition so it only works from sunset to sunrise the next day (no sense turning on the lamp during the day). I thought that simply adding a schedule to the if statement would do it, but no dice. The program acts as it did before, ignoring the schedule. What am I doing wrong? Thank, Tom Living Room Lamp - [iD 0002][Parent 0001] If From Sunset To Sunrise (next day) And Status 'Computer Room Door' is On Or Status 'Front Door' is On Then Set 'Living Room Lamp' On Wait 5 minutes Set 'Living Room Lamp' Off Else - No Actions - (To add one, press 'Action')
paulbates Posted January 15, 2017 Posted January 15, 2017 (edited) Hi Tom,. and welcome to the forums! Its related to order of precedence. All you need to do is use the "Add and" function in the Admin console, lower right of the program window. If From Sunset To Sunrise (next day) and ( Status 'Computer Room Door' is On Or Status 'Front Door' is On ) Paul Edited January 15, 2017 by paulbates
andyf0 Posted January 15, 2017 Posted January 15, 2017 Probably going to need some parenthesis. If From Sunset To Sunrise (next day) And {Status 'Computer Room Door' is On Or Status 'Front Door' is On }
TomG Posted January 15, 2017 Author Posted January 15, 2017 (edited) That fixed it! I thought about parenthesis and looked at the command, but couldn't figure out how to implement it. Now that I look at the user guide specifically for parenthesis, I see it's pretty well explained. Is there a good source of example programs somewhere that I can refer to for help in learning the programming? Paul, I was just in your neck of the woods last week for a burger at Millers Bar. Best burgers in the state! Thanks for the help, guys. Tom Edited January 15, 2017 by TomG
Recommended Posts