gawindx / WinNUT-Client

This is a NUT windows client for monitoring your ups hooked up to your favorite linux server.
GNU General Public License v3.0
395 stars 70 forks source link

Shutdown bug fix, and a frequency source selection feature #55

Closed jcsmook closed 3 years ago

jcsmook commented 3 years ago
gawindx commented 3 years ago

Well,

Already, thank you for your interest in my work, it's always nice.

But, I have several problems with your request:

Let me explain, the fact of choosing whether it is the input frequency or the output frequency is not intuitive and complicates the configuration (which I find is already enough like that).

Wouldn't it be easier to change the fallback_value to take the output frequency if the input frequency is incorrect?

Apart from that, everything else seems correct to me and if there was not this problem, I would have validated it without hesitation.

Can you delete this commit from the request so that this part already validates and we see in a second step for this functionality.

The idea would be to release v2.0.5 with this feature.

jcsmook commented 3 years ago

Morning gawindx,

Thanks, it is a great tool you gave us!

The only reason I did not just add that to the fallback value, was that there is no fallback on the fallback (If no input or output frequency is available, 0 (I presume the value would be 0) always looks like a problem.

You know your program and user base better than anyone, so I will remove the last commit, and if you want the code for the last commit, I can do a new pull request, or send it to you - let me know.

Enjoy, and thanks again for the great app.

gawindx commented 3 years ago

Just to see how we can solve this frequency problem, can you paste all the variables of your UPS to me?

In Winnut, "File" menu and "List UPS Variable's". You can stick the whole thing in the clipboard.

jcsmook commented 3 years ago

Morning,

Sorry for the late reply: NUT:

battery.charge: 100 battery.voltage: 27.20 battery.voltage.high: 25.3 battery.voltage.low: 21.6 battery.voltage.nominal: 24.0 device.type: ups driver.name: nutdrv_qx driver.parameter.pollfreq: 30 driver.parameter.pollinterval: 2 driver.parameter.port: auto driver.parameter.synchronous: no driver.version: 2.7.4 driver.version.data: Voltronic-QS 0.07 driver.version.internal: 0.28 input.voltage: 239.2 input.voltage.fault: 239.2 output.current.nominal: 7.0 output.frequency: 49.8 output.frequency.nominal: 50 output.voltage: 239.2 output.voltage.nominal: 230 ups.beeper.status: enabled ups.delay.shutdown: 30 ups.delay.start: 180 ups.firmware.aux: PM-V ups.load: 2 ups.productid: 5161 ups.status: OL ups.type: offline / line interactive ups.vendorid: 0665

WinNUT:

mecer (Unknown/Unknown/Unknown) battery.charge (Battery charge (percent of full)) : 100 battery.voltage (Battery voltage (V)) : 27.20 battery.voltage.high (Description unavailable) : 25.3 battery.voltage.low (Description unavailable) : 21.6 battery.voltage.nominal (Nominal battery voltage (V)) : 24.0 device.type (Description unavailable) : ups driver.name (Driver name) : nutdrv_qx driver.parameter.pollfreq (Description unavailable) : 30 driver.parameter.pollinterval (Description unavailable) : 2 driver.parameter.port (Description unavailable) : auto driver.parameter.synchronous (Description unavailable) : no driver.version (Driver version - NUT release) : 2.7.4 driver.version.data (Description unavailable) : Voltronic-QS driver.version.internal (Internal driver version) : 0.28 input.voltage (Input voltage (V)) : 241.4 input.voltage.fault (Description unavailable) : 241.4 output.current.nominal (Nominal output current (A)) : 7.0 output.frequency (Output frequency (Hz)) : 50.0 output.frequency.nominal (Nominal output frequency (Hz)) : 50 output.voltage (Output voltage (V)) : 241.4 output.voltage.nominal (Nominal output voltage (V)) : 230 ups.beeper.status (UPS beeper status) : enabled ups.delay.shutdown (Interval to wait after shutdown with delay command (seconds)) : 30 ups.delay.start (Interval to wait before (re)starting the load (seconds)) : 180 ups.firmware.aux (Auxiliary device firmware) : PM-V ups.load (Load on UPS (percent of full)) : 2 ups.productid (Product ID for USB devices) : 5161 ups.status (UPS status) : OL ups.type (UPS type) : offline ups.vendorid (Vendor ID for USB devices) : 0665

The fallback would work - Only the gauge label would be set to input - I don't really mind this, but...

Regards,

Chris

On Mon, Jan 25, 2021 at 12:59 PM Decaux Nicolas notifications@github.com wrote:

Just to see how we can solve this frequency problem, can you paste all the variables of your UPS to me?

In Winnut, "File" menu and "List UPS Variable's". You can stick the whole thing in the clipboard.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/gawindx/WinNUT-Client/pull/55#issuecomment-766734256, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGZKZV5IVPH7NPKPL74OBILS3VFKXANCNFSM4WODGGLA .

gawindx commented 3 years ago

yes, it can work either the input frequency is provided, or we can take the output frequency and as a last resort we fall back on the theoretical value configured via the parameters.

for the gauge, the most sumple would be to rename without specifying whether it is input or output, as that is always correct (well after, if we are on the fallback value it will be purely aesthetic)

I see what I can do during the week and I come back to you

gawindx commented 3 years ago

I updated the code and made some changes for the frequency. If you can test what I have changed and say if that fixes your problem.

jcsmook commented 3 years ago

Will do so tomorrow, thanks.

On Wed, 27 Jan 2021, 20:57 Decaux Nicolas, notifications@github.com wrote:

I updated the code and made some changes for the frequency. If you can test what I have changed and say if that fixes your problem.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/gawindx/WinNUT-Client/pull/55#issuecomment-768500782, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGZKZV4VIXETCR3BAH473TLS4BO23ANCNFSM4WODGGLA .

gawindx commented 3 years ago

I don't know if you've tried it yet, but I made another change:

To summarize : input.frequency or output.frequency or output.frequency.nominal or frequency defined in the parameters.

I think this should cover all cases.

jcsmook commented 3 years ago

Morning gawindx,

I think this is a good solution. It also does not complicate everything so much. All seems to be working on my side.

Thanks,

C

On Thu, Jan 28, 2021 at 8:26 PM Decaux Nicolas notifications@github.com wrote:

I don't know if you've tried it yet, but I made another change:

  • First, the fallback value is determined, which is either the value of the "output.frequency.nominal" property, or the value defined in the parameters (50 or 60Hz). The variable is now defined in Static and we check if it is initialized (other than zero) so as not to recalculate it each time.
  • When recovering the value of the frequency, we recover the value of "input.frequency to which we apply the fallback value of" output.frequency "to which we applied the value calculated at the previous point.

To summarize : input.frequency or output.frequency or output.frequency.nominal or frequency defined in the parameters.

I think this should cover all cases.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/gawindx/WinNUT-Client/pull/55#issuecomment-769284750, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGZKZV5IGCWGP3JND3HRHMDS4GT6LANCNFSM4WODGGLA .