Jump to content
View in the app

A better way to browse. Learn more.

Universal Devices Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Variables in programs - Status vs Control

Featured Replies

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

  • Author

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?

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.

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.

  • Author

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.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.