mge-hid: suppress CHRG on CC-mode devices when battery is fully charged#3519
Open
strasharo wants to merge 1 commit into
Open
mge-hid: suppress CHRG on CC-mode devices when battery is fully charged#3519strasharo wants to merge 1 commit into
strasharo wants to merge 1 commit into
Conversation
|
A ZIP file with standard source tarball and another tarball with pre-built docs for commit 4bca788 is temporarily available: NUT-tarballs-PR-3519.zip. |
UPS.PowerSummary.PresentStatus.Charging stays asserted in float/ maintenance mode on constant-charge (CC-mode) devices such as the Eaton 5E series. These devices do not expose the ABM HID path (UPS.BatterySystem.Charger.ABMEnable), so advanced_battery_monitoring stays ABM_UNKNOWN. eaton_abm_check_chrg_fun() then maps any Charging=1 report directly to CHRG with no distinction between active charging and float mode. The result is ups.status stuck at OL CHRG indefinitely, even when battery.charge is 100. Fix: when ABM is UNKNOWN or DISABLED and the UPS asserts Charging=1, check battery.charge before publishing CHRG. If the battery is at 100% the charger is in float/maintenance mode, not actively charging, so return !chrg instead. Tested on Eaton 5E 650i (vendor 0463, product ffff, subdriver MGE HID 1.58, firmware 01.04.0016) where ups.status now correctly shows OL at full charge instead of OL CHRG. Signed-off-by: strasharo <3337997+strasharo@users.noreply.github.com>
4bca788 to
c095216
Compare
|
✅ Build nut 2.8.5.4910-master completed (commit 5fb99f23b4 by @strasharo)
|
|
✅ Build nut 2.8.5.4911-master completed (commit 2b35312adc by @strasharo)
|
Member
|
FYI: I'll be mostly offline till mid-month, so will review later. Thanks! |
Author
|
Have a nice vacation, thank you. :) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #3518
Problem
On constant-charge (CC-mode) devices such as the Eaton 5E series,
UPS.PowerSummary.PresentStatus.Chargingstays asserted at 1 in float/maintenance mode. These devices do not exposeUPS.BatterySystem.Charger.ABMEnable, soadvanced_battery_monitoringremainsABM_UNKNOWNthroughout the driver lifetime.eaton_abm_check_chrg_fun()maps anyCharging=1directly to"chrg"whenABM_UNKNOWN, with no mechanism to detect float mode. The result isups.statusstuck atOL CHRGindefinitely once the battery reaches 100%.Fix
When
ABM_UNKNOWNorABM_DISABLEDand the UPS assertsCharging=1, consultbattery.chargebefore publishing CHRG. If the battery is at 100% the charger is in float/maintenance mode, not actively charging, so return!chrginstead.Testing
Tested on:
ups.statusnow showsOLat full chargeBoth units previously showed persistent
OL CHRGwithbattery.charge: 100. After this change both reportOLas expected.