battery icon indicating copy to clipboard operation
battery copied to clipboard

Voltage limit

Open rguca opened this issue 1 year ago β€’ 6 comments

This is a draft for the feature request in #214.

Output:

./battery.sh voltage 11.55 11.7 
01/17/24-19:47:18 - Keeping voltage between 11.55V and 11.7V
01/17/24-19:47:18 - Battery at 11.55V
01/17/24-19:48:18 - Battery at 11.551V
01/17/24-19:49:18 - Battery at 11.549V
01/17/24-19:49:18 - πŸ”ŒπŸ”‹ Enabling battery charging
01/17/24-19:49:18 - πŸ”ΌπŸͺ« Disabling battery discharging
01/17/24-19:50:18 - Battery at 11.688V
01/17/24-19:51:19 - Battery at 11.704V
01/17/24-19:51:19 - πŸ”ŒπŸͺ« Disabling battery charging
01/17/24-19:52:19 - Battery at 11.587V
01/17/24-19:53:19 - Battery at 11.569V
01/17/24-19:54:19 - Battery at 11.566V

rguca avatar Jan 17 '24 19:01 rguca

I think keeping the battery at a certain Voltage (usually after 4 Volts degradation starts, and 3.7 is recommended for long life) is a good idea. I would definitely like to see this feature in the program. Another question is how well it works, have you tested it?

djbob2000 avatar Mar 16 '24 07:03 djbob2000

I use battery.sh voltage 11.3 11.4 as login item since one month instead of the percentage limit and I am very pleased with it. The battery is kept at 11.4V which is 3.8V per cell. Virtually no self discharge at this state of charge.

A more user friendly approach would be to integrate this into the daemon so no login item has to be created for autostart manually.

rguca avatar Mar 16 '24 08:03 rguca

I'm not quite sure what to do with the file. Could you please tell me in detail what you need to do step by step to use the voltage limitation?

djbob2000 avatar Mar 16 '24 08:03 djbob2000

Got it. I set battery voltage 11.1 11.4. This kept the battery within 60-72%. I like it:)

djbob2000 avatar Mar 20 '24 12:03 djbob2000

This is a very cool idea @rguca!

Could I ask you to edit it so that the voltage section functions the same as the maintain one? From the top of my head this would probably require:

  1. Renaming the action maintain_voltage_synchronous
  2. Adding a voltage based handling of the maintain command, perhaps my setting 1.1v like syntax?
  3. Run through the maintain daemon to make sure everything is logically consistent

This would make your work compatible for all users in the same was as the current commands are.

actuallymentor avatar Mar 23 '24 11:03 actuallymentor

I also suggest adding a second optional argument to the maintain command, to set the voltage where charging should start again.

For my use case it would be then: battery maintain 11.4v 11.3v

and for @djbob2000 it would be: battery maintain 11.4v 11.1v

Specifying a range like that would probably be better for the charging circuit, because it doesn't have to switch on and off as often.

rguca avatar Mar 23 '24 15:03 rguca

The syntax is now: battery maintain 11.4V This keeps the battery between 11.3V and 11.5V.

Also optional with hysteresis: battery maintain 11.4V 0.5V This keeps the battery between 10.9V and 11.9V.

I tried to make the changes as close as possible to your request @actuallymentor

rguca avatar Jun 20 '24 17:06 rguca

This is an extremely cool PR @rguca, I've merged it. Please keep a close eye on the issue tab the coming weeks just in case this accidentally broke anything!

actuallymentor avatar Jun 28 '24 09:06 actuallymentor

Parts of this pull request got apparently rewritten in a subsequent merge, resulting in this feature not working in https://github.com/actuallymentor/battery/releases/tag/v1.2.2

neoeleatic avatar Jun 28 '24 15:06 neoeleatic

Ah dammit. The merge conflicts must have bit me...

@rguca could I ask you for a new PR with a fix for the broken merge?

actuallymentor avatar Jun 28 '24 16:06 actuallymentor