SilverAzide / Gadgets

Gadgets for Rainmeter
Other
365 stars 12 forks source link

Battery Meter ignores HWiNFO sensors #64

Closed michellabbe closed 1 year ago

michellabbe commented 1 year ago

Battery Meter doesn't seem to be able to use sensors from HWiNFO:

image

image

All sensors are flagged to report value in Gadget, and I can see them in HWiNFOIndexList.txt, but there is no Battery/UPS value to configure in HWiNFO.inc like CPU/GPU Meters.

SilverAzide commented 1 year ago

Hello! The Battery Meter is meant for use with laptops; it is not intended for use with UPSs and does not use HWiNFO. That is why nothing is referenced in HWiNFO.inc, and the instructions don't refer to batteries.

It would be pretty easy to modify the skin to work with HWiNFO and your UPS. An older version of the Gadgets had an HWiNFO-based Battery Meter variant, but I dropped it as it didn't have any advantage over the regular one and was much harder to configure.

You have a couple of options. The GPU Meter can display 6 optional sensors, so you could show the UPS sensors there (although it is a bit odd to do this, I admit). Another option is to check out the Gadgets Additions suite; there is an HWiNFO skin that displays anything you want and has a similar appearance. Lastly you can tweak the Battery Meter to make it work with UPSs.

michellabbe commented 1 year ago

Thanks for your reply.

It would be pretty easy to modify the skin to work with HWiNFO and your UPS. An older version of the Gadgets had an HWiNFO-based Battery Meter variant, but I dropped it as it didn't have any advantage over the regular one and was much harder to configure.

Is it worth adding a UPS gadget as a feature request then?

Adding some values like UPS load %, Estimated Runtime and Input Voltage would certainly be an advantage over the regular Battery gadget. As for gadget configuration with HWiNFO, yes it's scary at first, but once you've gone through the config process for GPU and other MB sensors, it's nothing to add a couple more values for other devices.

I've tried Gadgets Additions (thanks for the tip). It does work to show values from HWiNFO but your Battery gadget is so much nicer with the dynamic battery icon and charging status.

I've looked a bit at tweaking it myself (more than once to be honest: that has been on my "Things to do before I die" checklist since Win7/Vista gadgets died and I turned to Rainmeter). As an IT I'm used to tweaking or building scripts in different languages, but Rainmeter skins is still completely beyond my mortal knowledge.

SilverAzide commented 1 year ago

I can look into creating a UPS gadget. It should not be too hard.

One favor to ask, tho. Your screenshot above is great, but can you let me know if there are any additional sensors not visible in the shot, and if so, can you post a complete screenshot of whatever HWiNFO is showing for a UPS? (I only have laptops, so I don't have a UPS to test with.) You might need to let the UPS charge or discharge to see additional sensors (e.g., does it show charge rate, discharge rate, etc.).

I would also like to know what you see in the HWiNFO registry keys. HWiNFO writes sensor data to \HKEY_CURRENT_USER\Software\HWiNFO64\VSB. Under this branch you'll see keys like "LabelN", "SensorN", "ValueN", and "ValueRawN" (where N is the sensor index number). Specifically, what I'd like to know is if the "ValueRaw" values for the battery sensors match the "Value" values, but just without the unit of measure... and very specifically, I'm wondering if the value shown in your screenshot of the estimated run-time ("33.1 mins") is showing as "33.1" or is it a value in seconds that is being converted. (I suspect it is the same value, no conversion). I'd also like to know if the Yes/No raw values are also the same or if it is a numeric value (if text, this is going to be a problem with various languages).

michellabbe commented 1 year ago

Awesome!

I had taken care of showing all values on my previous screenshots, although admitedly I didn't check sensors changes when discharging/recharging. I will do the test tomorrow. Everyone's asleep right now and the loud UPS beeps would most likely wake kids up in panic.

I'm including exports of the VSB reg keys on two different pc (both using APC UPS but different models) and also with french equivalent, but they are all basically the same: VSB1.txt / VSB1fr.txt VSB2.txt / VSB2fr.txt

"ValueRaw" does match "Value" without the unit of measure and without needing conversion.

The Yes/No values are text, and match HWiNFO language. You probably should support english only anyway. I'm running canadian french OS myself, but I leave tools like this in english for convenience. I hate when some translation don't make sense (often translated out of context) and/or are way too long and exceed reserved space. "AC Power" translation on screenshots below is a great example of both ;-).

