It is currently April 24th, 2024, 2:48 am

Can't get Battery Status from UsageMonitor

Get help with creating, editing & fixing problems with skins
User avatar
CodeCode
Posts: 1366
Joined: September 7th, 2020, 2:24 pm
Location: QLD, Australia

Re: Can't get Battery Status from UsageMonitor

Post by CodeCode »

Hi SilverAzide

I have a question.

If the battery is fully charged, does the plugin report chargerate/currentcharge/maxcharge values?

This is what I get with a fully charged (pc) battery:
Capture.PNG
You do not have the required permissions to view the files attached to this post.
ƈǟռ'ȶ ʄɨӼ ɨȶ ɨʄ ɨȶ ǟɨռ'ȶ ɮʀօӄɛ - ʊռʟɛֆֆ ɨȶ ɨֆ ɨռ ƈօɖɛ.
User avatar
SilverAzide
Rainmeter Sage
Posts: 2604
Joined: March 23rd, 2015, 5:26 pm

Re: Can't get Battery Status from UsageMonitor

Post by SilverAzide »

CodeCode wrote: December 1st, 2020, 9:53 am Hi SilverAzide

I have a question.

If the battery is fully charged, does the plugin report chargerate/currentcharge/maxcharge values?

This is what I get with a fully charged (pc) battery:
Capture.PNG
Your screenshot is a little concerning, but it could be simply a difference in how your system reports data to Windows when the battery is fully charged. Here is what mine looks like:
Battery100.png
The charge/discharge rate is obviously zero, but all the other data has a non-zero value. If you'd like to investigate, try running the following PowerShell command:

Code: Select all

Get-WmiObject -Namespace root\wmi -Class BatteryStatus | Format-List InstanceName, ChargeRate, DischargeRate, RemainingCapacity, Voltage
You should get something like this:

Code: Select all

InstanceName      : ACPI\PNP0C0A\1_0
ChargeRate        : 0
DischargeRate     : 0
RemainingCapacity : 99900
Voltage           : 12788

InstanceName      : ACPI\PNP0C0A\2_0
ChargeRate        : 0
DischargeRate     : 0
RemainingCapacity : 0
Voltage           : 0
I have two battery bays in my laptop, with the first fully charged and the second one empty. Most normal laptops just have one entry. You can also see this stuff in HWiNFO. If your output is showing all zeros, it may just be your brand of laptop/motherboard, but this is what a Dell looks like.

Edit
P.S.: I forgot to add: The plugin only reports batteries where the Voltage is greater than zero. So if your battery is reporting zero voltage, the plugin will act as if there is no battery at all. That might be what is happening. Your machine may be supplying zero volts when the battery is full, causing the plugin to not see your battery. The plugin works this way to allow machines that have multiple batteries to detect when one is not present, but perhaps in your case this logic is flawed.
You do not have the required permissions to view the files attached to this post.
Gadgets Wiki GitHub More Gadgets...
User avatar
CodeCode
Posts: 1366
Joined: September 7th, 2020, 2:24 pm
Location: QLD, Australia

Re: Can't get Battery Status from UsageMonitor

Post by CodeCode »

Sorry to be a pain.

This is what came back when entering into powershell:

Code: Select all

Get-WmiObject -Namespace root\wmi -Class BatteryStatus | Format-List InstanceName, ChargeRate, DischargeRate, RemainingCapacity, Voltage

Code: Select all

Get-WmiObject : Invalid class "BatteryStatus"
At line:1 char:1
+ Get-WmiObject -Namespace root\wmi -Class BatteryStatus | Format-List  ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidType: (:) [Get-WmiObject], ManagementException
    + FullyQualifiedErrorId : GetWMIManagementException,Microsoft.PowerShell.Commands.GetWmiObjectCommand
ƈǟռ'ȶ ʄɨӼ ɨȶ ɨʄ ɨȶ ǟɨռ'ȶ ɮʀօӄɛ - ʊռʟɛֆֆ ɨȶ ɨֆ ɨռ ƈօɖɛ.
User avatar
SilverAzide
Rainmeter Sage
Posts: 2604
Joined: March 23rd, 2015, 5:26 pm

Re: Can't get Battery Status from UsageMonitor

Post by SilverAzide »

