Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

UPS: read NUT as well as apcupsd in upsDevices

Aperta
#2,115 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
48/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
typescript
Ambito
api, backend

Direzione di ricerca

Start by reading UPSService.getUPSData() and createUPSDevice, which the issue identifies as the apcupsd data path and placeholder mapping. Check how UPS configuration is exposed, then trace how the NUT plugin provides its configured NAME and IPADDR for server and client modes. Done means NUT readings map to the listed UPSDevice fields when apcupsd returns no data, with the proposed source and configuration signals handled consistently.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Is your feature request related to a problem?

upsDevices only reads apcupsd (UPSService.getUPSData() runs /sbin/apcaccess). Many Unraid servers monitor their UPS with NUT instead, through the popular NUT plugin, often as a NUT client of another box (a firewall or another server) that the UPS is plugged into. On those servers apcupsd is disabled, apcaccess returns nothing, and upsDevices fails with Failed to get UPS data: No UPS data returned from apcaccess. So API clients can't show the UPS the server actually depends on, even though the webGUI shows it through the NUT plugin.

Related: #1765 (a NUT user seeing wrong values in a mobile client) and #1825 (placeholder values returned when no UPS is connected).

Describe the solution you'd like

When apcupsd has no data and NUT is configured, read the UPS through NUT (upsc <ups>@<host>, or the NUT network protocol on port 3493 using the plugin's configured NAME / IPADDR, which works in both server and client mode), and map it onto the existing UPSDevice fields:

UPSDevice field NUT variable
model device.model / ups.model
status ups.status (OL, OB, LB, ...), mapped to the same words as apcupsd
battery.chargeLevel battery.charge
battery.estimatedRuntime battery.runtime (already seconds)
power.inputVoltage input.voltage
power.outputVoltage output.voltage
power.loadPercentage ups.load
power.nominalPower ups.realpower.nominal

A source field (APCUPSD / NUT) on UPSDevice or UPSConfiguration would help clients explain where the data comes from.

Describe alternatives you've considered

  • Enabling apcupsd alongside NUT: not supported; the two conflict over the USB device, and a NUT client has no local UPS to read.
  • Querying NUT directly from the client: needs another port and credentials outside the API, and only works on the LAN.

Additional context

While adding a UPS card to an Android client (urrt) on API 4.37.5, two more things showed up:

  • upsConfiguration.service is the useful "is a UPS configured" signal for apcupsd, but there is no equivalent for NUT, so a client can't tell "no UPS" from "UPS monitored by NUT".
  • When an apcaccess field is missing, createUPSDevice fills in placeholders (LOADPCT 25, BCHARGE 100, TIMELEFT 60 min, LINEV/OUTPUTV 120.5, model "APC Back-UPS Pro 1500", health always "Good"). A client can't tell those from real readings. Returning null for missing values (the fields would need to become nullable) would let clients show "unknown" instead. This overlaps #1825.

Environment (if relevant)

Unraid OS Version: 7.3.3 and 7.4.0-rc.1 (API 4.37.5). The server is a NUT client (MODE="slave") of a NUT server on the firewall; apcupsd disabled.

Pre-submission Checklist

  • I have searched existing issues to ensure this feature hasn't already been requested
  • This is not an Unraid Connect related feature (if it is, please submit via the support form instead)
  • I have provided clear examples or use cases for the feature
Lingua principale
TypeScript
Stelle
115
Fork
23
Merge medio
4g 1h
PR unite (30g)
7

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di unraid/api

Tutte le issue di unraid/api

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.