Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revise ups.status values set by shipped drivers to match NUT standards #2496

Open
jimklimov opened this issue Jun 27, 2024 · 3 comments
Open
Labels
documentation ECO mode impacts-release-2.8.2 Issues reported against NUT release 2.8.2 (maybe vanilla or with minor packaging tweaks) NUT protocols question
Milestone

Comments

@jimklimov
Copy link
Member

jimklimov commented Jun 27, 2024

In docs/new-drivers.txt section on Status data aka https://networkupstools.org/docs/developer-guide.chunked/new-drivers.html#_status_data we define a number of possible values.

There is a fair amount of (sub-)drivers and maybe mappings which set something else, e.g. per #2494 (comment) nutdrv_qx_voltronic.c sets values like !OL instead of (presumably) OB.

A related separate issue #2495 is lack of a standard value for "ECO mode" altogether, while it is becoming popular with hardware and wants a consistent name.

While at it, there was also a discussion on ML recently about introducing a status name for "hover charging" (when batteries are kept not at 100% by always charging, but "hover" in a safe zone, e.g. only charging as they drop to some 90%, to conserve chemistry life/cycles - which would often be seen as "OL DISCHRG") which is what "HB" status might have meant or not, historically. We did not come up with a consistent name for the concept at the time, though: most of the search hits came up with charging of hoverboards :) => https://alioth-lists.debian.net/pipermail/nut-upsdev/2024-May/007989.html

@jimklimov jimklimov added question NUT protocols impacts-release-2.8.2 Issues reported against NUT release 2.8.2 (maybe vanilla or with minor packaging tweaks) labels Jun 27, 2024
@jimklimov jimklimov added this to the 2.8.4 milestone Jun 27, 2024
@clepple
Copy link
Member

clepple commented Jun 27, 2024

There generally seems to be a mess in that subdriver with statuses like !OL instead of OB which many clients would not recognize if they parse it.

Not sure about the other drivers, but nutdrv_qx fixes up e.g. !OL in update_status(): https://github.com/networkupstools/nut/blob/v2.8.2/drivers/nutdrv_qx.c#L3693 (though there may be cases where that slips through)

@gdt
Copy link
Contributor

gdt commented Jun 28, 2024

If there are a larger number of possible states, which it seems like there is, we should have predicates that answer important questinos and reduce to less complicated. Like "is the UPS operating from input AC power, or is it using the battery because input power has failed". In asking that, I don't really want to know all the details about battery calibration and hovering. I want to know "are things ok are are we in an alarm condition".

In general, I think we should ask the questions, and use those to organize the values.

@jimklimov
Copy link
Member Author

The way I see it, states are more or less boolean, presented like a bitmask via a string with a series of space-separated tokens that represent each boolean-ish state (I am on wall power, I feed from battery, Battery is discharging -- all of these can be at once, e.g. during calibration). They are primarily aimed at programmatic consumption.

Alarms are less structured, essentially an opaque string that can be meaningful-to and interpreted-by the end-users, delivered in mail or web page, etc.

And in some cases both can be raised, e.g. state "RB" and alarm "Replace your battery ASAP!"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation ECO mode impacts-release-2.8.2 Issues reported against NUT release 2.8.2 (maybe vanilla or with minor packaging tweaks) NUT protocols question
Projects
None yet
Development

No branches or pull requests

3 participants