Jump to content

Variables in programs - Status vs Control


gfridland

Recommended Posts

Posted

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

Posted

State variables trigger Programs when the variable value is changed (like If Status).

 

Integer variables DO NOT trigger Programs.

Posted

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?

Posted

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.

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

Posted

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?

Guest
This topic is now closed to further replies.

×
×
  • Create New...