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.

Help with Variables Basics

Featured Replies

Posted

trying understand how Variables work ... 

I can see the VAR_1 Init value change, but not control an actual device

 

I have 3 programs for this test

 

Variable ON

------------------

If
        X10 'B2/On (3)' is Received
 
Then
        $VAR_1 Init To 1
 
Else
   - No Actions - (To add one, press 'Action')
 

Variable OFF

------------------

If
        X10 'B2/Off (11)' is Received
 
Then
        $VAR_1 Init To 0
 
Else
   - No Actions - (To add one, press 'Action')
 
On the Variables TAB / State I can see the value in the Init column change to 0 or 1 when B2 goes On or Off
 
=======================================================================
 
What  I don't understand is why this does not work
 
Test device on / off via Variable

------------------

 
If
        $VAR_1 is 1
 
Then
        Set '25.C4.73.1' On
 
Else
        Set '25.C4.73.1' Off
 
 

Setting Init value is what the variable is set to when the ISY is booted.   Set the variable itself "Set $VAR_1 = 1" in addition to setting the Init value.

 

Then
        $VAR_1 Init To 1

        $VAR_1 = 1

 

 

Then
        $VAR_1 Init To 0

        $VAR_1 = 0

Edited by LeeG

Also, to trigger on variable changes (when the value changes), the variable must be a 'state' variable.

  • Author

Thank you for your help ... it works ...

Makes sense now  ... I wondered why Value on VAR_1 State never changed when Init was changing

Jim,

 

The Init of a variable is only referenced when the ISY boots.

 

~Mike

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.