How I extended the battery life of my Bluetooth headphones by >1000%! — #ProductHack

Graham Wright
5 min readJun 8, 2020

--

I devised a #ProductHack to extend the battery life of the Bluetooth headphones by >1000%!

This works for headphones which stay connected even when audio isn’t playing but turn themselves off when not connected to anything. If yours do this, read on to find out how to take advantage and save your battery!

Table of Contents

Introduction

In this post, I share the motivation for my project and give a step by step guide so you can set it up too.

  • Complexity: Medium
  • Setup Time: ~50 minutes

Or if you’re already a Tasker whizz (or have already followed Getting started with Tasker), you’ll need just ~20 minutes & feel free to skip the rest of the Introduction!

Motivation

I like to listen to podcasts when I fall asleep (in fact, I struggle to sleep without it!) and I use a pair of extra comfortable sleeping Bluetooth headphones for this. By the time my podcast has finished, the dulcet tones of a scientist or historian, have usually done their job.

In the morning I take and turn the headphones off and place them on my bedside table. But when I resume my routine the next night, there’s a problem: the battery is completely flat from spending the whole night on without actually playing anything! Yes, I can charge it, but 1- its a pain in the ass and 2- I forget, OK?!

Demo available at: 03:55

Enter Tasker!

Solution Summary

I built a script to recognise when Audio has permanently stopped playing and automatically disconnect my headphones. Once disconnected, the headphones soon workout they’re not needed and turn themselves off. Instead of 8 hours, the headphones have been on for 40 minutes, and they last 12 nights, instead of 1!!! (I think even I can manage to charge them once a fortnight… ;-) )

Comparison with other options

There are apps such as SleepTimer and AutoBluetooth or an IfThisThenThat applet which could be used to somewhat similar effect. However all of these options:

  • either require the user to specify and stick to rules based on time.;
  • / or require the user to actively activate a timer each time; and

On top of that, they:

  • apply irrespective of whether you’re still listening to a podcast; and
  • turn off Bluetooth as a whole (removing your connection to any other devices, such as your smartwatch, and requiring you to turn it back on at some other point)

By contrast, after initial setup, the solution I share offers a zero-intrusion User Experience (UX):

  • works automatically, anytime, anywhere based solely on whether you are still listening to audio or not
  • only disconnects the specified device and leaves Bluetooth on or others connected

Getting Setup

Pre-requisites

You’ll want the following equipment to get started

  • Android Phone
  • Bluetooth Audio Device

Tested On

The setup I have tested with is:

There’s no reason why other combinations wouldn’t work either.

Installations

You’ll need to install and configure the following Android Apps

  • Tasker
  • AutoApps: AutoTools
  • AutoApps: AutoNotification

nb. There are some not so obvious configurations required — see my introductory guide for how to do this.

Script download and import

The project is made freely available for download on a site called Taskernet, used by Tasker writers to freely share their projects:

  1. On your device on which Tasker is installed, open the Share Link For the ‘Bluetooth Audio Device Battery Saver’ Project — you will be greeted with the Task Data “Import Screen”.
  2. To continue, press the green “Import” button — This will open the Tasker app and provide you with the Import Confirmation dialogue.
  3. Proceed with the Import process.
  4. Click “OK” and the Profile/Task/Project will be imported into Tasker —
  5. Accept the offer to enable the Profiles.

nb. Before attempting to run the Tasker project, follow the steps in the ‘Personalising the Script’ section below. Further details about the Taskernet import process here or here.

Using the project

Personalising the Script

Configuring Variables

The script relies on configurable values, some of which it is required for you to specify e.g. the name of the audio device you want to disconnect. Use the instructions listed in ‘SETTING ANY VARIABLE’ (below) to amend those you need to change.

REQUIRED PERSONALISATION

%BABS_Device_Name The name of your Bluetooth Audio Device (as it appears in your mobile’s Bluetooth list). Only the specified device will be checked for and no others. If your device connects to multiple devices of the same name, any of them will be matched.

The following video shows how to locate the name of your Bluetooth Audio devices, and configure them.

OPTIONAL PERSONALISATION

%BABS_Reconfirm_Buffer_Seconds The number of seconds to wait after an initial indication that audio is not playing when the specified device is also connected, before rechecking a final time. After rechecking, if audio is again not playing, the specified connected device is disconnected. You might want to tweak this value depending on your typical behaviour e.g. in between tracks. 35 seconds is given as the default.

ADVANCED

%BABS_LOG If set to true, the variable %BABS_LOG_Last_Audio_Check and %BABS_LOG_Last_Disconnect will be set to the last date and time each time the relevant steps are executed. This assists in debugging to check that the Tasker script is working correctly, even after your phone is locked, or in the morning after you’ve fallen asleep!

SETTING ANY VARIABLE

All the variables used in the script are listed in the Project’s Task screen under the Task BABS Initialize Variables. This section describes how to amend them.

  • Within the BABS project, navigate to the ‘Task’ tab (top menu bar), locate and open the BABS Initialize Variables Task
  • Locate and open the ‘Variable Set:’ task for the variable you are interested in.
  • In the ‘To’ section, replace the present value with the value you would like to set.
  • Press the 🔙 back button (top left) to exit the ‘Variable Set:’ step.
  • Press the ▶️ play button (bottom left) to process the changes.

IMPORTANT: Even if there are no settings you want to change, please follow at least the first and last steps once to initialise the variables used in the project.

Configuring Notifications

By default, the profile is programmed to detect media changes only from Media playing apps. If you would like to be even more specific so that it only applies to particular apps (such as your Podcast app) you can do so.

Running the Script

With everything configured correctly, the following describes the outcome you should be able to observe.

Given

  • your named Bluetooth headphones are connected; and
  • audio is playing from one of your media apps

When

  • audio stops to play and stays not playing for your specified buffer time

Then

  • your Bluetooth headphones will be automatically disconnected; and
  • your Bluetooth headphones will remain on (and depending how they operate, turn themselves off after a while)
  • your phone’s Bluetooth service will remain on

The script should not impact Bluetooth devices other than the one you name.

Final Note

I hope this project helps you extend the battery life of your Bluetooth headphones, or better still, inspires you to tackle your own phone usability project! Enjoy!

More

Check out another of my product hacks: How I send pay-wall articles from my Phone to Kindle in one click! — #ProductHack

--

--