NUT dashboard widget
-
@dennypage said in NUT dashboard widget:
upsrw -s battery.date=2024/05/20 -u admin -p PASSWORD QNAPUPS
I tried it with the password and i get the following error "Unexpected response from upsd: ERR READONLY"
-
@FrankZappa Also noticed there are two entries in the NUT Services/UPS/Status
battery.date 2001/09/25
battery.mfr.date 2021/04/10The battery.mfr.date is correct. Thats when I bought the APC.
However, the battery.date (and install date on widget) is waaaaaaay off. Can the widget reflect the battery.mfr.date? -
@FrankZappa said in NUT dashboard widget:
battery.date 2001/09/25
battery.mfr.date 2021/04/10The battery.mfr.date is correct. Thats when I bought the APC.
However, the battery.date (and install date on widget) is waaaaaaay off. Can the widget reflect the battery.mfr.date?I've researched a bit, and it appears that the battery date situation with USB UPSs is a bit messed up. In addition to issues like battery.date vs battery.mfr.date you and @tgl encountered with APC, the CyberPower issues appear even worse.
Truth be told, it probably isn't all NUT's fault as it looks like the manufacturers don't seem to completely agree how the dates should map with USB ids.
I think for the time being I'm going to pull the battery install date out of the status widget, at least for USB UPSs. I think as things currently are it would end up causing too much confusion with folks. I'll revisit it in the future.
-
@dennypage said in NUT dashboard widget:
I think for the time being I'm going to pull the battery install date out of the status widget, at least for USB UPSs. I think as things currently are it would end up causing too much confusion with folks. I'll revisit it in the future.
Maybe, if the UPS reports both battery.date and battery.mfr.date, you could show the later one?
-
@tgl I was thinking the same thing, but didn't want to bug Dennypage anymore. Of course, if Dennypage is bored........well?
-
@tgl said in NUT dashboard widget:
Maybe, if the UPS reports both battery.date and battery.mfr.date, you could show the later one?
Unfortunately, that would be locale specific, which is a real pain for date comparison. I'd rather work on fixing some of the issues with NUT itself.
-
@dennypage said in NUT dashboard widget:
Unfortunately, that would be locale specific, which is a real pain for date comparison.
Would it? I'm no expert, but I had the impression that these specific date strings are expected to always have the format yyyy/mm/dd. I agree that it'd be a mess if they don't.
I'd rather work on fixing some of the issues with NUT itself.
Fair, although from what you said upthread it's not clear that that'll yield a solution to this problem.
-
@tgl said in NUT dashboard widget:
@dennypage said in NUT dashboard widget:
Unfortunately, that would be locale specific, which is a real pain for date comparison.
Would it? I'm no expert, but I had the impression that these specific date strings are expected to always have the format yyyy/mm/dd. I agree that it'd be a mess if they don't.
Yes, the dates are presented in locale specific format. 2024/05/10, 2024/10/05, 05/10/2024, 10/05/2024. My date format is happens to be mm/dd/yyyy (see sample pic above), which I hate. If I had my druthers, all dates would all be in iso format (2025-05-10), but it’s outside of my control.
I'd rather work on fixing some of the issues with NUT itself.
Fair, although from what you said upthread it's not clear that that'll yield a solution to this problem.
I’ve reasonable success working PRs/issues with NUT. Changes need to happen there, because there is no way that the vendors are gonna change anything.
-
@dennypage Hi Denny Page,
just curious: Why can't we (you) grab some of the scripting from APCUPSD and add it to the NUT script to produce things like "age of battery" and "power events"? I was able to edit my NUT script to produce the battery install date and changed the text of Vin to Voltage In (see image), but that is the limit of my ability to edit scripts. I'm diving into areas of editing the script that I have zero knowledge of. The APCUPSD was able to calculate the age of the battery, which would be cool to see. Lastly, where in the NUT script does it reach out to get the icon of the green plug you added? Can we have it reference another plug icon? Thanks. -
@FrankZappa Just for reference, here is the APCUPSD output screen:
-
@FrankZappa said in NUT dashboard widget:
@dennypage Hi Denny Page,
just curious: Why can't we (you) grab some of the scripting from APCUPSD and add it to the NUT script to produce things like "age of battery" and "power events"? I was able to edit my NUT script to produce the battery install date and changed the text of Vin to Voltage In (see image), but that is the limit of my ability to edit scripts. I'm diving into areas of editing the script that I have zero knowledge of. The APCUPSD was able to calculate the age of the battery, which would be cool to see. Lastly, where in the NUT script does it reach out to get the icon of the green plug you added? Can we have it reference another plug icon? Thanks.Apcupsd outputs things in a different format than NUT, with different guarantees on the data. They are not interchangeable.
Regarding battery age, the crux of the matter is that battery.date and battery.mfr.date in NUT have specific meaning. They are not the same thing. A lot of USB subdrivers have bugs in how they handle the mapping, and I’d rather spend my time working toward fixing issues in NUT than trying to paste over them in the status widget.
As to Vin (and Vout) those were chosen because 1) they are standard notation for voltages, and 2) they fit comfortably in the widget regardless of current widget display width.
No, you cannot change the plug icon. I believe that it is the only solid icon in the set pfSense uses. FWIW, it’s the same icon as used in the apcupsd widget.
-
@dennypage Thanks for checking. I appreciate all the support you have given. Look forward to the new and improved NUT.