Battery power draw a.k.a. device power consumption?

Hi everyone.

Can I safely assume that if I multiply the current from /sys/class/power_supply/battery/current_now with the voltage from /sys/class/power_supply/battery/voltage_now, I should get the power draw of the battery, which can be considered the power consumption of the device in real time?

Or is there any other API or system file I can use to get more accurate power data of the device, in real time?

It’s the same on Linux desktop, but there on modern CPUs, we have Intel RAPL integrated in the kernel for much more accurate real-time power readings. Anything similar for ARM processors in SailfishOS?

It is a jungle out there i.e. there is a lot of variance between devices in whether / how various attributes are made available / updated. So, you might get lucky with some devices, but in general I’d put it something like: you can trust that status (charging/discharging/full/etc) and capacity (percentage) values reflect reality, and current_now values have a sane sign (charging/discharging)…

My understanding is that in devices with coulomb counter, changes in charge_count value over time should be usable for such purposes.

1 Like

Thanks for the insights :slight_smile:
I can get current/voltage on X10ii live, though as you suggest, these cannot be trusted without validating them somehow (with a power meter for example).