πŸ”‹ Battery Charge Level Alert

by Patrick Corgan

Version 1 (August 21, 2023)

Download (44 downloads)

Increase battery lifespan by avoiding over-charging. This flow gives you the option to play a sound, vibrate, or flash the flashlight when your battery charge reaches your chosen percentage. You can choose any combination of these alert methods (including none, if you really march to the beat of your own drum). Unplug the charger to end the alert. This won't stop the flow; it'll go back to waiting for the battery to be charging.

You can pick or change the alert sound with the "Pick Alert Sound" flow beginning. Hit the back arrow in the upper left when you've chosen the one you want. Even if you disable the alert sound, your choice will be remembered.

The flow reads all settings just before sounding an alert. So all settings can be changed on the fly, and will take effect immediately.

The flow requires premium as-is, but can be trimmed down. If you don't mind losing the ability to check which sound is your alert sound, you can delete the "Check alert sound" flow beginning and all the subsequent blocks.

Also, what with one thing and another, this flow's log file will grow quickly when the phone is charging. Just so you know.

πŸ”Έπ™π™šπ™¦π™ͺπ™žπ™§π™šπ™¨ π™₯π™§π™šπ™’π™žπ™ͺπ™’πŸ”Έ

------------------------------
π˜‰π˜Ί π˜—π˜’π˜΅π˜³π˜ͺ𝘀𝘬 𝘊𝘰𝘳𝘨𝘒𝘯
πŸ› οΈπ•”π• π•žπ•žπ•–π•Ÿπ•₯𝕀 π•’π•Ÿπ•• π•”π•£π•šπ•₯π•šπ•”π•šπ•€π•žπ•€ π•¨π•–π•π•”π• π•žπ•–βš’οΈ
------------------------------

---FLOW SETTINGS---
[[Thank you to Hub Space for the most excellent flow "πŸ“πŸŽ“ Load Variables from Flow Description" (https://llamalab.com/automate/community/flows/44477) for this functionality.]]

USE_SOUND
true: Play selected sound when battery alert level is reached.
false: Don't play sound.

USE_VIBRATE
true: Vibrate when battery alert level is reached.
false: Don't vibrate.

USE_FLASH
true: Flash the flashlight when battery alert level is reached.
false: Don't turn on the flash.

BATTERY_ALERT_LEVEL
Battery percentage at which to sound the alert. Try your best to keep the value between 1 and 100. Between 85 and 95 is probably best.

@.env{
"USE_SOUND": true,
"USE_VIBRATE": true,
"USE_FLASH": false,
"BATTERY_ALERT_LEVEL": 90
}#.env

π—‘π—Όπ˜π—²
Use care when changing values in this section. Any value used for 'USE_SOUND', 'USE_VIBRATE', or 'USE_FLASH' will evaluate to either "true" or "not true", but for clarity it's best to stick to "true" and "false" or 1 and 0. Similarly, no check is performed on the value in 'BATTERY_ALERT_LEVEL'. You could set it to "IAmAnIdiot", and while this would be true, it's not going to be too useful.

Also the stute fish will note that the values are formatted as a JSON object. There's no error trapping or formatting checks so the flow will error out if you screw up the format.