Battery Buddy

Rating: 
4.88889
Your rating: None Average: 4.9 (45 votes)

Fully discharging a battery and charging it back to full charge again wears it out sooner than you might expect. Battery Buddy can help you increase the battery lifetime by automatically pausing and resuming charging. You can set alerts for low and full enough charge levels, too.

New! Version 4.3.0 adds support for PineTab, developed by nephros! Thank you!

New! Version 4.2.0 adds support for setting maximum charge current for selected devices.

New! Version 4.1.0 adds initial support for Jolla Tablet.

Important: Sailjail support is enabled in Battery Buddy 4.0.0-1, which means it requires at least Sailfish OS 4.3 to work properly. For Sailfish OS 3.3 and up you should be able to use Battery Buddy 3.17-1. For older versions Battery Buddy 3.15-1 should work fine. For Sailfish OS 2.2 you have to download the legacy build.

The application comes with a service component that takes care of charger control and alerts. This means that the application doesn't have to be opened for alerts and limits to work - which is against Jolla Store policy, and hence worth mentioning here. You can control the service from the application (start/stop and enable/disable on boot).

There is now a logging option, which can be accessed via the Settings page pulley menu, with three logging options. You can copy the log contents, too, so submitting the service log for debugging purposes is now a lot more convenient! Using --verbose and --debug flags still work as before.

Please note that the charger control mechanism may not work for every device out there. So far it has been successfully tested with the following devices:

  • F(x)tec Pro¹
  • Fairphone 2
  • Jolla Phone
  • Pine64 PineTab
  • Sony Xperia 10 / 10 II / 10 III
  • Sony Xperia X / X Compact
  • Sony Xperia XA2 / XA2 Plus / XA2 Ultra
  • Sony Xperia Z3 Compact Tablet

