The Variables - Universal Devices ISY-994i User Manual

Home automation
Hide thumbs Also See for ISY-994i:
Table of Contents

Advertisement

including the current day, day of month, day of year, month, year, and week of month. In
addition, there are counters which follow an every other, every third, every fourth, and
every fifth day schedule. Also, there is a program that sets a variable according to whether
it is an even day or an odd day. Finally, a series of programs sets a variable to 1 on several
US holidays. Some of these programs can be expanded upon including the holiday series or
every x number of days or weeks programs to suit your needs.
As an aside here, you may wonder why these programs don't all just run with their own
triggers rather than start with a single program and cascade off of that as they do. The main
reason is that the order of calculation is critical for many of these variables. When one
variable is calculated from the updated value of another variable, that first variable must
obviously be calculated first. The only way to be certain that one operation occurs, in order,
prior to another, is to have them run, in order, in a single "then" or "else" clause. A single
"then" or "else" clause always runs from top to bottom in order. If it is impossible to put
everything in a single clause, then you must have the first program send you to a second
program using a "run xxx" statement. Because of the way ISY operates, there is no
guarantee that two programs which trigger on their own will actually run in any particular
order to completion. If one program triggers at 1:00:00 and another triggers at 1:00:01, the
program that runs at 1:00:01 may catch up to or pass the 1:00:00 program. But if a line of
one program includes a "run if" of another program, you know that the second program
will not do anything until every statement in the first program preceding the "run if" has
completed.

11.1.1.2The Variables

There are a number of variables that need to be created by the user. By convention,
variables that have an "i" to start the name are integer variables and an "s" indicates a state
variable. This is only for ease of identification when writing and editing programs.
• iDay.of.Year starts with 1 on Jan 1 and counts to 365 (or 366 on leap year). This
variable is a less used variable that is mostly included for completeness as it is rare
that someone needs to know what day of the year it is.
• iDay.of.Month is how many days into the month we are (i.e. the 5th of the month).
• iYear is simply the current year.
• iLeap.Year counts 0,1,2,3,0,1,2,3, etc. where 0 means that we are in a leap year. This
is primarily a variable used to keep the other variables in check since rarely do
people have cause to include this directly in a program.
• iDay.of.Week starts with 1 on Monday and counts through to 7 on Sunday. This
variable is used to cross check the status of the variables against ISY's internal day
of week function so as to alert you if it gets out of sync. You do not need this variable
since ISY has this function built-in but you can choose to use it instead of the ISY's
built-in day function and get the same result.
• iMonth is simply the current month starting with 1 for Jan.
• iDay.Counter gets one number higher every day without regard to the start of a
new month or year. The primary purpose of this variable is to serve as a basis for
Page | 222

Advertisement

Table of Contents
loading

Related Products for Universal Devices ISY-994i

Table of Contents