TJF1960 Posted July 8, 2011 Posted July 8, 2011 Today my question is about the use of “Last Run Time†in programs. I have used last run time in programs a lot but there is one program where I cannot figure out why they will not work. Hoping someone can shed some light. I did try to study up on the subject but when I did a search I got this result: "The following words in your search query were ignored because they are too common words: last run." I couldn't think of any other terms or combinations to use. I also checked the wiki but didn't find a whole lot on the subject. Basically if I create a simple program such: If Time is Last Run Time for 'Alarm Z01 Front Dr Sw' + 5 minutes Then - No Actions - (To add one, press 'Action') Else - No Actions - (To add one, press 'Action') Once this program is created and saved and “Alarm Z01 Front Dr Sw†is run, this program will turn true after 5 minutes after the last run time. Simple enough. So I have this program: If From Sunrise To 9:00:00PM (same day) And Folder 'Run If Away' is False And Control 'Devices / Frnt Drv MS SL' is switched On And Program 'Alarm Z01 Front Dr Sw' is False And Program 'Alarm Z20 Entry Hall PIR' is False Then Wait 1 second Send X10 'N5/On (3)' Else - No Actions - (To add one, press 'Action') This program works fine. Every time the Frnt Drv MS is switched on this program sends the x10 on signal. But now if I add 2 last run times (or even just 1 last run time) the program will never evaluate as true even though the last run time statements are be true. If From Sunrise To 9:00:00PM (same day) And Folder 'Run If Away' is False And Control 'Devices / Frnt Drv MS SL' is switched On And Program 'Alarm Z01 Front Dr Sw' is False And Program 'Alarm Z20 Entry Hall PIR' is False And Time is Last Run Time for 'Alarm Z01 Front Dr Sw' + 5 minutes And Time is Last Run Time for 'Alarm Z20 Entry Hall PIR' + 5 minutes Then Wait 1 second Send X10 'N5/On (3)' Else - No Actions - (To add one, press 'Action') Like I said earlier, I have used last run in at least 20 or more programs with great success, but this one has me stumped. Thanks, Tim
TJF1960 Posted July 8, 2011 Author Posted July 8, 2011 I may have figured it out. All of the times I have used this version of last run it has always been the trigger of the program. But for this program I require it to be a condition not the trigger. Could this be the case?
LeeG Posted July 8, 2011 Posted July 8, 2011 I think the If variant for a condition would be as follows ..... If Control 'ICON ON OFF' is switched On And From Last Run Time for 'Program2' + 5 minutes For 5 minutes Then Run Program 'Program3' (Then Path) Set Scene 'SceneKPLBOnly' On Else In Scene 'SwitchLinc Dimmer' Set 'SwitchLinc Dimmer' 50% (On Level)
TJF1960 Posted July 8, 2011 Author Posted July 8, 2011 Right but in your example wouldn’t the last run statement be false until 5 minutes after Program 2 ran, then turn true for 5 minute then it would be false again? What I want is for my last run statement to be false for 5 minutes after the program last run then turn true - until the program runs again. Thanks, Tim
LeeG Posted July 8, 2011 Posted July 8, 2011 Don't see a way to do that directly. Will do more testing later today. What is a bit messy but works is use a Program True/False state. This Program True/False state represents the 5 minute time period from Program2 Last Run time for 5 minutes. Program is True during the 5 minute time period, otherwise False. Use this Program True/False state rather than checking directly for the 5 minute window. Messy for sure but functional. I have run this and the Program True/False state reflects the 5 minute window of Program2 Last Run Time. If From Last Run Time for 'Program2' For 5 minutes Then - No Actions - (To add one, press 'Action') Else - No Actions - (To add one, press 'Action')
Recommended Posts