Android: automatically starts and stops charging using AutomateIt and IFTTT

Modern smartphones are powerful computers and they could/should do things smartly! Such as automatically executing some frequent tasks.

The first thing I want to automate is “smartly charging” my smartphone to prolong its life: to start charging the smartphone when its battery level is below 65% and to stop charging when it is above 75%, as recommended by Battery University.

In my last blogpost I shared a few things that Google Assistant were good at. I want to turn my ASUS Zenfone 3 into an always on voice assistant, like a Google Home. I have to keep Zenfone 3 screen awake but I don’t want to charge it continuously since it is not good to the battery life, according to Battery University.

I need three things to make “smart charging”:

1.a plug or a charger which can be turned on/off dynamically. I have a TP-Link HS110 smart plug and it Kasa app. Checked. which can programmatically control the TP-Link HS100. TP-Link Kasa supports IFTTT. Checked.

3.a tool which can provide input to IFTTT based on the Zenfone battery level. There is a IFTTT trigger service “Android Battery”, however I find this IFTTT trigger service checking frequency is too low (every 15min). It doesn’t always work! I need something more…

Luckily we have the amazing app AutomateIt. I set up two rules:

(a)send an email to my gmail when battery level drops to 65%, and

(b)send an email to my gmail when battery level rises above 75%.

Then I create an IFTTT applet:

THIS condition: any new gmail from with me as the sender, and

THAT action: toggle the TP-Link HS100 smart plug

AutomateIT executes rules instantly. The IFTTT Gmail trigger service checks about every 5 minutes. They works hand in hand to keep 65% < battery level < 75%.

All these make Zenfone a smart device – to do the right things at the right times.

4 Comments on “Android: automatically starts and stops charging using AutomateIt and IFTTT”

  1. meeee says:

    Been tinkering around a while and stumbled accross your post.
    Question – why the first rule to toggle if below 65% – is your smartphone plugged in at all times?
    I’d plug it in manually and then activate the plug. Would I still need the first rule?

  2. meeee says:

    Got it to work, BUT: the IFTT Gmail Applet doen’t trigger promptly, only every few hours, so it’s completely unuseable for this purpose.
    How did you go along with this?

  3. None says:

    This is silly – just use one of the many android automation apps to call an ifttt web hook trigger when the battery hits a certain level. No need to use email.

  4. Tyler Davis says:

    It looks like this functionality is sadly gone now, have you been able to duplicate it through another method?

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.