I want to get battery percentage in kwgt when it was plugged in. It should be static digit. Wondering if working around with “Battery Percentage 30 minutes ago” formula works.
Hi there,
Are you looking for a way to get the battery % right at the time when it starts charging? If it is, try the following tips.
Get the battery % at the time it starts charging
WHAT TO DO
- Record the time when the battery starts charging, record it into a global variable
- Create 2 flows to set & reset the value of the time record
- Display the battery % for the recorded time, only if the battery status is charging
STEPS
- Create a new global variable (ie.:
chrgTime) to store the time everytime the battery starts charging - Create a new flow to set the time record
- Name:
Set chrgTime - Triggers: Formula (When not 0 or empty) ➞
$(bi(charging)=1 & gv(chrgTime)="")$ - Actions:
- Formula ➞
$dp()$ - Set Global Variable ➞ Global: chrgTime ; Store mode: Auto
- Formula ➞
- Name:
- Create a new flow to reset the time record
- Name:
Reset chrgTime - Triggers: Formula (When not 0 or empty) ➞
$(bi(charging)=0 & gv(chrgTime)!="")$ - Actions:
- Formula ➞
$""$ - Set Global Variable ➞ Global: chrgTime ; Store mode: Auto
- Formula ➞
- Name:
- Create a Text object to display the battery level at the recorded time.
$if(bi(charging)=1 & gv(chrgTime)!="",bi(level,gv(chrgTime))+"%")$
I hope this would help.
Did you find the most helpful response to your issue?
Please kindly press the
Solution button to mark it as the solution.
This would help others with the similar issue.
![]()
![]()
3 Likes
Thanks bro it worked exactly as I wanted. Thanks alot.
This topic was automatically closed 25 days after the last reply. New replies are no longer allowed.