For some devices there's partial support:

  • Sony Xperia 10 V (pausing and resuming charger doesn't yet work)

Please let me know if it works for your device, or if it doesn't work!

Bug reports and translations are most welcome!

If you like my work and would like to support me, you can now buy me a coffee.

Source code can be found in GitHub.

Screenshots: 
Application versions: 
AttachmentSizeDate
File harbour-batterybuddy-3.16.2-1.aarch64.rpm128.95 KB24/11/2021 - 23:09
File harbour-batterybuddy-3.16.2-1.armv7hl.rpm125.24 KB24/11/2021 - 23:09
File harbour-batterybuddy-3.16.2-1.i486.rpm134.58 KB24/11/2021 - 23:09
File harbour-batterybuddy-3.17.0-1.aarch64.rpm129.5 KB20/03/2022 - 00:52
File harbour-batterybuddy-3.17.0-1.armv7hl.rpm126.65 KB20/03/2022 - 00:52
File harbour-batterybuddy-3.17.0-1.i486.rpm135.81 KB20/03/2022 - 00:52
File harbour-batterybuddy-4.0.0-1.aarch64.rpm127.77 KB20/03/2022 - 21:53
File harbour-batterybuddy-4.0.0-1.armv7hl.rpm124.93 KB20/03/2022 - 21:53
File harbour-batterybuddy-4.0.0-1.i486.rpm134.15 KB20/03/2022 - 21:53
File harbour-batterybuddy-4.1.0-1.aarch64.rpm174.43 KB28/08/2022 - 01:34
File harbour-batterybuddy-4.1.0-1.armv7hl.rpm172.03 KB28/08/2022 - 01:34
File harbour-batterybuddy-4.1.0-1.i486.rpm181.84 KB28/08/2022 - 01:34
File harbour-batterybuddy-4.1.1-1.aarch64.rpm174.7 KB28/08/2022 - 10:45
File harbour-batterybuddy-4.1.1-1.armv7hl.rpm172.31 KB28/08/2022 - 10:45
File harbour-batterybuddy-4.1.1-1.i486.rpm182.25 KB28/08/2022 - 10:45
File harbour-batterybuddy-4.2.2-1.aarch64.rpm177.35 KB01/01/2023 - 02:59
File harbour-batterybuddy-4.2.2-1.armv7hl.rpm174.72 KB01/01/2023 - 02:59
File harbour-batterybuddy-4.2.2-1.i486.rpm184.81 KB01/01/2023 - 02:59
File harbour-batterybuddy-4.2.3-1.aarch64.rpm179.55 KB04/03/2023 - 16:28
File harbour-batterybuddy-4.2.3-1.armv7hl.rpm176.99 KB04/03/2023 - 16:28
File harbour-batterybuddy-4.2.3-1.i486.rpm187.25 KB04/03/2023 - 16:28
File harbour-batterybuddy-4.2.4-1.aarch64.rpm179.8 KB05/03/2023 - 12:30
File harbour-batterybuddy-4.2.4-1.armv7hl.rpm177.11 KB05/03/2023 - 12:30
File harbour-batterybuddy-4.2.4-1.i486.rpm187.22 KB05/03/2023 - 12:30
File harbour-batterybuddy-4.2.5-1.aarch64.rpm182.66 KB05/03/2023 - 12:51
File harbour-batterybuddy-4.2.5-1.armv7hl.rpm180.05 KB05/03/2023 - 12:51
File harbour-batterybuddy-4.2.5-1.i486.rpm190.07 KB05/03/2023 - 12:51
File harbour-batterybuddy-4.3.0-1.aarch64.rpm177.52 KB17/04/2023 - 20:02
File harbour-batterybuddy-4.3.0-1.armv7hl.rpm175.28 KB17/04/2023 - 20:02
File harbour-batterybuddy-4.3.0-1.i486.rpm185.39 KB17/04/2023 - 20:02
File harbour-batterybuddy-4.3.1-1.aarch64.rpm177.67 KB22/04/2023 - 16:48
File harbour-batterybuddy-4.3.1-1.armv7hl.rpm175.31 KB22/04/2023 - 16:48
File harbour-batterybuddy-4.3.1-1.i486.rpm185.54 KB22/04/2023 - 16:48
File harbour-batterybuddy-4.3.2-1.aarch64.rpm178.04 KB25/04/2023 - 08:48
File harbour-batterybuddy-4.3.2-1.armv7hl.rpm175.3 KB25/04/2023 - 08:48
File harbour-batterybuddy-4.3.2-1.i486.rpm185.55 KB25/04/2023 - 08:48
Changelog: 

4.3.2-1

  • Fix maximum charge current setting

4.3.1-1

  • Update Polish translation (thanks, wetab73)
  • Update translation files in the repository

4.3.0-1

  • Add PineTab support (thanks, nephros)
  • Add Russian translation (I checked this time!) (thanks, sprainbrains)

4.2.5-1

  • Fixup! Include all translation files (include Slovak)

4.2.4-1

  • Fixup! Battery health is not displayed correctly

4.2.3-1

  • Add Slovak translation (thanks, okruhliak)
  • Update Swedish translation (thanks, eson57)
  • Add Support for AC Charger detection (thanks, nephros)
  • Be more efficient with handling file paths in constructors
  • Fix package dependencies

4.2.2-1

  • Replaces broken 4.2.0 and 4.2.1 releases
  • Restart the permission service on update
  • Properly read and set max current values on first startup
  • Add setting maximum charge current

4.1.1-1

  • Fixup! Use correct colors in battery graphic
  • Fixup! Enable low battery animation
  • Move all subpages to MainPage pull down menu
  • Update Swedish translation (thanks, eson57)
  • Update Polish translation (thanks, wetab73)
  • Update copyrights

4.1.0-1

  • Initial Jolla Tablet support (beta)
  • Redesign the logo and battery graphic
  • Search for control files using loops
  • Don't try to use non-existent files
  • Remove unused signals from service
  • Update Swedish translation (thanks, eson57)
  • Use ColumnView to show the log contents with formatting (thanks, nephros!)
  • Log charging/discharging current
  • Log temperature changes with resolution of one degree Celsius
  • Assume the charge current value always changes
  • Print correct log file name
  • Invert the charge current sign if necessary
  • Print changelog at the end of the build script
  • Use custom ImageButton in About page
  • Remove unused files
  • Rename internal logging functions for clarity
  • Built with Sailfish OS SDK 3.9 for 4.4.0.68

4.0.0-1

  • Enable sandboxing with appropriate permissions (GUI only)
  • Use QML DBusInterface for user service manipulation
  • Drop support for SFOS 4.2 and older
  • Clean up systemd service handling during install/update/uninstall
  • Built with Sailfish OS SDK 3.8 for 4.3.0.12

3.17.0-1

  • Disable sandboxing
  • Fix install/upgrade/uninstall scriptlets
  • Service binary consumes less resources
  • Don't try to close notifications if they are not open

3.16.2-1

  • Fix .spec bin file path (thanks, leon and nephros)
  • Built with Sailfish OS SDK 3.7 for 4.3.0.12

Full changelog in GitHub.

Comments

nephros's picture

I think it is triggered by selecting pause and then resume in the app but not sure.

direc85's picture

Does rebooting the device help? Well, technically, restarting the daemon is what I'm after:

`$ devel-su systemctl restart harbour-batterybuddy.service`

nephros's picture

Removed the file, restarted the app, turned off notifications and increased the interval but still notifications every minute.

nephros's picture

Same here.

[General]
highAlert=@ByteArray(85)
highLimit=@ByteArray(85)
interval=@ByteArray(600)
limitEnabled=@ByteArray(0)
lowAlert=@ByteArray(10)
lowLimit=@ByteArray(49)
notificationHighText=Please disconnect the charger.
notificationLowText=Please connect the charger.
notificationTitle=Battery charge %1%
notificationsEnabled=@ByteArray(0)
PawelSpoon's picture

Hi, since the last update i get notifications on low battery, buti did not choose the option. So should not receive any notification interval is also ignored. Do get a message every minute.

direc85's picture

Could you post contents of `~/.config/harbour-batterybuddy/harbour-batterybuddy.conf`?

oxygenh's picture

3.1.1 - It's ok on Sony XPeria X Compact (SailfishX 3.3.16).
direc85, thank you very much!
Feature request: integfrate conrols at system seеtings ;)

