Friday, August 2, 2013

[Tasker] Extreme battery saving profile

The battery life of an android phone is not impressive and we got used to charge our phones every day. Nevertheless it can happen that one finds himself in a situation with no charger in reach and no battery left. This profile will help you to avoid this situation. This profile will fire when your battery level will drop under 8% automatically. It is a drastic step, think twice before using it.
This task will:
  • Put your phone into flight mode (I warned you, drastical steps ;)
  • Set the display brightness to deep Darth Vader like darkness
Yes, you won't be reachable. But you can switch off the flight mode whenever you wish and still send or receive the important messages you would miss otherwise. In my opinion it's better then finding your phone completely drained without any options left. The phone should last minimum another hour in this mode.
You will need:

This is what my profile looks like:
Profile: Extreme battery save (28)
     State: Battery Level [ From:0 To:8 ]
Enter: Extreme battery save (3)
     A1: Auto Brightness [ Set:Off ]
     A2: Display Brightness [ Level:0 Disable Safeguard:Off Ignore Current Level:Off Immediate Effect:On ]
     A3: Load App [ App:Screen Filter Data: Exclude From Recent Apps:Off ]
     A4: Airplane Mode [ Set:On ]
     A5: Notify LED [ Title:Battery low Text:Battery under %BATT percent!
          Will switch to battery saving mode. Icon:ipack:crystalhd:cache Number:%BATT Colour:Red Rate:1000 Priority:3 ]
     A6: Zoom Visibility [ Element:Extreme battery save.w / StateON Set:On ]

The normal mode profile could look like this and be activated when a power source is connected:
Profile: Power source connected (11)
     State: Power [ Source:Any ]
Enter: Energy save (17)
     B1: Notify Cancel [ Title:Battery low Warn Not Exist:Off ]
     B2: Airplane Mode [ Set:Off ]
     B3: Display Brightness [ Level:128 Disable Safeguard:Off Ignore Current Level:Off Immediate Effect:On ]
     B4: Auto Brightness [ Set:On ]
     B5: Zoom Visibility [ Element:Extreme battery save.w / StateON Set:Off ]
     B6: Run Shell [ Command:am force-stop com.haxor Timeout (Seconds):0 Use Root:On Store Output In: Store Errors In: Store Result In: ]

The line B6 kills the screen filter app if it is running and will do nothing if it's not running. To create it go to Script -> Run shell -> and enter the command am force-stop com.haxor :) The downside of this powerful command is, it needs root. Maybe you can get the same result by setting up the action App -> Kill App -> Screen filter. No guarantee on this.
You should have problems with creating lines A6 and B5 yet, as there is no Zoom widget yet. So... stay with me after the commercial break....

...your ads here...


Off
Again there is a widget to switch this on and off from the home screen dynamically.
My widget looks like this, you will need two icon packs and the app Zoom to get the same result:

More information on Zoom and how to setup cool widgets can be found on google and here.
Import my Zoom profile by saving the following file as "Extreme_battery_save.w.ztl.xml" under sdcard/Zoom/templates. Then open Zoom and press menu key -> Browse Templates -> Import Directory -> Extreme_battery_save.w.ztl.xml. Now create this Zoom 1x1 widget on your home screen.
<class name="Template" index="">
 <backColour>#00000000</backColour>
 <borderColour>#FFFFFFFF</borderColour>
 <borderWidth>0</borderWidth>
 <cellData>180,187,0,0;186,130,0,0</cellData>
 <cellsHigh>1</cellsHigh>
 <cellsWide>1</cellsWide>
 <marginWidth>4</marginWidth>
 <name>Extreme battery save.w</name>
 <class name="Element" index="elements0">
  <elementType>Image</elementType>
  <heightLand>199</heightLand>
  <heightPort>178</heightPort>
  <name>StateOFF1</name>
  <visible>true</visible>
  <widthLand>159</widthLand>
  <widthPort>159</widthPort>
  <xLand>0</xLand>
  <xPort>0</xPort>
  <yLand>0</yLand>
  <yPort>0</yPort>
  <class name="ImageElement" index="state0">
   <alpha>255</alpha>
   <stateName></stateName>
   <uri>ipack://net.dinglisch.android.ipack.transparentglasshd/lightning2_sc48</uri>
  </class>
 </class>
 <class name="Element" index="elements1">
  <elementType>Image</elementType>
  <heightLand>199</heightLand>
  <heightPort>178</heightPort>
  <name>StateOFF</name>
  <visible>true</visible>
  <widthLand>159</widthLand>
  <widthPort>159</widthPort>
  <xLand>0</xLand>
  <xPort>0</xPort>
  <yLand>0</yLand>
  <yPort>0</yPort>
  <class name="ImageElement" index="state0">
   <alpha>255</alpha>
   <stateName></stateName>
   <uri>ipack://net.dinglisch.android.ipack.transparentglasshd/lightning2_sc48</uri>
   <class name="TaskAction" index="onClick0">
    <name>Extreme battery save</name>
   </class>
  </class>
 </class>
 <class name="Element" index="elements2">
  <elementType>Image</elementType>
  <heightLand>199</heightLand>
  <heightPort>178</heightPort>
  <name>StateON</name>
  <visible>false</visible>
  <widthLand>159</widthLand>
  <widthPort>159</widthPort>
  <xLand>0</xLand>
  <xPort>0</xPort>
  <yLand>0</yLand>
  <yPort>0</yPort>
  <class name="ImageElement" index="state0">
   <alpha>200</alpha>
   <stateName></stateName>
   <uri>ipack://net.dinglisch.android.ipack.crystalhd/cache</uri>
   <class name="TaskAction" index="onClick0">
    <name>Energy save</name>
   </class>
  </class>
 </class>
</class>

6 comments:

  1. Benny! Great stuff, thank you! When do you plan on posting your battery saving profile you talked about as #2 on lifehacker? (2%/ hr on standby)

    ReplyDelete
    Replies
    1. Hi Travis,
      I allready did!
      Take a Look here :
      http://technologyworkroom.blogspot.de/2013/05/tasker-energy-saving-mode.html .
      Hope you like it, leave your opinion in the comments. Enjoy!

      Delete
  2. Benny are you going to post something for your jarvis assistant. I really like the other guides you wrote.

    ReplyDelete
  3. I have recently started a web site, the info you offer on this website has helped me tremendously. Also it has excellent and very informative. After going through this great content i came to know lots of things which will help me to enrich my knowledge.

    Check out customer conversion

    ReplyDelete
  4. This worked perfectly to kill Screen Filter with Tasker.

    I originally tried to use:

    App > Kill App > Screen Filter

    It would remove the filter but I'd be left with a notification and Screen Filter still running, now just disabled.

    Using your method takes off the filter and will completely kill Screen Filter using Tasker.

    ReplyDelete
    Replies
    1. great it helped!
      I wrote a new post with an improved battery saving mode, maybe something for you :)

      Delete