GJ Software Products Posted January 13, 2023 Posted January 13, 2023 IoX 5.5.3 Here’s an interesting one that worked in my 994i but not in my eisy. Here’s some pseudocode first: If the scene button is pressed and the heater switch module is off, turn the switch module on, illuminate the button on the keypad and set a flag the heater is in override. Wait for x time then turn off the heater, button, and flag off. This works fine in my 994i but not in IoX. If I remove “And heater status is off” from the If statement it works. What I’m thinking is that as soon as heater status goes true, the If is no longer valid, so it stops running the Then at the Wait or beneath the Wait. Maybe I’m just missing something. Anybody got any ideas? Thanks. Program in my eisy: Program in my 994i:
MrBill Posted January 14, 2023 Posted January 14, 2023 17 hours ago, GJ Software Products said: This works fine in my 994i but not in IoX. If I remove “And heater status is off” from the If statement it works. What I’m thinking is that as soon as heater status goes true, the If is no longer valid, so it stops running the Then at the Wait or beneath the Wait. Disclaimer: I don't have z-wave. What I bolded above is exactly what would have happened on the 994 if the devices in the if statement were insteon. This suggests to me that your analysis is correct and the newer firmware corrects a bug that exists in the 994 firmware. It's hard to test this theory unless you have an extra identical switch or are willing to move the device back to the 994, however to test this theory, create an integer variable $iTest then create a program with the IF being just the AND portion that you removed, and make the THEN simply wait 5 minutes after the wait increment $iTest. Test both on 994 and eisy and observe the green flag on the running program to determine when the program is waiting and when it terminated because of a change in state.
oberkc Posted January 14, 2023 Posted January 14, 2023 I suppose you could test his theory by watching the program log while you execise the various keypad buttons. Does the program run twice, first true, then false?
brians Posted January 14, 2023 Posted January 14, 2023 What would be the solution then? I find that the way isy stops running programs works good for some things and other times it is difficult or impossible to do simplest things. Is there a way to set a flag on a program to not run/ignore “if” until finished? Maybe could do this with a couple programs - the first one has the “if and” which calls the second which contains actual code and first disables the calling program then does its timers etc then enables it again. I think a program disabling itself causes it to stop so would need two.
KeviNH Posted January 14, 2023 Posted January 14, 2023 1 hour ago, brians said: Maybe could do this with a couple programs - the first one has the “if and” which calls the second which contains actual code and first disables the calling program then does its timers etc then enables it again. I think a program disabling itself causes it to stop so would need two. That's how I do timers on the ISY994 today. The first program calls "Run program Timer (then)". Because the "Timer" program has no conditions applied, it only ever runs when called, and runs to completion unless stopped (manually or by another program which explicitly calls "stop program ..."). Another trick I use involves a third program, "Timer called recently", which has a condition like this: Timer Called Recently - [ID 0083][Parent 002A] If From Last Run Time for 'Timer' For 1 hours Then - No Actions - (To add one, press 'Action') So by adding a condition the the first program of "Program 'Timer called recently is False' I can keep the first program from running again within an hour of when 'Timer' was last executed. (This convoluted approach wouldn't be necessary if we had negation within program conditions or a condition of "is/is not running".) 1
vbPhil Posted January 14, 2023 Posted January 14, 2023 1 hour ago, KeviNH said: The first program calls "Run program Timer (then)". Because the "Timer" program has no conditions applied, it only ever runs when called, and runs to completion unless stopped (manually or by another program which explicitly calls "stop program ..."). Curious, can you call the Timer program from one program and then from another while it is already running?
MrBill Posted January 14, 2023 Posted January 14, 2023 3 hours ago, brians said: What would be the solution then? I find that the way isy stops running programs works good for some things and other times it is difficult or impossible to do simplest things. Is there a way to set a flag on a program to not run/ignore “if” until finished? Maybe could do this with a couple programs - the first one has the “if and” which calls the second which contains actual code and first disables the calling program then does its timers etc then enables it again. I think a program disabling itself causes it to stop so would need two. I usually protect the timer by linking 2 programs... Program1 If Condition that might change then run program2 (then) Program2 if (none) then disable program 1 do whatever wait whatever do somemore enable Program 1 1
brians Posted January 14, 2023 Posted January 14, 2023 3 hours ago, vbphil said: Curious, can you call the Timer program from one program and then from another while it is already running? It would restart the timer program. 1
Recommended Posts