Tasker Variable for Power State

2,851 views
Skip to first unread message

Radimus

unread,
Mar 1, 2014, 11:29:24 AM3/1/14
to tas...@googlegroups.com
I have setup 4 profiles to determine power state:
1) state Power\AC = Set Variable, %Charger=AC
2) state Power\USB = Set Variable, %Charger=USB
3) state Power\Wireless = Set Variable, %Charger=Wireless
4) state Power\ Not Any = Set Variable, %Charger=Discharging

(there may also be a state of Fast Charge, but is likely to be a ROM/Device specific option...)

It would be easier if there was a built in var to provide that.. and possibly the charging rate MAX and Current

(Although most of that can be found in \sys\class\power_supply\battery\uevent)

Rich D

unread,
Mar 1, 2014, 3:04:38 PM3/1/14
to Tasker Google Groups Post

I believe it is also available within shell / dumpsy.

>
> --
> You received this message because you are subscribed to the Google Groups "Tasker" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to tasker+un...@googlegroups.com.
> Visit this group at http://groups.google.com/group/tasker.
> For more options, visit https://groups.google.com/groups/opt_out.

UncleMike

unread,
Mar 1, 2014, 10:51:44 PM3/1/14
to tas...@googlegroups.com
I'd like to see built-in variables for this also, but given that it's easy for users to generate them if needed, I think getting these variables built-in is going to be low on the priority list, but still on the list nonetheless.

DrPhant0m

unread,
Sep 3, 2014, 4:55:36 PM9/3/14
to tas...@googlegroups.com
I'm doing something similar... but I think this is sloppy programming, having 4 (or more if your ROM/hardware supports it) profiles to set a single variable.

I'm on these forums looking for a way to use states in IF statements.

In other words... I'd like to have 1 profile, activated on State\Power\Any
Then, in that profile, a single task that will execute commands for 

If State\Power\AC... then XXX
If State\Power\USB... then YYY
etc

Why is the only way to activate anything on a state through the initial profile conditions?


On Saturday, March 1, 2014 11:29:24 AM UTC-5, Radimus wrote:
Message has been deleted

Pent

unread,
Sep 4, 2014, 2:50:36 AM9/4/14
to tas...@googlegroups.com
Please stick to a single thread for a single issue, thanks.

Pent

Ben Jacobson

unread,
Dec 19, 2014, 9:32:30 AM12/19/14
to tas...@googlegroups.com
because the design behind tasker is completely back-asswords, the opposite of existing software flow control structures

Mike Mc.

unread,
Jun 7, 2018, 3:11:31 PM6/7/18
to Tasker
Sadly, the way Tasker handles variables, this doesn't really help me. I have a profile with exit tasks of: Wait 7 seconds, then IF %Charger ~ none, performs a bunch of tasks. The theory is that if I briefly lose power like when I turn the car key from aux to start, the exit task will wait 7 seconds, check to see if %Charger is set to "none", and if so it will perform the exit tasks. However, it performs the exit tasks even though I plug power back in and can see a separate profile change %Charger back to "AC". Like, that variable should be set to "AC" well before the IF tasks occurs, but it ignores the current %Charger and instead uses whatever the variable was set to when the exit tasks began. It appears to be true that one profile affecting the variable doesn't get reflected in another profile, even when using at least 1 capital letter in the variable name. Maybe I'll try with all caps, but I doubt that'll make a difference.

I'm going to try using separate profiles instead of relying on "exit" tasks since they aren't dynamically looking at the variable contents.
Message has been deleted

Marta Hintz

unread,
Jun 7, 2018, 3:29:29 PM6/7/18
to Tasker
Actually variables that are global will affect another profile. It seems to work better if you select the variable from the spy glass rather than typing it in. It's easy for different keyboards to sneak in spaces that are hard to tell.

If you are having troubles, it does take a bit of sleuthing through tasker logs to determine the fix, trial and error and sometimes good luck 😁. I think the logic works, but in different phones, ROMS, hardware tracker acts a bit different. Anywho.....

Mike Mc.

unread,
Jun 7, 2018, 4:30:08 PM6/7/18
to Tasker
Thanks, I was a bit premature on my assumptions. Turns out I simply wasn't giving it enough time to read the changed variable. I had my WAIT set to 7 seconds. When watching the tasks and the little indicator next to the IF variable, I could see how long it took to change variable and recognize the change, and 7 seconds was just not quite long enough. It's set to 10 seconds now and it works great!
Reply all
Reply to author
Forward
0 new messages