Index | Thread | Search

From:
Landry Breuil <landry@openbsd.org>
Subject:
Re: upd(4): add more sensors (load, power..)
To:
Walter Alejandro Iglesias <wai@roquesor.com>, tech@openbsd.org, sthen@openbsd.org
Date:
Thu, 21 Nov 2024 18:02:31 +0100

Download raw body.

Thread
  • Landry Breuil:

    upd(4): add more sensors (load, power..)

  • Landry Breuil:

    upd(4): add more sensors (load, power..)

  • Le Tue, Nov 19, 2024 at 10:51:00AM +0000, Stuart Henderson a écrit :
    > On 2024/11/19 10:19, Walter Alejandro Iglesias wrote:
    > > On Sat, Nov 16, 2024 at 12:30:47PM +0100, Landry Breuil wrote:
    > > > so if you have an upd(4) somewhere and you have sensors, i'll be glad to
    > > > know if:
    > > > - you get more sensors and they make sense
    > > > - you get values that make more sense than before
    > > > - you had a value for RunTimeToEmpty that made sense and now doesn't
    > > >   (same for AtRateTimeToEmpty/AtRateTimeToFull if you have them)
    > > > - it now breaks/detaches/reattaches
    > > > 
    > > 
    > > With your patch RunTimeToEmpty now tells the true.
    > > 
    > > I guess PercentLoad is ok.
    
    Thanks for the report, that seems to confirm that all EATON UPSs need
    the same treatment.
    
    > > Regarding VoltageDc and ConfigApparentPower I don't know what they mean.
    > 
    > VoltageDc is the voltage at the battery (could either be DC charger
    > voltage or battery voltage I suppose). Unless your batteries are on
    > several rows of shelves, that's not reported correctly. ($work 40kVA
    > UPS has several rows of shelves and DC voltage is 270V so 828V would
    > be a huge one :-)
    > 
    > Apparent power is related to the current drawn (whereas "true" power
    > depends on power factor). It should be somewhere in the region of W
    > drawn but not exactly the same.
    > 
    > The unit for apparent power should be VA, not W.
    
    Oh.. that explains why the strange values. Would it make sense then to
    convert (and how) those VA to W for "end-user values" ?
    
    > I'm not sure if "ConfigApparentPower" would be actual use or the max
    > allowed by the UPS; "Config" suggests possibly the latter.
    
    After rereading the spec and a bit of the nut code, it seems to me that
    ConfigApparentPower correspond to the max allowed by the UPS. I don't
    think it really makes sense to report a constant in sensors, so i'd be
    tempted to leave that one out.
    
    I managed to configure nut to talk to my UPS and it reports sensible
    values (eg ones that match the LCD values):
    ups.load: 16
    ups.power: 98
    ups.power.nominal: 650
    ups.realpower: 63
    battery.runtime: 2050
    
    i'll have to digest the laaarge output produced by usbhid-ups -DDDDD to
    understand what is read from which usb register/reportid, and how those
    are converted to the end-user values.
    
    my idea would be to:
    - enable the PercentLoad sensor
    - fix RunTimeToEmpty for EATON models
    - and eventually figure out how to massage the power/realpower values
      from what i've read, converting from VA ? the USB HID spec doesn't
    seem to say those are VA but W, but i might be wrong here.
    
    Landry
    
    
    
  • Landry Breuil:

    upd(4): add more sensors (load, power..)

  • Landry Breuil:

    upd(4): add more sensors (load, power..)