I also confirm Gadgets Addition doesn't show these Yes/No values properly either if HWiNFO is non-english: image image

SilverAzide commented 1 year ago

Great! Thank you very much!

michellabbe commented 1 year ago

I confirm that no additional sensor values are added during discharging/charging events.

VSB_discharging.txt / VSB_charging.txt

discharging charging

SilverAzide commented 1 year ago

Hello @michellabbe! Are you still interested in a UPS Meter gadget? If so, let me know!

michellabbe commented 1 year ago

Hello @michellabbe! Are you still interested in a UPS Meter gadget? If so, let me know!

Sure :)

SilverAzide commented 1 year ago

OK cool!

I've attached a zip file containing an .rmskin file. It's a patch, so it will merge itself into your existing Gadgets installation. Install the patch, but before it will run successfully you will need to manually fix your HWiNFO.inc file. In the UPS Meter folder, you will find a HWiNFO.txt file. Paste the contents of this file to the bottom of your HWiNFO.inc file. This will add in all the sensor index variables you need for the gadget to work (I assumed you'd use the values in the "UPS" sensor section). Add in your sensor indices and refresh the skin and you should be good to go.

Let me know if this works for you. Just FYI, the "Max Load" value shown in the skin is a calculation based on the current load / percent load. It may or may not equal the value that the vendor claims... :wink:

As we discussed earlier, the skin expects English "Yes/No" values for some sensors. I'll need to add some translations into the final release, or figure out another way to get this info.

UPS Meter - Gadgets Patch_7.5.1.zip Edit: updated patch installer (see below)

Davoleo commented 1 year ago

seems like the patch is missing the @Resources folder causing it to throw these errors on my computer: image

Am I forgetting something when installing the patch?

SilverAzide commented 1 year ago

@Davoleo, oops. My bad, I built the patch installer incorrectly. (You do need to have the Gadgets installed first, if you haven't done that already.) Please manually delete the old skin and use this one. It's got a few extra fixes.

UPS Meter - Gadgets Patch_7.5.1.zip

michellabbe commented 1 year ago

Just tried the new build from an hour ago (didn't have time to try yesterday's one).

UPS Meter installs without issue, but it doesn't show up when loading it (Rainmeter -> Skins -> Gadgets -> UPS Meter -> check "UPS Meter.ini").

Position = switched from "Desktop" to "Normal" and disabled "From right" (to match other skins) on "Default primary monitor". Didn't change anything.

When selecting Settings.ini, it shows white outlines of transparent windows (no text or anything), on top left of my primary monitor.

Checked the "background and positioning" section of the .ini file in case it would happen to show coordinates outside visible windows, but it seems ok (comparing with CPU Meter).

Any ideas?

Davoleo commented 1 year ago

mmh, this time it got installed as a subdirectory of the Gadgets dir which is good, image

although it still gives me these errors: image

My other gadgets are on version 7.5.0 so that shouldn't be the issue, as for how I uninstalled the old patch I just closed Rainmeter and removed the UPS Meter old folder, have I missed a step perhaps?

michellabbe commented 1 year ago

Same errors here in the Log. That probably explains why it doesn't display properly.

SilverAzide commented 1 year ago

OMG, I am such a doofus. My apologies! 😳 I AGAIN screwed up the patch installer. (To be fair, patch installs are different than normal ones and I obviously have forgotten how to do it right.) I forgot to include the variables file.

Maybe the third time is the charm?

UPS Meter - Gadgets Patch_7.5.1.zip

P.S.: Thanks for your persistence!

Davoleo commented 1 year ago

Don't worry, happens to everyone, I can relate :P all good on my PC now btw! image

SilverAzide commented 1 year ago

"233.1 V"... Wow, that's kind of a lot. You running a backup for an entire server rack? 😉 Or maybe something is off someplace?

Davoleo commented 1 year ago

uhhh, yeah I probably misstyped some of the sensor indices >>

michellabbe commented 1 year ago

Still got the same err.. just kidding :)

The UPS skin appears now, but it shows as "Not configured!".

I see UPS infos in HWiNFOIndexList.txt, but no "UPS" or "Battery" variables to adjust in HWiNFO.inc.

HWiNFO Sensor Entry Index List

Index Sensor                                   Label                          Value
----- ---------------------------------------- ------------------------------ ---------------
[...]
25    Battery: American Power Conversion Ba... Battery Voltage                27.160 V
26    Battery: American Power Conversion Ba... Estimated Remaining Time       16.6 mins
27    UPS                                      Battery Voltage                27.160 V
28    UPS                                      Input Voltage                  122.0 V
29    UPS                                      UPS Load                       226.200 W
30    UPS                                      UPS Load                       29.0 %
31    UPS                                      Charge Level                   100.0 %
32    UPS                                      Estimated Runtime              16.6 min
33    UPS                                      AC Power                       Yes
34    UPS                                      Charging                       No
35    UPS                                      Discharging                    No
SilverAzide commented 1 year ago

@michellabbe, Make sure you copy the contents of the HWiNFO.txt file in the UPS Meter folder and paste it at the end of the HWiNFO.inc file. The sensor indexes can then be configured there.

michellabbe commented 1 year ago

That worked, thanks. I had seen this HWiNFO.txt file in UPS Meter folder.. should've looked at it.

image

Yay! :)

