Jump to content

Countdown Timer


Recommended Posts

Posted

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:

image.png.91f75396fb8329fa2fe86ca047449423.png

Program in my 994i:

image.png.0f9bb560bcc84d45bf3e7ffd26a5a8b3.png

 

 

Posted
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 image.png.4366d5689cf6e64e552f4ba166917e36.png on the running program to determine when the program is waiting and when it terminated because of a change in state.

Posted

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?

Posted

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. 

Posted
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".)

  • Like 1
Posted
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?

Posted
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

  • Thanks 1
Posted
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.

  • Like 1
Guest
This topic is now closed to further replies.

  • Recently Browsing

    • No registered users viewing this page.
  • Forum Statistics

    • Total Topics
      37.2k
    • Total Posts
      372.3k
×
×
  • Create New...