# TechTips • Charging/Discharging Time

**URL:** <https://forum.kustom.rocks/t/techtips-charging-discharging-time/13526>\
**Category:** Share\
**Tags:** techtips, kode\
**Created:** [November 7, 2026, 9:55am UTC](https://forum.kustom.rocks/t/techtips-charging-discharging-time/13526 "2026-11-07T09:55:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Baju\_Santiko](https://forum.kustom.rocks/user_avatar/forum.kustom.rocks/baju_santiko/32/6471_2.png) [@Baju\_Santiko](https://forum.kustom.rocks/u/Baju_Santiko)\
**Post date:** [November 7, 2026, 9:55am UTC](https://forum.kustom.rocks/t/techtips-charging-discharging-time/13526/1 "2026-11-07T09:55:05Z")

</div>

![Global Variables](https://forumcdn.kustom.rocks/original/2X/2/26263898e2ddad0cb26763d9af2f0c9b0a3b633b.jpeg)

 ![mins • Global Variable](https://forumcdn.kustom.rocks/original/2X/7/7eea8685fc00dcd9e9de0b711aa2e27a380c4a01.jpeg)

 ![etatext • Global Variable](https://forumcdn.kustom.rocks/original/2X/8/8286f3a19b8a74ce1432d388df1058624cc4dccc.jpeg)

 ![Elements](https://forumcdn.kustom.rocks/original/2X/d/d1461ebd2cd390505c4790b28178b84701883684.jpeg)

 ![Text Element](https://forumcdn.kustom.rocks/original/2X/0/03578a93da4725b353650684cfda915f71baf3c7.jpeg)

 ![Codes • Text Element](https://forumcdn.kustom.rocks/original/2X/6/6215eaf43e1cd6b862908e6d49930b3d556e12fb.jpeg)

## Global Variables

1. `cr`: charging rate (type: Number; 1…100) ➞ ∑ minutes per 1% when charging (example: 1.2)
2. `dr`: discharging rate (type: Number; 1…100) ➞ ∑ minutes per 1% when discharging (example: 9)
3. `mins`: time calculation (type: Text) ➞  
`$if(bi(charging)>0, (100-bi(level))*gv(cr)), bi(level)*gv(dr)))$`
4. `etatext`: time display (type: Text) ➞  
`$mu(floor, gv(mins)/60)))$h $mu(round, gv(mins)-mu(floor, gv(mins)/60)*60)$m`

## Element

1. Text ➞  
`$if(bi(charging)=1, "⚡️ Full in ", "🔋 Left: ")$$gv(etatext)$`

## Notes

#### CALIBRATION

- **Charging Rate (`cr`)**: Charge from a % level (example: 40%) for 10 minutes, then note the % increment. Then set `cr = 10 / increment`
- **Discharging Rate (`dr`)**: monitor the discharging at a % level (example: 60%) for an hour of normal use, then more the % decrement. Then set `dr = 60 / decrement`

The above Calibration are needed for a more accurate measurement, and they may be different from a phone model to the others and the charging power (example: 18W, 25W, 33W, etc.)

I hope this would help.

☺ 👍

---

<div class="post-metadata">

**Author:** ![frank](https://forum.kustom.rocks/user_avatar/forum.kustom.rocks/frank/32/3_2.png) [@frank](https://forum.kustom.rocks/u/frank)\
**Post date:** [November 13, 2026, 6:08pm UTC](https://forum.kustom.rocks/t/techtips-charging-discharging-time/13526/2 "2026-11-13T18:08:26Z")

</div>

Great tip! bi(fullempty) gets fixed in the next release, it was returning wrong values while charging or discharging, after that you can also use `$tf(bi(fullempty))$` to get the time left without calibrating

---

<div class="post-metadata">

**Author:** ![jamesevans](https://forum.kustom.rocks/letter_avatar_proxy/v4/letter/j/77aa72/32.png) [@jamesevans](https://forum.kustom.rocks/u/jamesevans)\
**Post date:** [November 18, 2026, 9:29pm UTC](https://forum.kustom.rocks/t/techtips-charging-discharging-time/13526/3 "2026-11-18T21:29:49Z")

</div>

Good to know. If $tf(bi(fullempty))$ reports a sane value after the update, the calibrated cr/dr formula could be kept as a fallback for devices where the battery service returns 0 or an unrealistic estimate. Showing both—system estimate when available, calibrated estimate otherwise—would avoid a blank or absurd time without removing the manual method.
