Jump to content

Help with Variables Basics


jim_

Recommended Posts

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
 
 
Posted (edited)

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
Posted

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

Posted

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

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

Guest
This topic is now closed to further replies.

×
×
  • Create New...