System Preferences in Sierra seems to know when a UPS is present. How do I check this from the command line?
You can use Power Manager's
pmctl tool to check for a connected UPS, see Scripting Batteries and UPS on Mac OS X.
pmctl can output in a range of formats to make scripted parsing easier, use the
-f flag for this:
Alternatively, you could search the output of
system_profiler SPUSBDataType to find the matching UPS.
I wrote Power Manager, so feel free to ask technical questions.