Tasker Variables Help (first attempt)

165 views
Skip to first unread message

tr91

unread,
Jan 16, 2013, 10:42:33 AM1/16/13
to tas...@googlegroups.com
I'm trying to set a profile on XXX application that on entry, retrieves a current media volume value, stores it in %BVOLM, then use variable add to %BVOLM by 5. This new value is then assigned %AVOLM After that, I set the media volume to %AVOLM. 

On exit, the %AVOLM is cleared, and media volume is set back to %BVOLM.

I managed to do it in some weird way using variable set (%BVOLM to %VOLM, which is counterintuitive). What would be the proper way of obtaining a system-wide tasker variable and storing it?

Wes Stacey

unread,
Jan 16, 2013, 12:02:53 PM1/16/13
to tas...@googlegroups.com
how is that counter intuitive?

In the Variable set action the word "to" is basically "=" so it is setting %BVOLM = %VOLM

So it sounds like you are wanting to save the previous volume level then icnrease it by 5 when this app is open then put it back to what si was when you exit the app.

So something like this.

Context: your app starts

Enter task:
Variable Set %BVOLM to %VOLM
Variable Set %AVOLM to %BVOLM + 5 (make sure the "Do Maths" check box is checked)
Media Volume set to %AVOLM

Exit Task:
Media Volume set to %BVOLM



Matt R

unread,
Jan 16, 2013, 12:56:50 PM1/16/13
to tas...@googlegroups.com
In fact, since the app context is a state, and media volume is a setting, you don't even need to restore it.  Tasker will do it automatically when the profile goes inactive.

Matt

tr91

unread,
Jan 16, 2013, 1:33:32 PM1/16/13
to tas...@googlegroups.com
Oh that clears it up then. Well, my current issue is that I have a context for AutoRemoteMessage plugin that reads "max" and sets media volume to maximum (15). The problem is that it instantly restores it to the previous volume. Even when I set it to set media volume to 15 directly. It works if I press the play button within the tasker edit screen, but behaves in the stated way when I send the "max" autoremotemessage to it. I'm thinking that this is because the "event" box is checked, such that it will only be active for a short period of time. I tried unchecking it but the event wont even trigger at all if I do so.

tr91

unread,
Jan 16, 2013, 1:37:26 PM1/16/13
to tas...@googlegroups.com
Is there a way for me to stop that from occuring? Since Tasker automatically restores it to the previous volume setting within a split second.

Wes Stacey

unread,
Jan 16, 2013, 2:08:56 PM1/16/13
to tas...@googlegroups.com
I don't like to trust Tasker to auto restore settings for me. Whenever you reboot the phone the previous settings are lost, so i set variables and always use and exit task so Tasker will set things back to what i want them to be regardless of whether my phone has rebooted or not.

Wes Stacey

unread,
Jan 16, 2013, 2:15:01 PM1/16/13
to tas...@googlegroups.com
Where does the AutoRemotePlugin show up? Under "States" or under "Events"?

On Wednesday, January 16, 2013 12:37:26 PM UTC-6, tr91 wrote:

tr91

unread,
Jan 16, 2013, 4:06:36 PM1/16/13
to tas...@googlegroups.com
It's under states

Matt R

unread,
Jan 16, 2013, 4:35:00 PM1/16/13
to tas...@googlegroups.com
You should be able to long-press on the profile name, select properties, and uncheck "restore settings".

Matt

tr91

unread,
Jan 16, 2013, 4:35:58 PM1/16/13
to tas...@googlegroups.com
Well, I forced it to stick to my set variable by again setting media volume in the exit task for the state, a step which is inelegant but still works. =/
Reply all
Reply to author
Forward
0 new messages