APCSMART(8)

πŸ’– APCSMART(8) πŸ’–

okay bestie, welcome to the apcsmart(8) page from the NUT Manual. this is part 1, and it's giving long, but we're gonna get through it together. no cap. 🫢


✨ NAME ✨

apcsmart β€” the driver for American Power Conversion Smart Protocol UPS equipment. that's the whole vibe. πŸ’…


🌸 SYNOPSIS 🌸

apcsmart -h

apcsmart -a UPS_NAME [-x option=value ...]
Note β€” bestie, this man page only documents the hardware-specific features of the apcsmart driver. for the core driver deets, see nutupsdrv(8). iykyk. ✨

πŸ¦‹ SUPPORTED HARDWARE πŸ¦‹

ngl, the apcsmart driver should recognize β€” or at the very least, work with β€” the majority of Smart-UPS models. that includes Smart-UPS, Matrix-UPS and Back-UPS lineups, among few other ones. slay. πŸ”₯

currently, we can roughly divide APC hardware into four groups (note that the division isn’t strict by any means, and the borders between those are pretty fuzzy):

[very] "old" models

these models usually have old APC logo, white color and no programmable EEPROM. you won’t find them listed anywhere on APC’s site either. the support for those will be usually based on driver’s compatibility tables, or if the model (firmware) is not listed in those β€” the driver will try to follow the very basic subset of features, while still trying to remain useful. despite "smart" tagname, they often tend to behave in pretty dumb way (see the section below about shutdown behaviour). lowkey not it. 😭

Example models:

  • Smart-UPS 2000I
  • Smart-UPS 900I

"new" models

these models usually come from late 1990s / pre-2009 times. they are often referred to as "3rd. gen". for the most part, they have programmable EEPROM, report supported commands and capabilities, and should work just fine with the apcsmart driver. periodt. πŸ‘‘

WARNING: these are not natively supported by apcsmart (or as of this writing by apcupsd, for that matter, if you’re wondering). around 2007, APC (now APC Schneider) decided to go back to its proprietary roots, and all the new models (SMT, SMX, SURTD) use completely different protocol and cables. if you purchased a new APC UPS β€” that uses cable with RJ45 on the one end, and DB-9 on the other β€” then you have such model. your only option to support it through NUT is to purchase a "legacy communications card" β€” part #AP9620 (google AP9620 for more details). or if that’s not an option, rely on official software. fr fr, it's a whole thing. πŸ’€

UPDATE:. later releases of apcupsd claimed support for new APC protocols, so it is worth checking if apcupsd software would work with your device, and apcupsd-ups NUT driver would handle it as part of NUT-managed ecosystem.

Microsol models

several Microsol serial models sold in Brazil have been rebranded as APC Back-UPS, and the model numbers tend to start with "BZ". if you have one of these "Nobreaks", they will not work with the apcsmart driver β€” please see the solis(8) driver instead. not me finding out the hard way. πŸ™ˆ

Example models:

  • Back-UPS BZ1200-BR
  • Back-UPS BZ2200BI-BR

another thing to remember is that Smart protocol is not USB protocol. if you have UPS with both USB and serial ports, then depending on how you connect it, you will need either apcsmart or usbhid-ups driver. choose wisely, bestie. πŸ’…


πŸŽ€ CABLING πŸŽ€

this driver expects to see a 940-0024C cable or a clone by default. you can switch to the 940-0095B dual-mode cable support with the cable= definition described below.

if your 940-xx24X cable is broken or missing, use this diagram to build a clone:

https://www.networkupstools.org/cables.html#_940_0024c_clone

Note β€” the "xx" is either "00" for a short cable, or the number of feet of a longer cable. the "X" is a letter representing the minor revision of the physical cable and its connectors ("C" and "E" are commonly found revisions). all minor revisions should use the same pin-outs and wiring. no cap. ✨

you can specify alternate cable in ups.conf(5):

*cable*=940-0095B

alternatively, you can also provide it on the command line using:

-x *cable*=940-0095B

πŸ’œ TTY MODES πŸ’œ

by default the driver works in canonical mode, but it proved to be a problem in Windows systems. furthermore there’s a possibility of some obscure serial cards or serial-USB converters that could cause problems as well. you can use ttymode= option to force non-canonical discipline in ups.conf(5):

*ttymode*=raw

alternatively, you can also provide it on the command line using:

-x *ttymode*=raw
Note β€” any other value will make the driver work in the canonical mode. so don't get creative. πŸ’€

πŸ”₯ EXPLANATION OF SHUTDOWN METHODS SUPPORTED BY APC UPSES πŸ”₯

okay so APC hardware supports a lot of shutdown methods, that themselves can differ in behaviour quite a bit, depending on the model. it's giving variety, and not all of it is good. 🌈

S (soft hibernate)

