Android: automatically starts and stops charging using AutomateIt and IFTTTPosted: February 16, 2018
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.
2.tools 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.