BatterylogX is a set of tools for logging and later analyzing laptop battery power data such as voltage and charge/discharge current. The goal is to have an easy-to-use (and maintain) toolkit for analyzing battery performance.
Currently implemented is battery data logger only. The data is stored in a sqlite3 database. The data logger supports daemonizing (run in background).
The following information is stored:
- battery serial number
Much more information would be available but I did not see the usefulness of other fields yet.
Some ideas for data analysis (later) are listed here:
- Sleep detection (no data)
- How long was the system in sleep?
- How much capacity was drained in sleep?
- Charge/discharge cycle detection (based on amperage)
- What was the average power during a discharge cycle
- Full charge time?
These programs are written for Python 3.2, but should also work with version 2.7. The battery information is read using system_profiler, an Apple proprietary utility. It should be trivial to port this to other platforms, but since I don't have non-Apple laptops, I'm not going to implement it. I am willing to integrate changes made by others as long as they do not break functionality for me.
All this code is open source under the MIT license. The full text is duplicated in the file LICENSE.