• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Locale Variables

Saha

Lurker
Hi guys,

Apologies if this has already been asked but haven't seen anything specifically on this. I'm using Locale, and I've downloaded the Variables plug-in for it, but I can't seem to find any info on how to use it. All I've got is 'conditions', then if I click add it just says there hasn't been any variables set up for it.

Is there a readme or anything for it? :D

Cheers.
 
Not as such, documents seem thin on the ground for Locale plugins!

However, examples tend to help just as much as documents, so here is one :-)

I use the variables plugin to set Home = True when my Home situation is active. I then have a Wake on LAN situation, which is triggered between 6pm and 7:30pm - so it boots my Server when I get home. However, if I am not at home, I don't really want it triggering (not that it matters, I am just funny like that ;-)) so I have a variable condition in the WoL situation that says Home = True.

Thus, when I am home, the variable is set, and if its between 6pm and 7:30pm, the WoL situation triggers and the server boots up.


To set this up, you need to add a new "Variables" Setting to the "Home" Situation, then click "Add", select the type of variable (I mainly use True/False), then Enter the name and select the value.

Once you have done that, in the Situation that should react to the variable, you add a new "Variables" Condition, click "Add", select the type set previously, then select the variable from the dropdown list. Then choose the value it should react to (so in my case it was True).

Finally, add the Variable to the "Defaults" situation, with the opposite value, so that when you are, in this example, not at home, Home is set to False.

Et voila, as they say :-)

Hope that helps!
 
Back
Top Bottom