gfridland Posted January 16, 2012 Posted January 16, 2012 I'm trying to use Variables more in programs as I believe they allow for more simplified code, however, I am trying to understand how variable use reflects conventional conditions I was using...specifically IF Status vs. IF Control... Does a Variable only reflect the Status statement or will it trigger a program when the variable changes state making it a Control condition? Here is one example where I am strugling to understand Variable use... If ( Control 'Alarm / Alarm Armed (AWAY)' is switched On And Control 'Alarm / Alarm Armed (AWAY)' is not switched Off ) Or ( Control 'Mudroom / Mudroom KPL-Mudroom Light / Mudroom KPL-Away Button' is switched Fast Off And Control 'Mudroom / Mudroom KPL-Mudroom Light / Mudroom KPL-Away Button' is not switched Off ) Then Wait 5 minutes Enable Program 'Garage left open (while AWAY ARMED)' Run Program 'Garage left open (while AWAY ARMED)' (If) Else - No Actions - (To add one, press 'Action') I have a variable that is "1" when "alarm armed away" and "0" when "alarm is NOT armed away" and was looking to use incorporate this variable use in the program above... Thanks in advance
LeeG Posted January 16, 2012 Posted January 16, 2012 State variables trigger Programs when the variable value is changed (like If Status). Integer variables DO NOT trigger Programs.
gfridland Posted January 16, 2012 Author Posted January 16, 2012 Thanks LeeG, I understand integer vs. state variables and I do use State variables successfully for program trigger conditions, however, my question is when this condition is evaluated...continuously or only when the variable is changed? How would one use a state variable as IF-Control vs IF-Status? Is this possible?
LeeG Posted January 16, 2012 Posted January 16, 2012 There is no functional equivalent in Variables to an Insteon If Control. An If Control triggers the Program when a specific Insteon command is received. State variables trigger on all changes. Integers never trigger. There is nothing in Variables to trigger only on a specific value (like If Control). The If State value determines whether the Then or Else clause runs but the Program is triggered on all changes.
oberkc Posted January 16, 2012 Posted January 16, 2012 How would one use a state variable as IF-Control vs IF-Status? Is this possible? I don't currently use variables, but undertand the state variable is analogous to the "IF-status" construct as a trigger mechanism.
gfridland Posted January 16, 2012 Author Posted January 16, 2012 Thanks Guys!!! Will play around to better undestand Variables...I searched on Wiki, forums regarding detailed explanation on Variables but wasn't able to find anything. Is there documentation available yet?
LeeG Posted January 16, 2012 Posted January 16, 2012 There is a forum Category dedicated to Variables. viewforum.php?f=68 The first Summary topic covers the basics.
gfridland Posted January 16, 2012 Author Posted January 16, 2012 I guess I should have looked harder!!! Thanks!
Recommended Posts