Charting WMI battery value as replacement for old 'BATTERY' option

Forums Desktop Info Charting WMI battery value as replacement for old 'BATTERY' option

Viewing 2 reply threads
  • Author
    • #2120 Reply

      Hi, I used to use the ‘BATTERY’ option with a chart to visually show the charge percentage of the laptop battery:

      BATTERY=active:1,interval:30,set:battery,display:%3: %1%,chart:bar linear 100 1 -10

      Since the battery option in the latest version is deprecated, I’ve gone with the example listed in ‘useful WMI Queries’:


      This works great as a numeric percentage, however for the life of me I cannot get it to chart the WMI value of %EstimatedChargeRemaining% as a horizontal bar (like the deprecated BATTERY option would) – I’ve looked at other examples where a WMI value is charted, but all I can get to chart is a simple ‘1’ (with a chart I imagine is showing 1% full). I’m obviously missing something, could anyone help me out?


    • #2121 Reply

      The critical piece of information you’re missing is the return value number. EstimatedChargeRemaining is not the first property in the class. What you need to do is look up the specs for the Win32_Battery wmi class to find out what number the EstimatedChargeRemaining property is.

      The fastest way is type the class name into google and find the first result from In this case you’ll end up at

      This page lists all the properties returned by the class. Now just count them off until you get to the property in question and you’ll find that EstimatedChargeRemaining is 15. Put this number into the chart definition as the series number.

      chart:bar linear 100 15 -10

      • #2123 Reply

        Thanks Glenn for the tip. I’m still missing something. I used:

        WMI=active:1,interval:10,text:Battery,namespace:root\cimv2,query:Win32_Battery,chart:bar linear 100 15 -10

        but still I just see ‘Battery 1’ in Desktop Info. I tried it on both my laptop computers. I can see, as you said, that item 15 is the estimatedchargeremaining item, and strangely, if I use the wrong ‘chart:bar linear 100 1 -10’, I get the outline of a box that would store the chart, but if I use 15 for the series, I don’t even get an outline. Aargh! Any chance of a little further help? Thanks again for a great tool.

        • #2124 Reply

          you have to add the display template option:

          ,display:%EstimatedChargeRemaining%% (%battery%BatteryStatus%%)

          this is the complete item

          WMI=active:1,interval:10,text:Battery,namespace:root\cimv2,query:Win32_Battery,chart:bar linear 100 15 -10,display:%EstimatedChargeRemaining%% (%battery%BatteryStatus%%)

    • #2125 Reply

      Worked a charm. Thanks! I was trying to run the percentage as a number on one line, and then the chart as a bar on its own by repeating the WMI query, not including the display template because I (wrongly) thought that would duplicate the percentage as a number. Thanks again!

Viewing 2 reply threads
Reply To: Charting WMI battery value as replacement for old 'BATTERY' option
Your information:

Do NOT follow this link or you will be banned from the site!