jim_ Posted December 12, 2014 Posted December 12, 2014 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
LeeG Posted December 12, 2014 Posted December 12, 2014 (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 December 12, 2014 by LeeG
MWareman Posted December 12, 2014 Posted December 12, 2014 Also, to trigger on variable changes (when the value changes), the variable must be a 'state' variable.
jim_ Posted December 12, 2014 Author Posted December 12, 2014 Thank you for your help ... it works ... Makes sense now ... I wondered why Value on VAR_1 State never changed when Init was changing
MikeD Posted December 12, 2014 Posted December 12, 2014 Jim, The Init of a variable is only referenced when the ISY boots. ~Mike
Recommended Posts