this is most basic command present in probably all APC models. it will hibernate the UPS, and subsequently wake it up when the mains supply returns. the command doesn’t work if the UPS is running on mains. iconic but limited. πŸ’…

"old" models:

the behaviour here is unfortunately pretty primitive β€” when the power returns, the UPS just wakes up. no grace periods, no min. battery charge condition, etc. this is probably not what you want. lowkey tragic. 😭

"new" models:

the behaviour here is as expected β€” the power is cut off after the EEPROM defined grace period. the UPS will wake up when the power returns, after the EEPROM defined delay AND if the EEPROM defined min. battery charge level is met. the delay is counted from the power’s return. slay, that's how it should be. πŸ‘‘

CS (aka "force OB hack")

this is a trick to make UPS power down even if it’s running on mains. immediately before issuing S, "simulate power failure" is issued. the remaining behaviour is as in S case.

there’s a delay between "simulate power failure" and S β€” by default set to 3.5s. you can control it through cshdelay option (allowed values are from 0 to 9.9).

the name came from APC CS models, where such trick was used to power down UPSes in consistent fashion using only S. it’s better to use @nnn command if your UPS supports it (and is not too old, see below). iykyk. ✨

@nnn (hard hibernate)

this is basic command used to hibernate UPS regardless if it’s running on batteries or on mains. the option takes 3 digits argument which can be used to specify additional wake-up delay (in 6 minute units).

"old" models:

the behaviour is β€” unfortunately β€” similarly primitive to S. the UPS unconditionally wakes up after nnn*6 minutes: it doesn’t care if the power returned !

Note β€” if nnn = 000, then UPS will do precisely nothing. on those models you should better specify nnn > 0, if you can estimate the kind of power problems that might be happening in your environment. do not skip this, bestie. πŸ’€

another thing to consider with "old" models β€” you might lose the connection with the UPS, until it wakes up (with S, the serial connection is kept alive).

"new" models:

all the usual variables defined in EEPROM are respected (see S). additionally, if nnn > 0, the nnn*6 minutes are added to EEPROM defined delay. UPS will not power up if it’s running on batteries, contrary to what "old" models used to do β€” the combined delay is counted from the moment of power return.

supposedly there exist models that take 2 digits instead of 3. just in case, NUT also supports such variation. you have to provide exactly 2 digits to trigger it (awd option, or argument to one of the supported instant commands). not me being extra careful. πŸ™ˆ

K (delayed poweroff)

this is permanent poweroff β€” the UPS will not wake up automatically. on newer units, it will respect applicable EEPROM variables. it's giving final boss energy. πŸ‘‘

Z (instant poweroff)

this is also permanent poweroff β€” the UPS will not wake up automatically. the poweroff is executed immediately. no waiting, no warning. πŸ’…


πŸ‘‘ SHUTDOWN CONTROL BY NUT πŸ‘‘

there are three options used to control the shutdown behaviour.

  • sdtype=[0-5] β€” this option takes a single digit (0-5) as an argument. see below for details.
  • advorder=no|[0-4]+ β€” this option takes string of digits as an argument. methods listed are tried in turn until one of them succeeds. note that the meaning of digits is different from sdtype. see below for details.
  • awd=[0-9]{1,3} β€” this option lets you specify additional wake-up delay used by @. if you provide exactly 2 digits, the driver will try 2 digits variation (see previous section for more info). otherwise standard 3 digits variation is used. note: the time unit is 6 minutes !

keep in mind that sdtype and advorder are mutually exclusive. if advorder is provided, sdtype is ignored. if advorder is set to no, sdtype is used instead.

if nothing is provided, NUT will assume sdtype=0 β€” which is generally fine for anything not too ancient or not too quirky. periodt.

SDTYPE

the values permitted are from 0 to 5. only one can be specified. anything else will cause apcsmart to exit. so don't test it. πŸ’€

  • 0 β€” issue soft hibernate (S) if the UPS is running on batteries, otherwise issue hard hibernate (@)
  • 1 β€” issue soft hibernate (S) (if on batteries), and if it fails (or on mains) β€” try hard hibernate (@)
  • 2 β€” issue instant poweroff (Z)
  • 3 β€” issue delayed poweroff (K)
  • 4 β€” issue "force OB hack" (CS)
  • 5 β€” issue hard hibernate (@)
Note β€” hard hibernate’s additional wake-up delay can be provided by awd. don't forget, bestie. ✨

ADVORDER

the argument is either a word no, or a string of 1..5 digits in [0..4] range. each digit maps to the one of shutdown methods supported by APC UPSes. methods listed in this way are tried in order, until one of them succeeds.

if advorder is undefined or set to no, sdtype is used instead.

the mapping is as follows:

  • 0 β€” soft hibernate (S)
  • 1 β€” hard hibernate (@)
  • 2 β€” delayed poweroff (K)
  • 3 β€” instant poweroff (Z)
  • 4 β€” "force OB hack" (CS)
