Posted April 23, 201213 yr Last question of the night....I was trying to do a simple program to turn off my outside lights at a certain time. I started a new program I used the schedule feature to set the time and added it to the code I then added AND Device A is on or Device B is ON Then Set Device A Off and Set Device B Off When the program kicked off my lights started turning on and off and on and off like it was stuck in a loop. I trices ed deleting the programs (that didn't do it) and I tried to delete the devices (that has now caused all of my devices statuses to be blank and when I try to do anything I get Discovering Nodes, Retry....... Suggestions? Please (before I snap and quit) Thanks. -Edit - Need help quick. My F'ing lights are just turning on and off and I can't get them to stop
April 23, 201213 yr Mark the Programs Disabled to stop the execution. There are a few problems in the Program you described. Suggest the Program be posted so the exact situation can be evaluated. The If statement needs parens to get the order of precedence correct. The Program probably changing the Status of a device used in the If. Assumptions until the actual Program can be seen.
April 23, 201213 yr Author I deleted them before I disabled them. They are no longer there but it is not stopping the lights.
April 23, 201213 yr Author My neighbors thank you. Any idea on what I did wrong with the programs? I had 2 of them Front Lights ON If Time is 8:30 PM and status Front Porch is Off or status Garage Lights is Off Then Set Garage Lights On Set Front Porch On Else FronLights Off If Time is 9:50 and Status Garage Light is On or Front Porch is On Then Set Front Porch Off Set Garage Off End If
April 23, 201213 yr The order of precedence is not what you want. The first device Status is Anded with the Time, the second device status, the one that is Ored stands alone, not gated by time. There is a good write up on the order of precedence in the UDI Wiki if more information is needed. Front Lights ON If Time is 8:30 PM and ( status Front Porch is Off or status Garage Lights is Off ) Then Set Garage Lights On Set Front Porch On Else FronLights Off If Time is 9:50 and ( and Status Garage Light is On or Front Porch is On ) Then Set Front Porch Off Set Garage Off End If
April 23, 201213 yr It also looks like you can simplify the program. Based on what I'm seeing your simply trying to have the program turn on the outside lights when it gets dark and turn them back off again when it gets light. For example: IF: From 8:30 PM To 9:00 AM (next day) Then Set Garage Lights On Set Front Porch On Else Set Garage Lights Off Set Front Porch Off Nice, simple and condensed. I use a similar program for my outside lights. (except I use the time of sunset/sunrise)
April 23, 201213 yr Author Thanks for the suggestions. Makes much more sense and a lot cleaner. IF: From 8:30 PM To 9:00 AM (next day) How do you code the above? I don't see the From and To options in the schedule section. Thanks
April 23, 201213 yr Under Schedule there is a multi selection field that displays "Time is" as the default, Click the down arrow and select From.