Davoleo commented 1 year ago

"233.1 V"... Wow, that's kind of a lot. You running a backup for an entire server rack? 😉 Or maybe something is off someplace?

ah right, I hooked that up with the input voltage, so it makes sense, for some reason HWiNFO also shows that high number for output voltage as well, I assume the sensor on the UPS for that specific one is borked, but the input one is ok

Actually it makes sense since my UPS does not already convert to DC, it's external

SilverAzide commented 1 year ago

OK, cool (and thanks for the screenshot!!)... Let me know if you can think of any enhancements. Otherwise, I'll include this in the next release of the Gadgets.

michellabbe commented 1 year ago

The Estimated Runtime value is missing on the skin (HWiNFO_UPS_Lifetime variable in HWiNFO.txt). I tried both indexes 26 and 32 from my example.

SilverAzide commented 1 year ago

The Estimated Runtime value is missing on the skin (HWiNFO_UPS_Lifetime variable in HWiNFO.txt). I tried both indexes 26 and 32 from my example.

OK, that is by design. What is happening is that your UPS is at 100% charge and on AC Power, so it just says "Fully charged" like a laptop battery does. If you are <100% and not on AC Power, then it will say the estimated runtime. If you are <100% and on AC Power, then it will say "Plugged in, charging".

SilverAzide commented 1 year ago

Would you rather it say the estimated runtime always? I could probably squeeze in something like "Est runtime: XX,X mins", or just leave it as "XX.X min remaining".

michellabbe commented 1 year ago

I think I would replace the dynamic text with "Discharging", and always show the Estimated Runtime. It's probably the most important value I would like to keep an eye on (same for laptops).

"Est runtime" or "Remaining time" would keep the value on right like others.

If you want to do it fancy you could set it green/yellow/red/flashing based on remaining time value (not sure what is doable or not with these skins).

SilverAzide commented 1 year ago

OK! Things are a bit cramped for space, but what about this:

For example: image

(This logic is borrowed from the Battery Meter skin.)

SilverAzide commented 1 year ago

As far as the green/yellow/red, that is already there, except for the flashing. There is a set of power threshhold percentages you can customize (based on the Windows battery plan). Once you get to 10% (the default value), you'll see this:

image

Once you get to 7%, you'll see this:

image

There are a couple variables you can tweak in the UPSVariables.inc file to control this. You can sync these up with the values that cause your UPS to alarm/shutdown/whatever. On my laptop, once I hit the 7% mark, I have about 15-20 seconds to plug it in before it shuts down (this is the ""critical" level in the MS power plan).

michellabbe commented 1 year ago

I kinda like to see the "Fully charged" mention too. It's clear.

My personal preference would be to add the Estimated Runtime value below Max Load when charging or Fully charged (mask it when discharging or value = "N/A" when missing so the remaining time isn't shown twice) and leave the rest as-is.

But you're the skin master so you definitely have the final word.

Awesome job on all the dynamic stuff btw :)

SilverAzide commented 1 year ago

OK, sounds unanimous! 😄 So, something like:

image

image

image

michellabbe commented 1 year ago

Looks great! :)

SilverAzide commented 1 year ago

OK, cool... Overwrite the two existing skins with the ones in this zip, and you should be good to go until the formal release. (Whenever that is.)

UPS Meter.zip

michellabbe commented 1 year ago

Seems to work great, thanks!

SilverAzide commented 1 year ago

UPS Meter will be added to the next release.