Smart battery charging optimizer for Android
Automatically manage your phone's charging to extend battery lifespan by preventing overcharging and overheating.
ChargeLimes helps extend your phone's battery life by intelligently controlling charging based on:
- Battery level (stop at X%, resume at Y%)
- Temperature (stop charging when too hot)
This app does NOT need root access. Instead, it uses an external WiFi smart plug (like a power relay) between your charger and wall outlet. The app tells the smart plug when to turn ON/OFF power to your charger.
Simple setup:
[Wall Outlet] β [WiFi Smart Plug] β [Phone Charger] β [Your Phone]
β
Controlled by app via WiFi
Lithium-ion batteries (used in all modern smartphones) degrade faster when:
- β Kept at 100% charge for extended periods
- β Charged in hot conditions (>30-35Β°C)
- β Subjected to high voltage stress
ChargeLimes prevents this by automatically stopping charging before hitting 100% and when temperature exceeds safe limits, significantly extending your battery's usable lifespan from ~2-3 years to 4-5+ years.
- π Battery-based charging control - Set custom charge start/stop levels
- π‘οΈ Temperature monitoring - Stop charging when phone gets too hot
- π 24h history chart - Visual battery & temperature tracking
- π Detailed logs - See every charging decision and HTTP request
- π Smart plug integration - Works with Tasmota, Shelly, and other HTTP-controlled smart plugs
- π¨ Material You - Adapts to your Android theme
- π Open Source - MIT licensed, community-driven
| Status | Settings | Logs |
Add screenshots to screenshots/ folder
- Android phone (8.0 Oreo or later)
- WiFi Smart Plug with HTTP control
- β Tasmota (recommended - what I use)
- β Shelly
- β Any smart plug with HTTP REST API
- Android 8.0+ (API 26+)
- WiFi connection (for smart plug control)
# Coming soon - app will be available on F-Droid- Download latest APK from Releases
- Install APK:
adb install chargelimes-vX.X.X.apk - Grant permissions (location for WiFi detection)
-
Configure Smart Plug URLs
- Settings β Smart Plug Control
- Enter your plug's ON/OFF URLs
Example (Tasmota):
Turn OFF: http://192.168.1.242/cm?cmnd=Power%20OFF Turn ON: http://192.168.1.242/cm?cmnd=Power%20ON -
Set Charging Rules
- Stop Charging: Battery reaches X% OR Temperature exceeds YΒ°C
- Resume Charging: Battery drops to X% AND Temperature cools to YΒ°C
-
Enable ChargeLimes
- Toggle switch in Status screen
- App runs as foreground service
- Android Studio Hedgehog+ (2023.1.1)
- JDK 17
- Android SDK 35
- Kotlin 1.9.0+
git clone https://github.com/yourusername/chargelimes.git
cd chargelimes
./gradlew assembleDebug# Via USB
./gradlew installDebug
# Via wireless ADB
adb connect 192.168.1.XXX:5555
./gradlew installDebugchargelimes/
βββ app/
β βββ src/main/
β βββ java/io/chargelimes/
β β βββ MainActivity.kt # Main UI (Compose)
β β βββ BatteryService.kt # Background service
β β βββ BatteryLogger.kt # DataStore logging
β β βββ BatteryData.kt # Data models
β βββ res/
β βββ values/strings.xml # Localization
β βββ drawable/ # Icons (Material You adaptive)
βββ screenshots/ # App screenshots
βββ LICENSE # MIT License
βββ README.md # This file
Event-Driven, KISS Principle
- MainActivity: Jetpack Compose UI with 3 tabs (Status/Settings/Logs)
- BatteryService: Foreground service listening to
ACTION_BATTERY_CHANGED - BatteryLogger: DataStore for 24h log retention
- HTTP Client: OkHttp for smart plug control
- β Event-driven (not polling) - efficient battery usage
- β 2-second debounce - prevents oscillation at thresholds
- β DataStore (not SQLite) - simpler for logs
- β Material3 + Material You - native Android feel
- β No analytics, no tracking - privacy-first
Stop Charging:
Battery: 80%
Temp: 35Β°C
Resume Charging:
Battery: 70%
Temp: 30Β°C
This keeps battery in optimal 70-80% range and prevents thermal stress.
- Check URLs are correct (test in browser)
- Verify WiFi restriction setting (if enabled)
- Check Logs tab for HTTP errors
- Android battery optimization may kill service
- Settings β Apps β ChargeLimes β Battery β Unrestricted
- Grant location permission (required for WiFi SSID access)
Contributions welcome! Please:
- Fork repository
- Create feature branch (
git checkout -b feature/AmazingFeature) - Commit changes (
git commit -m 'Add AmazingFeature') - Push to branch (
git push origin feature/AmazingFeature) - Open Pull Request
MIT License - see LICENSE file
TL;DR: Do whatever you want, just keep the copyright notice.
- Built with Jetpack Compose
- Icon design inspired by Material Design battery icons
- Smart plug control tested with Tasmota
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- F-Droid: Coming soon
Made with β‘ for battery longevity