AccA
AccA copied to clipboard
Allow ANY capacity value, while still ensuring RESUME is always lower than PAUSE
I implemented a new acc feature that lets one use millivolts as opposed to capacity/level thresholds. The new algorithm kicks in only when the given value is >= 3000 (mV).
This is useful especially for devices that don't provide reliable capacity measurements (I've got one). It's also another alternative to voltage limit - which works only on very few/special devices.
One can have some capacity thresholds be in millivolts and others in %, simultaneously. This means, acc 4200 20 works just as well as acc 80 75. By the way, all capacity thresholds, including shutdown_capacity can be in millivolts.
In what version are these new ACC functions? This is necessary to switch graphic interface. How to send a new command in the terminal? You recorded in the FAQ? ))
In what version are these new ACC functions?
v2021.7.28 (202107280) and newer
This is necessary to switch graphic interface. How to send a new command in the terminal? You recorded in the FAQ? ))
All the information is in README.md. Read NOTES/TIPS FOR FRONT-END DEVELOPERS, Terminal Commands and DEFAULT CONFIGURATION.
If resume
is set to 80 and pause
is set to 3200, it is invalid, right? So we need to make them in the same units, right?
The two-unit format is a bit complicated, both for our program and for the user. Can this solution be optimized any further?
Does the conversion formula capacity=(voltage-3000)/(4200-3000)
apply to all devices? If so, we can use voltage internally and then show capacity to the user.
If it doesn't apply to all devices, then we should probably make a database. Automatic internal conversion for such few devices, and show capacity to the user.
If
resume
is set to 80 andpause
is set to 3200, it is invalid, right? So we need to make them in the same units, right?
No. It works.
Quoting myself... One can have some capacity thresholds be in millivolts and others in %, simultaneously. This means, acc 4200 20 works just as well as acc 80 75. By the way, all capacity thresholds, including shutdown_capacity can be in millivolts.
The two-unit format is a bit complicated, both for our program and for the user. Can this solution be optimized any further? Does the conversion formula
capacity=(voltage-3000)/(4200-3000)
apply to all devices? If so, we can use voltage internally and then show capacity to the user. If it doesn't apply to all devices, then we should probably make a database. Automatic internal conversion for such few devices, and show capacity to the user.
The logic applied depends on the value given. Any capacity value above 3000 is considered millivolt as opposed to %. Conversions are not the goal and are not reliable to begin with. Voltage varies with temperature and battery age - meaning, there's no linear relationship between battery level and voltage.
Here's a practical example: One of my devices has a broken charging driver/hardware. It does not report the correct capacity (%). To better control charging, acc uses voltage instead of % thresholds.
When resume
is set to 80 and pause
is set to 3200, the pause
voltage converted to capacity is 17. I say it's invalid to emphasize that it doesn't meet the resume<pause
.
In this example, to ensure that resume<pause
, we need either convert or keep the units same.
I totally missed your point. My bad! Indeed that's an issue. However, I would assume that somebody who intends to use % and voltage simultaneously would be knowledgeable enough to realize that 3200 is too low.
I just learned that the formula I was using was incorrect. The power-voltage is not a linear relationship. And there is no universal formula for devices. So to avoid abnormal usage, we need to make sure the units are same.
Or we don't open this feature to normal users and restrict it to advanced users. For example, provide a tougle for advanced features. In advanced mode, no restrictions are on the user input. Otherwise resume=3200
and pause=80
may be incorrectly considered invalid. They are valid, but do not meet the resume<pause
in the simple way.
An advanced user mode is a great idea. Any values out of the [-1-101]% range should fire a warning notification.
Personally, I do not understand the battery and must confuse the value. It is best to limit 2 modes: only percent OR millivolts. Ideas? Where are you going to use your advanced mode? It is not comfortable.