Jump to content

Variables in programs - Status vs Control


gfridland

Recommended Posts

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

Link to comment

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?

Link to comment

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.

Link to comment

Archived

This topic is now archived and is closed to further replies.


  • Recently Browsing

    • No registered users viewing this page.
  • Forum Statistics

    • Total Topics
      36.9k
    • Total Posts
      370.3k
×
×
  • Create New...