system76 / firmware-open

System76 Open Firmware
Other
949 stars 86 forks source link

Stop Battery Charging at 80% #429

Closed qnxdev closed 1 year ago

qnxdev commented 1 year ago

Guys I know it's silly question and wrong to raise as issue here but I understand that support for this has to come from firmware and I'd love this feature.

VAIO laptops can stop charging at 50% or 80% or 100% (customisable using built in app)

Is it possible for system76 team to add a small feature like that?

Even a CLI command would be enough.

On my old VAIO, I saw the battery lasted for years with decent health because it charged until 80%, then stop chargin when this feature is ON.

Feel free to close this issue if you feel like it's dumb.

leviport commented 1 year ago

Charging thresholds are currently a supported feature on our Open Firmware. This article has more information on the feature: https://support.system76.com/articles/laptop-battery-thresholds

cmm commented 1 year ago

how is that considered a supported feature when the threshold is not actually stored in the firmware, so a powered-down laptop still charges to 100%?

https://github.com/system76/ec/issues/256

jacobgkau commented 1 year ago

@cmm The between-EC-reset functionality works as currently described in the documentation, it's generally QA tested, and the support article explains how to work around the current limitation by setting the thresholds automatically on boot. The support article also notes that the feature is not complete.

In any case, the feature request for the remaining functionality already exists at the issue you linked to. A more specific one is also open here: https://github.com/system76/ec/issues/128

If you want to use it without that limitation in the meantime, you can also build your own firmware after adding the following block to /src/board/system76/<model>/board.mk:

# Set battery charging thresholds
CFLAGS+=\
    -DBATTERY_START_THRESHOLD=0 \
    -DBATTERY_END_THRESHOLD=100

...where 0 can be replaced with your start threshold and 100 can be replaced with your end threshold. Obviously, this isn't a process that all users will want to go through, and the plan is to make this configurable (and add a GUI) when the firmware engineers have time. The issues in the EC repository will be updated/closed when configuration persistence is added.