Ubuntu and Battery Details on the Shell

A while ago, I had a post on a Linux shell command to get the current power consumption of my notebook. Recently, I exchanged my battery for a new one and wanted to keep track not only of the discharge rate but the other parameters as well to see how quickly Ubuntu would recognize that it is a new battery and update it’s capacity values, etc. as well. Turns out there is a nice shell command for that as well: ‘upower’.

$ upower -i /org/freedesktop/UPower/devices/battery_BAT0
  native-path:          BAT0
  vendor:               SANYO
  model:                45N1172
  serial:               1255
  power supply:         yes
  updated:              Sun 20 Nov 2016 17:35:31 CET
  has history:          yes
  has statistics:       yes
    present:             yes
    rechargeable:        yes
    state:               discharging
    warning-level:       none
    energy:              54,19 Wh
    energy-empty:        0 Wh
    energy-full:         63,13 Wh
    energy-full-design:  62,64 Wh
    energy-rate:         13,585 W
    voltage:             11,97 V
    time to empty:       4,0 hours
    percentage:          86%
    capacity:            100%
    technology:          lithium-ion
    icon-name:          'battery-full-symbolic'
  History (rate):
    1479659731    13,585    discharging

It took a while for all values to update but in the end the vendor name changed from ‘LGC’ to ‘SANYO’ and my ‘energy-full‘ climbed back up to 100% of the ‘energy-full-desing‘ value.

For more details have a look over at AskUbuntu.