It should come to no surprise for those that know me, but I'm a bit of an "Internet of Things" fan. Years ago I caught the IoT bug and I don't see it going away anytime soon. I'm constantly thinking of ways to automate my daily life, both at home and at work. I've been using Tasker for my Android phone since 2010, for everything from saving my battery to automating geo and event-based notifications (my wife appreciates it when my device texts her that I left work).
Then something called IFTTT (If This Then That) came along and openend up another world of possibilities - letting the layman (ie - non-developer or non-techie) create cloud connections between services and apps that would nornally never be integrated. Yahoo! experimented with this when they launched a product called Yahoo! Pipes but it fell flat because it wasn't something the average consumer could understand how to use - API? What's an API?.
Now, automation is reaching the masses and store shelves. WiFi is popping up in everthing now: light bulbs, switches, security cameras, thermostats, coffee-makers. This enables connectivity to the cloud, which means connectivity to Web hooks, APIs and cloud-based ETL services like IFTTT and Zapier. Simply put: your favorite apps - example: Instagram and Google Drive - can now talk to each other, which means a whole plethera of integration opportunities (commonly called recipes or connections) to help make your life easier by automating the routine stuff you do everyday.
But enough of the background. Let's walk through how to use some of these tools together to help you with something you do on a daily or nightly basis: charge your smartphone.
As a smartphone user, I want to limit how long my phone charges for so that I don't overcharge my battery. Lithium-ion batteries will perform better and have an overall longer life if they're not always left on the charger (at 100%) or fully discharged (0%).
In short: an app on my phone (Tasker) will send an SMS "trigger" to the cloud ETL service (IFTTT), which will then take the "action" of turning off the charger by cutting the power to the outlet (WeMo Switch device).
Follow the instructions that came with the WeMo switch. Basically, this will include connecting the device to your WiFi network and then connecting the device to the WeMo app (available via Google Play).
After you create an account in IFTTT, search for the WeMo channel and activate it. This will link your WeMo switch with your IFTTT account.
Search for the SMS channel in IFTTT and activate it. This will allow IFTTT to accept SMS messages from your device, to a phone number that they assign to you.
Create this recipe from scratch - IF THIS: an SMS message is sent to IFTTT, tagged with #phonecharged, THEN THAT: turn off my WeMo Switch. Or, simply use the recipe that I published and shared below:
Here are the steps for Tasker. First, create a profile with the state Power-AC and Battery Level 97 to 99. What this means is that when your phone is plugged into the AC outlet and when the battery level reaches 97, the tasks can be executed.
Next, create a task that sends the SMS message to your IFTTT SMS number, with the appropriate tag #phonecharged (or whatever you entered in the IFTTT recipe). You'll notice that in my task, I also added a Say step to give me a verbal queue that the charge is complete. In addition, I also hooked this up to another IFTTT recipe that blinks my kitchen lights, so that I have a visual queue as to when my phone is charged.
To recap the Tasker steps:
Finally, check to make sure the profile is active. If you like, you can test the entire recipe (Tasker + IFTTT) by selecting the arrow in the Task Edit screen. In conclusion, this may seem a bit pricy to extend your battery life by 6 to 12 months (or whatever the gain ends up being). However, I consder this fun and that WeMo switch will certainly come in handy for other purposes (think security for lights) if this recipe doesn't do it for you.