ISY-99i/ISY-26 INSTEON:Programs as Variables: SwitchLinc Emulates Countdown Timer

From Universal Devices, Inc. Wiki

For a simpler, updated program with more functionality, see http://wiki.universal-devices.com/index.php?title=Countdown_Timer Posted by BitSmith on 05/25/13


This tutorial was posted on our forums by user rob9.

I generated a set of programs to generate a countdown timer with a switchlinc relay. I know that there is a Switchlinc Relay Countdown Timer that can be purchased, but I already had a regular switchlinc relay installed and by using the ISY to program it, you have lots of control on exactly how to make the timer work.

The time increases each time the on paddle is pressed from 15, 30, 60, and 90 minutes. It maxes out at 90 minutes. You can add time after timer has been running by pressing the on paddle again.

If the timer has not already been set, a local fast on at the switch will simply turn the fan on without a timer. If a timer has been set and is running, a local fast on will not change the timer. One could program the operation of the local fast on differently if desired.

I use two programs (Flag 1 and Flag 2) to keep track of the state of the timer.

One thing that I could not do is have the LED lights indicate the amount of time left on the timer. The Switchlinc Relay by design will only display all LEDs on or all off.

Here are the programs.

First there are 4 programs for the 4 different timer states:

Fan Timer on 15 Min

If
        Control 'Utility Room Fan' is switched On
    And (
             Program 'Flag 1' is False
         And Program 'Flag 2' is False
        )

Then
        Run Program 'Run 15 min' (Then Path)

Else
   - No Actions - (To add one, press 'Action')

Fan Timer on 30 Min

If
        Control 'Utility Room Fan' is switched On
    And (
             Program 'Flag 1' is False
         And Program 'Flag 2' is True
        )

Then
        Stop program 'Run 15 min'
        Run Program 'Run 30 min' (Then Path)

Else
   - No Actions - (To add one, press 'Action')

Fan Timer on 60 Min

If
        Control 'Utility Room Fan' is switched On
    And (
             Program 'Flag 1' is True
         And Program 'Flag 2' is False
        )

Then
        Stop program 'Run 30 min'
        Run Program 'Run 60 min' (Then Path)

Else
   - No Actions - (To add one, press 'Action')

and Fan Timer on 90 Min.

If
        Control 'Utility Room Fan' is switched On
    And (
             Program 'Flag 1' is True
         And Program 'Flag 2' is True
        )

Then
        Stop program 'Run 60 min'
        Run Program 'Run 90 min' (Then Path)

Else
   - No Actions - (To add one, press 'Action')


The Flag 1 and Flag 2 programs are completely empty. Calling the Then path sets it to True and calling the Else path sets it to False. I used the flags as follows:

Flag 1  Flag 2  Timer State
False   False    Off
False   True     15 min
True    False    30 min
True    True     90 min

Flag 1

If
   - No Conditions - (To add one, press 'Schedule' or 'Condition')

Then
   - No Actions - (To add one, press 'Action')

Else
   - No Actions - (To add one, press 'Action')

Flag 2

If
   - No Conditions - (To add one, press 'Schedule' or 'Condition')

Then
   - No Actions - (To add one, press 'Action')

Else
   - No Actions - (To add one, press 'Action')


I next have the four program timers that the previous programs call:

Run 15 min

If
   - No Conditions - (To add one, press 'Schedule' or 'Condition')

Then
        Run Program 'Flag 1' (Else Path)
        Run Program 'Flag 2' (Then Path)
        Wait  15 minutes 
        Run Program 'Fan Off' (Then Path)

Else
   - No Actions - (To add one, press 'Action')

Run 30 min

If
   - No Conditions - (To add one, press 'Schedule' or 'Condition')

Then
        Run Program 'Flag 1' (Then Path)
        Run Program 'Flag 2' (Else Path)
        Wait  15 minutes 
        Run Program 'Run 15 min' (Then Path)

Else
   - No Actions - (To add one, press 'Action')

Run 60 Min

If
   - No Conditions - (To add one, press 'Schedule' or 'Condition')

Then
        Run Program 'Flag 1' (Then Path)
        Run Program 'Flag 2' (Then Path)
        Wait  30 minutes 
        Run Program 'Run 30 min' (Then Path)

Else
   - No Actions - (To add one, press 'Action')

Run 90 Min

If
   - No Conditions - (To add one, press 'Schedule' or 'Condition')

Then
        Run Program 'Flag 1' (Then Path)
        Run Program 'Flag 2' (Then Path)
        Wait  30 minutes 
        Run Program 'Run 60 min' (Then Path)

Else
   - No Actions - (To add one, press 'Action')


Lastly I have the program that turns the fan off. This will terminate any timer if the switch is turned off locally or will turn off at end of timer countdown.

Fan Off

If
        Control 'Utility Room Fan' is switched Off
     Or Control 'Utility Room Fan' is switched Fast Off

Then
        Stop program 'Run 15 min'
        Stop program 'Run 30 min'
        Stop program 'Run 60 min'
        Stop program 'Run 90 min'
        Run Program 'Flag 1' (Else Path)
        Run Program 'Flag 2' (Else Path)
        Set 'Utility Room Fan' Off

Else
   - No Actions - (To add one, press 'Action')


Thanks to all those who have been posting to this forum. I've been learning a lot about how to program the ISY through this forum. Hopefully this program will be of help to someone.

Rob


ISY-26 INSTEON / ISY-99i Series INSTEON : How-To Guide