direc85's picture

Great! Adding it to the list!

Controlling battery settings from within Settings app actually makes a lot of sense... Let's see if I'll make it happen :)

oxygenh's picture

Thank you very much. For example you can see as it made at Battery notifier 2 by Schturman ( https://openrepos.net/content/schturman/battery-notifier-2 )

michl's picture

Also workson F(x)tec Pro¹!

Nice Job! Thank you!

It uses /sys/class/power_supply/battery/input_suspend

direc85's picture

Great! Thanks for the info! I'll add it to the description!

dumol's picture

Charge control is really cool, thanks! Please don't forget about adding a donation link. ;-]

UiPo1goo's picture

Very nice idea to use github. I opened two issues: Charging won't suspend after upper limit reaches.
Notification interval should be splitted.

direc85's picture

Thanks, noted!

direc85's picture

Hello Sailors!

I rewrote the systemd service, which was a huge task! It's in the famous state "works for me", but I decided to first release it only on GitHub to avoid accidental installation. Please proceed with care and let me know how it works for you and your specific device! Thanks!

Edit: The front page still says that it is required to be kept opened for working properly, but that's no longer true. I'll fix it in the next beta release :)

objectifnul's picture

Seems that some notification should be amended: "Please disconnect the charger" would make more sense than "Please connect the charger" when the upper limit is reached.

babba22's picture

Hi direc, wonderful app! There's only one thing I would like to ask you: at the moment, when the battery reaches the pause charging limit, not only the battery isn't charged anymore (excellent!), but the phone use the battery power. Is it possible to make it use the AC power instead? This way the battery would be preserved even more

direc85's picture

I looked into it while I implemented the charger mechanism, but it looks like it's not possible with the current, uh, adaptation layer? Binary driver blobs? I don't know, but there doesn't seem to be any control over that.

The best you can get is to set start and stop percentages close to one another, say 80% and 79% so that the charge stays as constant as possible.

babba22's picture

Ok, I understand. Thank you very much for the app!

zipotron's picture

Dude, amazing app! Thanks a lot for that!!! Just a consideration, if you could deamonize the app is going a be just perfect !

direc85's picture

Thanks! I'll implement the service at some point for sure!

oxygenh's picture

I have issue: I'm not receiving notification, when charge below low limit or higher upper limit.
( http://prntscr.com/rn0vff )
ps: but charging control work good.
My settings: Sailfish X 3.2.1.20 (Sony xperia x compact)
console log:

[nemo@Sailfish ~]$ harbour-batterybuddy
[I] unknown:0 - Starting Battery Buddy...
[I] unknown:0 - Loaded lowAlert 39
[I] unknown:0 - Loaded highAlert 85
[I] unknown:0 - Loaded interval 300
[I] unknown:0 - Loaded limitEnabled 1
[I] unknown:0 - Loaded notificationsEnabled 1
[I] unknown:0 - Loaded lowLimit 76
[I] unknown:0 - Loaded highLimit 85
[I] unknown:0 - Loaded limitEnabled 1
[I] unknown:0 - Reading capacity from "/sys/class/power_supply/ba
ttery/capacity"
[I] unknown:0 - Reading charge state from "/sys/class/power_suppl
y/battery/status"
[I] unknown:0 - Reading charger status from "/sys/class/power_sup
ply/usb/present"
[I] unknown:0 - Controlling charging via "/sys/class/power_supply
/battery/charging_enabled"
[W] unknown:0 - Theme dir "/usr/share/themes/jolla/meegotouch/z1.
25/" does not exist
[I] unknown:0 - Launching GUI...
[W] unknown:518 - file:///usr/lib/qt5/qml/Sailfish/Silica/private
/PulleyMenuBase.qml:518:29: Unable to assign [undefined] to float
[W] unknown:518 - file:///usr/lib/qt5/qml/Sailfish/Silica/private
/PulleyMenuBase.qml:518:29: Unable to assign [undefined] to float

direc85's picture

Thanks for the --debug output below (you can remove it now so that there's less clutter).

I tested it, too, and it looks like I managed to break the notifications at some point. I'll fix it and release a new version soon (hopefully today).

EDIT: I deleted the debug output comment.

oxygenh's picture

Thank you very much! My issue absolutely fixed with last release. It's cool! Superbe!

direc85's picture

You're welcome!

direc85's picture

Try to run the application using "harbour-batterybuddy --debug". Its actually not documented yes. Whoops. And I still have to add debug stuff.

oxygenh's picture

Thank you very much for vry usefull app. Do you have plan built in system setting (like battery notifier), and make daemon?

direc85's picture

Thanks! Most likely I will do that in a month or so; I suddenly managed to rid myself of all free time for a month '-.-

oxygenh's picture

It will be cool! I will wait. Thank you.
Where do i send little donat? ;)

direc85's picture

TBH I'm working on it. Thank you for asking :)

Pages