<div dir="auto">As for "how much NUT" is doing, it depends :)<div dir="auto"><br></div><div dir="auto">For many of the values where mapping tables are involved, it just reads some number or string from the protocol encapsulation (usb-hid, snmp, netxml...) and passes it on. However, that entry's mapping may also involve scaling (multiply by a factor) or arbitrary subdriver-defined mapping functions (name phases from a number, print ISO date from country-preferred input, etc.) as the most common conversions.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Mar 18, 2022, 00:26 Greg Troxel <<a href="mailto:gdt@lexort.com">gdt@lexort.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
I have been using NUT for a long time, but my UPS farm is very old and<br>
homogenous: I have 3 "Best Power Fortress" from about 1995, and there's<br>
one at someone else's.  (Yes, these really are 27 years old, and yes I<br>
have changed the batteries.)  They report a bunch of variables, and I<br>
have written a python program to report the interesting data over MQTT<br>
for use in Home Assistant or whatever.  I mumbled earlier that I will<br>
release that as open source and I mumble that again.<br>
<br>
Nothing super interesting here:<br>
<br>
  battery.runtime: 5940<br>
  battery.runtime.low: <br>
  battery.voltage: 27.5<br>
  battery.voltage.nominal: 24<br>
  device.mfr: Best Power<br>
  device.model: Fortress<br>
  device.type: ups<br>
  <a href="http://driver.name" rel="noreferrer noreferrer" target="_blank">driver.name</a>: bestfortress<br>
  driver.parameter.baudrate: 9600<br>
  driver.parameter.max_load: 660<br>
  driver.parameter.pollinterval: 2<br>
  driver.parameter.port: /dev/tty.ups<br>
  driver.parameter.synchronous: no<br>
  driver.version: 2.7.4<br>
  driver.version.internal: 0.05<br>
  input.frequency: 60.0<br>
  input.transfer.high: <br>
  input.transfer.low: <br>
  input.voltage: 124<br>
  output.current: 0.3<br>
  output.voltage: 123<br>
  output.voltamps: 37<br>
  ups.delay.shutdown: 10<br>
  ups.load: 5<br>
  ups.mfr: Best Power<br>
  ups.model: Fortress<br>
  ups.status: OL <br>
  ups.temperature: 18<br>
<br>
and it is turned into json (omitting much) as an MQTT payload:<br>
<br>
{"tst":"2022-03-17T19:15:15.641791-0400","topic":"sensor/foo/bar-ups/json","qos":2,"retain":0,"payloadlen":233,"mid":27,"payload":{"time": 1647558915.5165293, "runtime": 5940.0, "battery": 27.5, "frequency": 60.0, "line_v": 124.0, "output_v": 123.0, "output_a": 0.3, "output_va": 37.0, "output_percent": 5.0, "status": "OL ", "utility": "ON", "temperature": 18.0}}<br>
<br>
I know from past discussion that reporting "status" this way is<br>
nonportable/awkward, and I probably should omit it and just use<br>
"utility" which maybe should be "utility_inuse".  My point is that what<br>
the monitoring system cares about is "Is the UPS using utility power or<br>
not" as a running on battery even if input voltage is non-zero is still<br>
cause for concern.<br>
<br>
And maybe I should drop output_percent and have rated_va configured (660<br>
in this case) because it doesn't seem to be in the NUT output.<br>
<br>
My script is in the process of being extended to also deal with apcupsd<br>
and that seems to have different variables, like timeleft in minutes<br>
instead of runtime in seconds.  It seems obvious to me that I should<br>
bring things into a common schema, because the monitoring system doesn't<br>
care about UPS brand; it wants to know is utility power good enough, how<br>
many seconds left, etc.<br>
<br>
I wonder how much NUT does that by itself, or if it's more doing format<br>
translation of the individual units.  And I would appreciate comments on<br>
the wisdom/necessity of this approach.<br>
<br>
Thanks,<br>
Greg<br>
<br>
_______________________________________________<br>
Nut-upsuser mailing list<br>
<a href="mailto:Nut-upsuser@alioth-lists.debian.net" target="_blank" rel="noreferrer">Nut-upsuser@alioth-lists.debian.net</a><br>
<a href="https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/nut-upsuser" rel="noreferrer noreferrer" target="_blank">https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/nut-upsuser</a><br>
</blockquote></div>