GTench Posted August 2 Share Posted August 2 I have a program that uses a wait for 20 minutes to shut off a light when it has been turned on. The program works correctly; that is, it shuts the light off after 20 minutes but I noticed that the last finish time is always the same as the last run time. Should the last finish time not be 20 minutes longer? Gary Quote Link to comment
Techman Posted August 2 Share Posted August 2 I just took a look at one of my programs that has a 15 minute wait and the LAST RUN TIME and the LAST FINISH TIME show the 15 minute difference. Not sure why you're not displaying the correct finish time. Are there any other conditions in your program? What controler and firmware are you running? Quote Link to comment
paulbates Posted August 2 Share Posted August 2 (edited) Are there multiple conditions for the program to execute? The last run time and finish time will match when one of the conditions is true and iox evaluates...even if all the conditions are not true and it doesn't run. You may be seeing the results of that. As an example, I have the ring plugin and have an iox program that uses the doorbell motion sensor to report movement at night after a certain time. I just came home around 1pm and the program shows it ran and finished around that time, even though the "Then" of the program did not execute. Edited August 2 by paulbates Quote Link to comment
GTench Posted August 2 Author Share Posted August 2 Here is one of the programs. Utility Room Lights OFF - [ID 0042][Parent 002F] If $s_Utility_lights_switched_on is 1 Or 'Utility Room near Stairs' Status is On Then Wait 12 minutes Set 'Utility Lights' Off $s_Utility_lights_switched_on = 0 Else - No Actions - (To add one, press 'Action') If I look at the status it shows the program as running (all green) and lights go off after in this case 12 minutes. Both conditions are true while the program is running Quote Link to comment
Javi Posted August 2 Share Posted August 2 Last run time should be called Last Evaluated time. The program was likely (re)evaluated to False when the variable and/or light status changed. 1 Quote Link to comment
GTench Posted August 3 Author Share Posted August 3 Thanks. I believe the variable or light status can only be changed by the code that follows the wait. I removed the 2nd OR condition from the program above just to simplify things but I still get identical times. Not really a problem since everything works ok but just puzzling. FYI here is the program that triggers the "OFF" one above Utility Room Lights On - [ID 0041][Parent 002F] If ( 'Alarm Panel / Basement Stairs Motion' Zone State is Open Or 'Alarm Panel / Furnace Motion' Zone State is Open Or 'Utility Room near Stairs' is switched On ) Then Disable Program 'Utility Room Lights OFF' Set 'Utility Lights' On $s_Utility_lights_switched_on = 1 Enable Program 'Utility Room Lights OFF' Run Program 'Utility Room Lights OFF' (If) Else - No Actions - (To add one, press 'Action') Quote Link to comment
Javi Posted August 3 Share Posted August 3 This follows the same logic, either the wait finished and the variable/state change caused the program to reevaluate to False or Wait is interrupted which caused the program to reevaluated to False. This should be easy to see in UD Mobile as the Program's Status would be Idle False indicating the last run time was an evaluation to False which finished running the Else Actions. Idle True would indicate the last evaluation was true and finished running Then Actions. If the Program's Status is Running Then/Else it is no longer possible to link the last finish time to True/False evaluation. If the timestamp for last run on true evaluation (Then) is important, a second disabled program can be used. The original program would be changed to trigger the new program to Run Then Action in Then and Stop in Else. The new program would contain the original programs Then Actions. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.