Ajax Posted August 26, 2016 Posted August 26, 2016 (edited) Guys not sure what I am doing wrong but why would this program make my lights flash instead of running? Exterior Lights - [iD 0003][Parent 0001][Not Enabled] If From Sunset + 30 minutes To 11:30:00PM (same day) And Status 'Garage Exterior' is Off Then Set Scene 'Exterior Lights' On Else Set Scene 'Exterior Lights' Off Edited August 26, 2016 by Ajax
haroldunger Posted August 26, 2016 Posted August 26, 2016 (edited) Try it with the "Else" function blank (no action) and see what happens. If From Sunset + 30 minutes To 11:30:00PM (same day) And Status 'Garage Exterior' is Off Then Set Scene 'Exterior Lights' On Else - No Actions - (to add one, press "Action") Edited August 26, 2016 by haroldunger
oberkc Posted August 26, 2016 Posted August 26, 2016 Is 'Garage Exterior' part of scene ''Exterior Lights"?
Ajax Posted August 26, 2016 Author Posted August 26, 2016 Yes not sure why but for some reason I could not select a scene for status so I just used one of the devices (Garage Exterior) that is in a 3-way scene (Exterior Lights). If I leave the else statement blank and the lights were turned on my before the program triggered will it still shut off the lights at 11:30 or do I write another program?
haroldunger Posted August 26, 2016 Posted August 26, 2016 (edited) I'm not sure. Set the off time to 9pm and see what happens. If it doesn't shut the scene down, then write a simple "off" program for 11:31pm and reset the original program to 11:30pm or eliminate the off time entirely. Edited August 26, 2016 by haroldunger
TheWabit Posted August 26, 2016 Posted August 26, 2016 I would create a scene of just your garage exterior lights. Use that in your "then" statement
oberkc Posted August 26, 2016 Posted August 26, 2016 Yes not sure why but for some reason I could not select a scene for status so I just used one of the devices It is because scenes have no status in insteon. Only devices have a status. Your program is, in effect, creating an endless loop. The program triggers, it changes the state of the device (as part of the scene), which triggers the program, which changes the state of the device, which triggers the program, which...well...you get the point. Remove the STATUS condition from the program. It really serves no purpose, anyhow.
haroldunger Posted August 26, 2016 Posted August 26, 2016 (edited) I run a program which checks to see if any of the individual lights included in the scene are on. The lights are enumerated individually. If none are on, then the program runs the "then" statement, the scene executes, and all of the lights in the scene are turned on to a predetermined level. If any one is on, then the program "then" statement doesn't turn on the scene. It works fine. Edited August 26, 2016 by haroldunger
oberkc Posted August 26, 2016 Posted August 26, 2016 (edited) I run a program which checks to see if any of the individual lights included in the scene are on. The lights are enumerated individually. If none are on, then the program runs the "then" statement, the scene executes, and all of the lights in the scene are turned on to a predetermined level. If any one is on, then the program "then" statement doesn't turn on the scene. It works fine. This program is a little different than the original-posted program. Yours has a "if time is..." Ajax' program has a "if time is from/to". Your program works fine because there is only a specific moment in time that it can be true. Ajax program can be true over a period of several hours. Obviously, Ajax' program also has a non-empty ELSE path. There are several ways to approach Ajax program. One could use two programs. One could use a single program as he is trying. If the condition "status exterior light is off" turns out to be important, then it might be necessary to break his into two programs. But, the original intention seemed to be check whether the scene was on, instead using a device within the scene as an indicator. In my estimation, if a scene is ON, there is no harm in turning it on again. Edited August 27, 2016 by oberkc
haroldunger Posted August 27, 2016 Posted August 27, 2016 (edited) Here's the last in the series of programs. The interim program adjusts the lights to the "If" requirements. So, if I'm watching TV and I have changed the lighting intensity, etc., then this program won't execute. If not, it executes. Also, this one has an off time. It works great, too. Edited August 27, 2016 by haroldunger
Ajax Posted August 27, 2016 Author Posted August 27, 2016 This program is a little different than the original-posted program. Yours has a "if time is..." Ajax' program has a "if time is from/to". Your program works fine because there is only a specific moment in time that it can be true. Ajax program can be true over a period of several hours. Obviously, Ajax' program also has a non-empty ELSE path. There are several ways to approach Ajax program. One could use two programs. One could use a single program as he is trying. If the condition "status exterior light is off" turns out to be important, then it might be necessary to break his into two programs. But, the original intention seemed to be check whether the scene was on, instead using a device within the scene as an indicator. In my estimation, if a scene is ON, there is no harm in turning it on again. So I did use a device (Garage Exterior) to check if the scene "Exterior Lights" are one-Is that the correct way to check? I will remove the "Status" Since yes in theory what's it going to do just turn in on. But how would I have done that if I did want to check a status first? Since mine looks very similar to the one below but does not work Here's the last in the series of programs. The interim program adjusts the lights to the "If" requirements. So, if I'm watching TV and I have changed the lighting intensity, etc., then this program won't execute. If not, it executes. Also, this one has an off time. It works great, too. Thanks guys
oberkc Posted August 28, 2016 Posted August 28, 2016 But how would I have done that if I did want to check a status first? Probably use an approach similar to haroldunger, but you would have to use two programs. The big difference is that the time condition is a single, discrete, time rather than a range. If time is sunset + 30 and status garage exterior is OFF then turn lights on else nothing if time is 1130pm then turn lights off else nothing One of the big things to be aware of is when a program action can cause the program to retrigger (as your original program did) and get in a never-ending loop. A simple and obvious example would be: if status LIGHT is OFF then turn LIGHT ON else turn LIGHT OFF While easy to see in this case, it is often hard to see when this is happening in more complicated programs. I believe it was happening in your case (but only between the time range specified).
Ajax Posted August 29, 2016 Author Posted August 29, 2016 Thanks Oberkc, Quick question with doing 2 programs just for turning lights on and off, how many programs total do most guys run? I mean I know it is going to vary, but it seems I am going to spend days just creating the most basic functions
oberkc Posted August 29, 2016 Posted August 29, 2016 Thanks Oberkc, Quick question with doing 2 programs just for turning lights on and off, how many programs total do most guys run? I mean I know it is going to vary, but it seems I am going to spend days just creating the most basic functions I have no idea about "most" or average. Personally, I have well fewer than 100 programs, but I have no doubt those crazy guys can have orders of magnitudes greater than that. Useing the program folders and comments, it is pretty easy to manage, in my estimation. Which is another reason I prefered my original suggestion (remove the status condition) and do it in a single program. I suspect you will also find means opportunity to combine programs. For example I might have several programs to turn lights on any given day, but only one to turn all off. For the most part, I have not found this sort of thing to be a constraint.
haroldunger Posted August 29, 2016 Posted August 29, 2016 Many of my scenes have on and off commands in just one program. However, I can see dividing the on and off functions into two programs. I do have a program that turns off everything at 2:30am.
Recommended Posts