Get the status of the device battery.

Usage #

This program does not take any arguments. Output is returned in JSON format.

Example #

~/ $ termux-battery-status

Output:

{
  "present": true,
  "technology": "Li-ion",
  "health": "GOOD",
  "plugged": "UNPLUGGED",
  "status": "DISCHARGING",
  "temperature": "22.3",
  "voltage": 4099,
  "current": -820000,
  "current_average": -576,
  "percentage": 85,
  "level": 85,
  "scale": 100,
  "charge_counter": 3194654,
  "energy": null
}

Types #

JSON KeyTypeDescription
presentBooleanIndicates if the battery is present
technologyStringThe battery technology (e.g., Lithium-ion)
healthStringThe health of the battery (e.g., COLD, DEAD, GOOD, OVERHEAT, etc.)
pluggedStringThe type of power source the device is plugged into (e.g., UNPLUGGED, PLUGGED_AC, PLUGGED_USB, etc.)
statusStringThe charging status of the battery (e.g., CHARGING, DISCHARGING, FULL, NOT_CHARGING, etc.)
temperatureDouble/StringThe battery temperature in degrees Celsius, rounded to 1 decimal place
voltageIntegerThe battery voltage in millivolts (mV)
currentIntegerThe instantaneous battery current in microamperes (µA)
current_averageIntegerThe average battery current in microamperes (µA)
percentageIntegerThe battery charge percentage (0-100)
levelIntegerThe battery charge level
scaleIntegerThe maximum battery charge level
charge_counterIntegerThe charge counter in microampere-hours (µAh)
energyLongThe energy counter in nanowatt-hours (nWh)
cycleIntegerThe battery cycle count (optional, available since Android 14)