Display Battery Percentage in KWGT when it was plugged in

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.

@Mkkminhas :

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

  1. Create a new global variable (ie.: chrgTime) to store the time everytime the battery starts charging
  2. 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:
      1. Formula ➞ $dp()$
      2. Set Global Variable ➞ Global: chrgTime ; Store mode: Auto
  3. 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:
      1. Formula ➞ $""$
      2. Set Global Variable ➞ Global: chrgTime ; Store mode: Auto
  4. 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 :check_box_with_check: Solution button to mark it as the solution.
This would help others with the similar issue.

:smiling_face::+1:

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.