Note β€” hard hibernate’s additional wake-up delay can be provided by awd.

πŸ’… IGNORING LB STATE πŸ’…

okay bestie, listen β€” APC units, even if they report LB mode, will not go into shutdown automatically. and honestly? that's a gift, because it gives us even more control over "when to actually shutdown PSU". ✨

since version 2.6.2, NUT supports the ignorelb option in the driver's section of ups.conf(5). when that option is in effect, the core driver will straight-up ignore LB state as reported by the specific driver and start shutdown basing the decision only on two conditions:

battery.charge < battery.charge.low

OR

battery.runtime < battery.runtime.low

and of course β€” if any of the variables aren't available, the appropriate condition just isn't checked. no drama. 🫢 if you want to explicitly disable one of the conditions, simply override the right hand variable, which makes the condition always evaluate to false (you can even provide negative numbers, yes really).

APC UPSes don't have battery.charge.low β€” so you'll have to define it yourself if you want to use that condition (prefix the variable with override. or default.). πŸŽ€

"New" units have battery.runtime.low, but depending on battery quality, firmware version, calibration and UPS load β€” this variable can be underestimated quite a bit β€” especially right after going into OB state. and that in turn can cause LB to be asserted, which under normal conditions will cause NUT to initiate the shutdown. 😭 so you might wanna disable this condition entirely when you're relying on the ignorelb option (this was actually the main motivation behind introduction of such feature, iykyk).

simple example, no cap:

[apc]
    ignorelb
    override.battery.charge.low = 15
    override.battery.runtime.low = -1

this would cause apcsmart to go into shutdown only if detected battery charge < 15%. the runtime condition is always false in this example. periodt. πŸ’…

you could ask β€” why bother? well, the reason is already hinted above. APC units can be very picky about the batteries, and their firmware can underestimate the remaining runtime (especially right after going into OB state). ignorelb option and override.* let you remain in control of the UPS, not UPS in control of you. πŸ‘‘

furthermore, this allows you to specify conditions similarly to how it's done in the apcupsd daemon, so it should be welcome by people used to that software. 🌈


⚑ SUPPORTED INSTANT COMMANDS ⚑

the apcsmart driver exposes the following instant commands:

  • shutdown.return β€” executes soft hibernate
  • shutdown.return cs β€” executes "force OB hack"
  • shutdown.return at:<nbr> β€” executes "hard hibernate" with <nbr>*6 minutes additional wake-up delay (<nbr> format is the same as of awd option)
  • shutdown.stayoff β€” executes "delayed poweroff"
  • load.off β€” executes "instant poweroff"
bestie this is important: all the above commands must be issued a 2nd time to have any effect (no less than 3 seconds, and no more than 15 seconds after the initial call). πŸ’€ those commands are mostly useful for manual testing, when your machine is not powered by the UPS you're testing.

other supported commands:

  • load.on
  • test.panel.start
  • test.failure.start
  • test.battery.start
  • test.battery.stop
  • bypass.start
  • bypass.stop
  • calibrate.start
  • calibrate.stop

πŸ¦‹ PREVIOUS DRIVER VERSION πŸ¦‹

the previous driver is still available as apcsmart-old, should there be any need to use the earlier version (bugs, incompatibilities with new functionality, etc.). in due time, apcsmart-old will be phased out completely, but this won't happen until the new version gets solid exposure with no pending issues. so like, it's not going anywhere just yet. 🫢


πŸ’€ BUGS πŸ’€

some older APC UPS models return bogus data in the status register during a front panel test. this is usually detected and discarded, but some other unexpected values have occasionally slipped through. πŸ™ˆ

APC UPS models with both USB and serial ports require a power cycle when switching from USB communication to serial, and perhaps vice versa.


🌸 AUTHORS AND HISTORY 🌸

Nigel Metheringham <Nigel.Metheringham@Intechnology.co.uk> (drawing heavily on the original apcsmart driver by Russell Kroll) wrote a driver called newapc for a time, which was renamed in the 1.5 series.

in 2.6.2 that driver was renamed finally to apcsmart-old, being superseded by this updated version with new features which currently holds the apcsmart name, and is maintained by Michal Soltys <soltys@ziu.info>. iconic lineage honestly. πŸ‘‘


⭐ SEE ALSO ⭐

nutupsdrv(8), ups.conf(5), usbhid-ups(8), solis(8)

🌐 Internet resources:

the NUT (Network UPS Tools) home page: https://www.networkupstools.org/historic/v2.8.5/


and that's the whole page bestie, we ate that πŸ’…βœ¨ this was Network UPS Tools 2.8.5, dated 10/07/2026, and yes β€” it's the APCSMART(8) manual page, the moment, the icon, the blueprint. go forth and manage your UPS like the main character you are. πŸŽ€πŸ¦‹πŸ’–

πŸ“¦ where this page comes from