CodeCode wrote: December 1st, 2020, 9:42 pm Sorry to be a pain.

This is what came back when entering into powershell:

Code: Select all

Get-WmiObject -Namespace root\wmi -Class BatteryStatus | Format-List InstanceName, ChargeRate, DischargeRate, RemainingCapacity, Voltage

Code: Select all

Get-WmiObject : Invalid class "BatteryStatus"
At line:1 char:1
+ Get-WmiObject -Namespace root\wmi -Class BatteryStatus | Format-List  ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidType: (:) [Get-WmiObject], ManagementException
    + FullyQualifiedErrorId : GetWMIManagementException,Microsoft.PowerShell.Commands.GetWmiObjectCommand
I think we found the problem! :D Looks like your OS does not have this class (it *is* an undocumented class, after all, so...). I assume it is not present in your PerfMon app either. What version of Windows are you using? Also, if you have HWiNFO, is anything visible there?
Gadgets Wiki GitHub More Gadgets...
User avatar
CodeCode
Posts: 1366
Joined: September 7th, 2020, 2:24 pm
Location: QLD, Australia

Re: Can't get Battery Status from UsageMonitor

Post by CodeCode »

SilverAzide wrote: December 1st, 2020, 10:52 pm I think we found the problem! :D Looks like your OS does not have this class (it *is* an undocumented class, after all, so...). I assume it is not present in your PerfMon app either. What version of Windows are you using? Also, if you have HWiNFO, is anything visible there?
I have os build 19042 updated last night with the latest updates.

Hwinfo shows the exact same thing.

I havent tried yet, but I am going to try running off battery in a while - just cant shut things off right the moment due to work commitment.

I have a battery skin that shows the basics and the battery IS connected with a usb, the old skin shows just the basics as expected - charged/ing, bat percentage, and if on ac or not. So the new hoped for info wouldve been nice, but if i am in a shallow well here, there are no major worries.
ƈǟռ'ȶ ʄɨӼ ɨȶ ɨʄ ɨȶ ǟɨռ'ȶ ɮʀօӄɛ - ʊռʟɛֆֆ ɨȶ ɨֆ ɨռ ƈօɖɛ.
User avatar
SilverAzide
Rainmeter Sage
Posts: 2604
Joined: March 23rd, 2015, 5:26 pm

Re: Can't get Battery Status from UsageMonitor

Post by SilverAzide »

CodeCode wrote: December 2nd, 2020, 2:31 am I have os build 19042 updated last night with the latest updates.
Oh sorry, I meant which flavor of Windows? I'm using Windows 10 Pro and Windows 10 Enterprise, and both have the BatteryStatus class. In fact, I think every flavor of Windows since XP has had this, except for maybe the Server versions.
CodeCode wrote: December 2nd, 2020, 2:31 am ...and the battery IS connected with a usb...
Do you mean you are using an external battery, like a UPS? :?
Gadgets Wiki GitHub More Gadgets...
User avatar
CodeCode
Posts: 1366
Joined: September 7th, 2020, 2:24 pm
Location: QLD, Australia

Re: Can't get Battery Status from UsageMonitor

Post by CodeCode »

SilverAzide wrote: December 2nd, 2020, 4:03 am Oh sorry, I meant which flavor of Windows? I'm using Windows 10 Pro and Windows 10 Enterprise, and both have the BatteryStatus class. In fact, I think every flavor of Windows since XP has had this, except for maybe the Server versions.


Do you mean you are using an external battery, like a UPS? :?
Erm, heh. Im using win10 pro 64 bit.

It is an external battery, yes, a ups.

I was a bit surprised that the batterystatus class is not present given pro implies all of those extras are included. Would you think that searching for a download of some kind would be warrented? given that it was not inherent, i wouldnt really know what to search for, such as some package or similar.

Is it possible that - excuse me if this sounds oblique - visual studio pro would be a segue to acquiring that class and/or package, if it exists?
ƈǟռ'ȶ ʄɨӼ ɨȶ ɨʄ ɨȶ ǟɨռ'ȶ ɮʀօӄɛ - ʊռʟɛֆֆ ɨȶ ɨֆ ɨռ ƈօɖɛ.
User avatar
SilverAzide
Rainmeter Sage
Posts: 2604
Joined: March 23rd, 2015, 5:26 pm

