[ANSWERED]: Manually setting a variable's value

Posted on
Sun Feb 21, 2016 10:07 pm
canalrun offline
Posts: 80
Joined: Jan 17, 2016

[ANSWERED]: Manually setting a variable's value

I have a variable, MinLux, that I use as a comparison value against the luminance from an Aeon multisensor.

I would like to set the value of MinLux to 150.

Up to this point I've been opening a Python Shell and entering code similar to indigo.variable.updateValue(1234567, "150.0").

When I look in the Variable List window, I can see that the variable takes on the value 150.

Is there an easier way?

I am thinking of something like opening the Variables List window, right clicking on the variable, and entering the value in a pop-up text field.

Is there something like this?

On a related note: Have I entered the value for the variable correctly? What I am doing is comparing this variable to another variable that holds the luminance value from the Aeon sensor in the condition portion of a trigger to turn on a light (condition: if variable is less than variable) Will this comparison be performed as a numerical comparison? Even though I update the variable as a string value?

Thanks,
Barry.

Posted on
Sun Feb 21, 2016 10:41 pm
jblackburn offline
Posts: 77
Joined: Dec 11, 2013
Location: Quebec, Canada

Re: Manually setting a variable's value

Barry,

I've you tried double click on the value of your variable within the variable windows? You'll find what you need! :wink:

Thanks!

Joel

Posted on
Mon Feb 22, 2016 5:03 am
shrxman offline
Posts: 83
Joined: Apr 22, 2015

Re: Manually setting a variable's value

Also, you are storing the value correctly. You will need to convert it from a string to an int before you can do any arithmetic. I usually just convert it in the equation, as in int (var) + 150.

Posted on
Mon Feb 22, 2016 11:15 am
canalrun offline
Posts: 80
Joined: Jan 17, 2016

Re: [ANSWERED]: Manually setting a variable's value

Thanks both.

That was certainly easy !

Currently I am using trigger Conditions to compare (variable less than variable). It seems to be comparing numerically.

I will probably switch to Python. Then I will need to convert types.

Barry.

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 2 guests