Saturday, June 28, 2014

Tasker profile: Better Battery Log

Do you ever unlock your phone, look at the battery % and go "Holly hell, 30%...! Was it this low when I locked it last? How much battery did drain since I last used it?" Sadly there's no stock/easy way of knowing for sure. The stock battery usage graph shows battery usage since last full charge, which doesn't help.

I want to check my battery drop since last I used the phone. So, I created a tasker profile that writes the time and remaining battery percentage to a file every time I turn the screen off. This way, when I turn the screen on after some time, I can check how much battery was lost while the phone was idle. If I see any drastic drop, I would know something is going wrong and investigate.


If you want to know what tasker is and what can be done with it, check out this beginner's guide.

Create empty log file
Using any file browser app, create an empty text file on your sdcard. For example, I created /sdcard0/BatteryLog.txt

Easily import Battery Logger profile
Download this file to your sdcard. Then open tasker and long press on the "Profile" tab. In the menu that opens, tap "Import". Locate the downloaded xml file and tap it. The Log Battery profile will be imported and ready to use.

OR Setup Battery Logger profile yourself
  1. On the tasker's profiles tab, tap the + button at the bottom right. Give a name to the profile. I gave "Log Battery".
  2. Next select the trigger event State > Display > Display state. Make sure it says "Is Off". Press back.
  3. A task selection list will pop up. Tap "New Task" here. Give it a name.
  4. In the task edit page, tap + at the bottom center > tap "File" > tap "Delete file".
  5. Tap the search icon at the right end of "File" and browse n select the BatteryLog.txt file.
  6. Tap "If" bar. Set condition %BATT > 98. Press back.
  7. Tap + at the bottom center > tap "Task" > tap "Wait". Set how much time you want to wait before noting down the battery. Then press back.
  8. Tap + at the bottom center > tap "File" > tap "Write file"
  9. Tap the search icon at the right end of "File" and browse n select the BatteryLog.txt file.
  10. Tap on the text field and enter "%DATE - %TIME - %BATT - MEMF" without the quotes. You can also tap the variable selector at the right end of this and enter other variables if you want.
  11. Enable the append and "Add newline" options. Press back.


You tasker profile is now ready. It will note down remaining battery percentage every time you turn off the screen. And every time the phone is fully charged, it will purge the record and start a fresh log.

Video Tutorial



Related Posts with Thumbnails