jim_ Posted December 12, 2014 Share 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 Link to comment
LeeG Posted December 12, 2014 Share Posted December 12, 2014 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 Link to comment
MWareman Posted December 12, 2014 Share Posted December 12, 2014 Also, to trigger on variable changes (when the value changes), the variable must be a 'state' variable. Link to comment
jim_ Posted December 12, 2014 Author Share 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 Link to comment
MikeD Posted December 12, 2014 Share Posted December 12, 2014 Jim, The Init of a variable is only referenced when the ISY boots. ~Mike Link to comment
Recommended Posts
Archived
This topic is now archived and is closed to further replies.