5

New variable: Charging_State

Today I wanted to write a task where I could check if the phone is charging or not and then do something based on that state e.g.:

     IF screen=off AND charging_state = non, THEN wiki-off

When I take my tablet with me during travel, for some reason it starts to drain the battery when the screen is off and the wifi is on.

 I'm proposing a new variable: charging_state. It would have these values ac, usb, none, wireless

These values can be taken from the built-in Power state.

Creating multiple profiles to make up our own variable is possible (for example) but it involves work.

Listing some other people who have also asked for a "charging_state" variable that tells us if the device is charging or not.

https://www.reddit.com/r/tasker/comments/2vln80/battery_charging_not_charging_event/

https://www.reddit.com/r/tasker/comments/80idp7/how_to_determine_if_the_phone_is_currently/

https://www.reddit.com/r/tasker/comments/3d592l/if_charging_variable/

https://grokbase.com/t/gg/tasker/14317jp8dg/variable-for-power-state

I tried using the extended variable %myPOWER listed here but it didnt work.

1 reply

U

Wont let me edit it. Fixing the code:

     IF screen=off AND charging_state = none, THEN wifi-off