Re: Can't get Battery Status from UsageMonitor

Post by SilverAzide »

CodeCode wrote: December 2nd, 2020, 6:35 am Erm, heh. Im using win10 pro 64 bit.

It is an external battery, yes, a ups.

I was a bit surprised that the batterystatus class is not present given pro implies all of those extras are included. Would you think that searching for a download of some kind would be warrented? given that it was not inherent, i wouldnt really know what to search for, such as some package or similar.

Is it possible that - excuse me if this sounds oblique - visual studio pro would be a segue to acquiring that class and/or package, if it exists?
Interesting, Win10 Pro should have it, not sure why it isn't there for you. I have no idea how to "acquire" this WMI class, it should be part of the OS. :confused: It has been since Windows XP days at least.

Perhaps the issue is that it is a UPS battery instead of an internal one? If so, that might be a different sort of thing. A couple of PowerShell queries you can try:

Code: Select all

Get-WmiObject -Namespace root\cimv2 -Class Win32_Battery
Get-WmiObject -Namespace root\cimv2 -Class Win32_PortableBattery
The Win32_PortableBattery has a Location property, which appears to indicate where the battery is. Mine always says "Sys. Battery Bay". But neither of these classes will tell you the actual charge rate, current charge, etc. that the BatteryStatus class will tell you. There's no other WMI class with this info that I can find.
Gadgets Wiki GitHub More Gadgets...
User avatar
CodeCode
Posts: 1366
Joined: September 7th, 2020, 2:24 pm
Location: QLD, Australia

Re: Can't get Battery Status from UsageMonitor

Post by CodeCode »

This is what i got:

Code: Select all

PS C:\Users\Sapient> Get-WmiObject -Namespace root\cimv2 -Class Win32_Battery


__GENUS                     : 2
__CLASS                     : Win32_Battery
__SUPERCLASS                : CIM_Battery
__DYNASTY                   : CIM_ManagedSystemElement
__RELPATH                   : Win32_Battery.DeviceID="000000000EATON5E"
__PROPERTY_COUNT            : 33
__DERIVATION                : {CIM_Battery, CIM_LogicalDevice, CIM_LogicalElement, CIM_ManagedSystemElement}
__SERVER                    : SAPIENT
__NAMESPACE                 : root\cimv2
__PATH                      : \\SAPIENT\root\cimv2:Win32_Battery.DeviceID="000000000EATON5E"
Availability                : 2
BatteryRechargeTime         :
BatteryStatus               : 2
Caption                     : Internal Battery
Chemistry                   : 3
ConfigManagerErrorCode      :
ConfigManagerUserConfig     :
CreationClassName           : Win32_Battery
Description                 : Internal Battery
DesignCapacity              :
DesignVoltage               : 27000
DeviceID                    : 000000000EATON5E
ErrorCleared                :
ErrorDescription            :
EstimatedChargeRemaining    : 100
EstimatedRunTime            : 15
ExpectedBatteryLife         :
ExpectedLife                :
FullChargeCapacity          :
InstallDate                 :
LastErrorCode               :
MaxRechargeTime             :
Name                        : 5E
PNPDeviceID                 :
PowerManagementCapabilities : {1}
PowerManagementSupported    : False
SmartBatteryVersion         :
Status                      : OK
StatusInfo                  :
SystemCreationClassName     : Win32_ComputerSystem
SystemName                  : SAPIENT
TimeOnBattery               :
TimeToFullCharge            :
PSComputerName              : SAPIENT
Not sure what that info can be used for though ;)

Get-WmiObject -Namespace root\cimv2 -Class Win32_PortableBattery Returned with no info.
ƈǟռ'ȶ ʄɨӼ ɨȶ ɨʄ ɨȶ ǟɨռ'ȶ ɮʀօӄɛ - ʊռʟɛֆֆ ɨȶ ɨֆ ɨռ ƈօɖɛ.
User avatar
SilverAzide
Rainmeter Sage
Posts: 2604
Joined: March 23rd, 2015, 5:26 pm

Re: Can't get Battery Status from UsageMonitor

Post by SilverAzide »

Yeah, that's pretty useless info. I think you might be out of luck. Sorry about that... :-(
Gadgets Wiki GitHub More Gadgets...