Quantcast
Channel: Rainmeter Forums
Viewing all articles
Browse latest Browse all 796

Help: Rainmeter Application • Skin always shows identical values for both batteries – what am I doing wrong?

$
0
0
You are not doing anything wrong, as far as I know. The problem is that skin does not actually work. The PowerPlugin plugin (?!) does not support an option named "Index". In addition, the PowerState options on these measures are set to invalid values, so even if there was an "Index", it would not retrieve anything. The skin appears to be trying to display the status of up to 5 different batteries, but in reality all it will do is display the current "active" battery data repeatedly, if anything.

Some laptops might operate differently than mine, but -- at least with my old dual-battery Dell laptop -- only one battery is ever active at a time. When the power drops below some level, the system will switch over to the other battery. It's been a very long time, but I don't remember if the PowerPlugin will even work on systems with multiple batteries. In other words, I think it always reports the first battery in the system, so when the first battery is depleted, it just shows a dead battery and doesn't show the second one. Perhaps I'm wrong on this one; I no longer have a system that I can test this on.

If you want to fix the skin, your only option is to use PowerShell (as mentioned by Yincognito) along with a RunCommand measure to query the batteries.

Code:

Get-WmiObject -Namespace root\wmi -Class BatteryStatus
You only need to query the batteries at approximately 1 minute intervals. Windows does not appear to update the battery status more often than that, at least not on my system. You can tell which battery is active by looking at the data (i.e., if a battery is discharging, that's the active one; if no batteries are discharging, you are charging on AC power).

You do have a second option. I don't mean to promote my own stuff, but my Gadgets suite includes a battery skin which supports multiple batteries. It will automatically fail over from the dead battery to the active one without you needing to do anything. It uses a custom plugin to fetch battery info from WMI, which won't incur the huge performance hit you get using a command-line query. You can use the skin as is, or incorporate the plugin into your own skin.

P.S.: There is a "Battery Status" performance monitor category that has all the WMI data, and -- in theory -- could be read using a UsageMonitor measure. However, UsageMonitor will not read this particular category properly, for some unknown reason. It might have something to do with the fact that the "Battery Status" class is undocumented by Microsoft, and could change, though it's been around for a decade or more.

Image

Statistics: Posted by SilverAzide — Yesterday, 10:13 pm — Replies 2 — Views 91



Viewing all articles
Browse latest Browse all 796

Latest Images

Trending Articles



Latest Images