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

feat: Add support for Liebert PSI5 #2369

Merged
merged 2 commits into from Mar 24, 2024

Conversation

jrjparks
Copy link
Contributor

@jrjparks jrjparks commented Mar 23, 2024

Adding support for the Liebert PSI5 model of UPS, as discussed in #2271 initially.

Maybe addresses similar complaints posted in #2024 (but that is for another driver related just by vendor)

Closes: #2271

Adding support for the Liebert PSI5 model of UPS.

Signed-off-by: James R. Parks <jrjparks@zathera.com>
Copy link
Member

@jimklimov jimklimov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks quite solid to me. Is there a particular reason this is posted as a "draft" PR? Are you in local testing so far?

Compared to #2271 discussion I see you went for a separate method to "maybe apply" a correction factor (in the PoC there you added logic to an existing method). On one hand, this way you surely should not introduce errors into existing support for other devices, on another - I still wonder if some other reports about Liebert/Belkin HID devices could benefit from an exponent fix for those earlier HID tree node readings. And whether that original method did have an error about 1e7 vs. 1e9 comparisons and multiplications. At least, something to keep in mind if more bug reports come eventually...

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
@jimklimov jimklimov marked this pull request as ready for review March 23, 2024 17:49
@jimklimov
Copy link
Member

Passing to NUT CI farm to test this change...

@jrjparks
Copy link
Contributor Author

Looks quite solid to me. Is there a particular reason this is posted as a "draft" PR? Are you in local testing so far?

I left it in draft before I went to bed to make sure it would pass the approvals before I published it.

Compared to #2271 discussion I see you went for a separate method to "maybe apply" a correction factor (in the PoC there you added logic to an existing method). On one hand, this way you surely should not introduce errors into existing support for other devices, on another - I still wonder if some other reports about Liebert/Belkin HID devices could benefit from an exponent fix for those earlier HID tree node readings. And whether that original method did have an error about 1e7 vs. 1e9 comparisons and multiplications. At least, something to keep in mind if more bug reports come eventually...

Yeah, I thought about how to extend the existing function without possibly breaking others, but I wouldn't be able to be sure of any changes other than "it works on my UPS" 😆. This seemed to be the safer path as it's also using different HID lookup paths, so I assumed Liebert is using different maths for different models. I was also trying to think of a way to just set the line voltage multiplier based on the model or some factor, but I'm still not very familiar with the code and it's been a while since I last touched some C.

@jimklimov jimklimov merged commit 71f8988 into networkupstools:master Mar 24, 2024
22 of 25 checks passed
jimklimov added a commit to jimklimov/nut that referenced this pull request Mar 25, 2024
…-up]

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
jimklimov added a commit to jimklimov/nut that referenced this pull request Mar 26, 2024
…ert_psi5_line_voltage_fun() into common liebert_line_voltage_fun()

Hopefully should help more devices than those which serve this or that
HID subtree only. Follows up from PR networkupstools#2369

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
@meeowgler
Copy link

Just wanted to add that this is confirmed working on the PST5 now as well (this model is different than the PSI5, though reports as the same vendor and product id). Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Todo
Development

Successfully merging this pull request may close these issues.

Support for Liebert Corp PowerSure PST UPS
3 participants