Battery Buddy

Rating: 
4.87879
Your rating: None Average: 4.9 (33 votes)

Note: Update to 3.15 resets all intervals to 24h, so please check the settings!

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.

Important: Battery Buddy 3.6-1 and later releases require SailfishOS 3.3. The legacy version that supports SailfishOS 2.2.0.18 and later can be downloaded manually from GitHub releases page.

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¹
  • Jolla Phone
  • Sony Xperia 10
  • Sony Xperia X
  • Sony Xperia X Compact
  • Sony Xperia XA2
  • Sony Xperia XA2 Ultra
  • Sony Xperia Z3 Compact Tablet

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.11-1.aarch64.rpm114.97 KB27/04/2021 - 21:49
File harbour-batterybuddy-3.11-1.armv7hl.rpm110.85 KB27/04/2021 - 21:49
File harbour-batterybuddy-3.11-1.i486.rpm118.87 KB27/04/2021 - 21:49
File harbour-batterybuddy-3.12-3.aarch64.rpm118.18 KB01/05/2021 - 00:06
File harbour-batterybuddy-3.12-3.armv7hl.rpm113.77 KB01/05/2021 - 00:06
File harbour-batterybuddy-3.12-3.i486.rpm121.86 KB01/05/2021 - 00:06
File harbour-batterybuddy-3.13-1.aarch64.rpm129.69 KB23/05/2021 - 16:27
File harbour-batterybuddy-3.13-1.armv7hl.rpm125.48 KB23/05/2021 - 16:27
File harbour-batterybuddy-3.13-1.i486.rpm135.5 KB23/05/2021 - 16:27
File harbour-batterybuddy-3.14-1.aarch64.rpm130.32 KB30/05/2021 - 21:23
File harbour-batterybuddy-3.14-1.armv7hl.rpm126 KB30/05/2021 - 21:23
File harbour-batterybuddy-3.14-1.i486.rpm136.14 KB30/05/2021 - 21:23
File harbour-batterybuddy-3.15-1.aarch64.rpm129.34 KB25/07/2021 - 21:15
File harbour-batterybuddy-3.15-1.armv7hl.rpm125.55 KB25/07/2021 - 21:15
File harbour-batterybuddy-3.15-1.i486.rpm135.04 KB25/07/2021 - 21:15
Changelog: 

3.15-1

  • Implement BackgroundActivity timed events
  • Drop keepalive-tool

3.14-1

  • Special pi version release :D
  • Use keepalive-tool to mitigate deep sleep
  • Update translators and credits
  • Update Polish translation (thanks, atlochowski)
  • Update Deutch translation (thanks, nephros)

3.13-1

  • Show battery temperature and condition (thanks, nephros)
  • Show notifications about abnormal temperature and condition (thanks, nephros)
  • Fix broken notifications on SFOS 3.4 and earlier
  • Bring back SFOS 2.2 support

Full changelog in GitHub.

Comments

enrish's picture

That was a quick implementation. Thanks!!!

zipotron's picture

Hi Derec! amazing improvement the daemon, just report a bug, plus the issue that if your battery is charged more than the lower boundary of charging regime and you plug the phone because you what to charge is not going a charge... there is another issue, if you deactivate the daemon, when restart is active again, could be nice to remember the active status and boot.
 Thanks!!!!

direc85's picture

Thanks! I actually forgot to check if the service is running or not when starting the app, fixing that soon!

There really should be a setting for enabling or disabling the service at boot, good idea! Fixing that soon, too!

enrish's picture

Thanks. I see, under the hood it's quite complicated, but the solution you described would be nice, hope it will turn out.
As for the feedback here is more: just now i run again into the ' connected but not charging issue'... This time I tried to press the 'Pause' button in the app (it was not already paused as 'Resume' was greyed out) then 'Resume' again and it started charging. So no need to reboot the phone...

enrish's picture

Hi Direc, I have just noticed the daemon implementation in the last update. While it's handy and requested by many, it'd be nice to have a toggle to disable it, a bit like in Depecher.
Some people like to have as little daemons running as possible, even just for battery life.
More importantly, if something goes wrong with the app and it interferes with charging, it would be nice to be able to turn it off.

Two days ago I connected the phone to the charger and the status was 'connected' but not charging. I closed battery buddy, disconnected and reconnected, the system icon was showing the charger was connected but the battery wasn't charging. I thought the cable was broken and moved it a bit, but nothing worked until I restarted the phone. So now I guess it might have been the daemon underneath that got 'stuck' and kept charging disabled... and restarting the phone stopped the daemon.
Anyway, thanks once more for this very essential app!

direc85's picture

Thanks for the feedback!

Originally there was only a one-shot daemon to fix the file permissions issue regarding charger control, and that always ran at boot. One solution could be to bring that back, and then run the current daemon in user context. That way - I think - it would be possible to create the UI elements to stop and start the service.

I have been thinking about that one for a while, I'll create an issue about it in GitHub.

objectifnul's picture

Service restart doesn't help (J1 phone): "Could not find any zN.M subdirs!"

direc85's picture

That specific message is ambience-related, and you can fix it by creating the said dir :)

objectifnul's picture

Okay, but the link ambience-batterybuddy is beyond my understanding.

nephros's picture

Yes, service restart seems to fix the misfiring alerts.

objectifnul's picture

Works fine with my XperiaX but not with my Jolla phone:
When I execute /usr/bin/harbour-batterybuddy-daemon in fingerterm, I get a "Segmentation error".

direc85's picture

It might be that the daemon loses touch with the config file. I'll see what I can do about it.

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.

Pages