Smart Charge B (Battery Config, Day/Night, IFTTT)

by Henrique Lisboa

Version 1 (January 14, 2021)

Download (74 downloads)

Most users will be better using the other flow: https://llamalab.com/automate/community/flows/38250

Alternative to my other Smart Charge Flow with the use of two smart plugs. I could create a automation scene in the Smart Life app and control the two plugs at the same time with just one http request. But I don't like to do that (activate and deactivate both plugs when I'm just using one). And since with IFTTT free plan you can only have 3 applets, you can't control de two plugs individually with on and off commands.

So with this flow I control the bedside (Night) plug with the plugon and plugoff command and the work desk (Day) plug with the plugswitch command (which toogles the plug). I use this because I'm in home office and my phone keeps connected almost all the time. So in this alternative flow, the min charge is only used for notifications and the mid charge is used for both Day and Night modes. The rest is quite similar to the original flow.

To preserve battery health, studies indicate that the battery level needs to be mantained between 30% and 80% (SoC of 80% and DoD of 50%). This is the default for the Day mode. For the the Night (Scheduled) mode, the default DoD is 5%. See more at: https://batteryuniversity.com/learn/article/how_to_prolong_lithium_based_batteries

If the battery level is above or bellow the desired configurable levels and the Day Smart Charge Tile is active or the Night Smart Charge Tile is active and in the selected time window, sends a HTTP request to IFTTT to turn on or off the smart plug. If not, just sends a urgent notification to remind the user.

By default both modes are disabled and the flow will just give you notifications. So make sure to put the Automate Unused Tiles in the Quick Panel so you can control this flow. The Day mode is activated with a click and the Nigth Mode needs to be active and in the selected time period. The Night mode takes precedence if both modes are active.

To use the tiles, acess your phone Quick Tiles configuration (normally the tree dots in the notification panel) and put two tiles named or the flow won't work.

Be sure to get Automate out of Android's battery optimizations and to not let your device sleep, or Wi-Fi might not work for the HTTP request despite the flows reconnection efforts.

To get IFTTT to work, follow this instructions I got from Liz Calkins flow (https://llamalab.com/automate/community/flows/38090):

"First get your smart plug service hooked up to IFTTT, then make two applets:

Webhook "Receive a web request" with "{eventname}on" ("plugon", for example) > Service - "Switch on"
Webhook "Receive a web request" with "{eventname}off" ("plugoff", for example) > Service - "Switch off"

Make note of both the Event Name (everything before the "on/off", "plug", for example) you used and your Maker Key from My Services > Webhooks > Documentation in the IFTTT app."