APC SmartUPS Status Device

Successfully running on two old Smart-UPS units (SUA1000 and SUA1500) using AP9630 and AP9631 cards.

1 Like

new version in github

  • v 1.5 some ups return on line other online handle both one with 8 words one with 4
  • v 1.6 Add optional runtime for on battery so that you can check the UPS status fewer times and then increase
  • the times checked when on battery (ie reduce the time say from 30 minutes to 10 etc.)

make sure to update code baxe and resave preferences in the device.

UPSStatus didn't update correctly with my setup. Added (pair.length == 11) || to Line 274 fixed it.

New statement: if ((pair.length == 11) ||(pair.length == 7) || (pair.length == 8) || (pair.length == 5))

1 Like

Ver 1.7 changes from ct90 for

  • v 1.7 fix.. for yet another differing version of responses to get the UPS status. It seems there are as many differnt ups and net card firmwares and responses as days in the month!
    */

New version 1.9*

v 1.10 as well as internal temp and battery attributes added them as capabilties as well so you can use standard battery and temp tiles and standard rules on these.

  • related also added a pulldown for units for temp ie C or F so the correct temp is set for the capability.

no version 1.10 added

Adding attributes for ups temperature in both C and F, and corresponding call to populate.
CTemp and Ftemp

Nice! Minor addition line 377 to work correctly with my configuration:

if ((p0 == "Internal") || (p0 == "Battery") && (p1 == "Temperature:"))

done slightly different as i am not sure of the precedence of "OR" vs "AND"
if (((p0 == "Internal") || (p0 == "Battery")) && (p1 == "Temperature:"))

v 1.11

1 Like

new version 2.0 available via git hub and on Hubuitat package manager..
v 2 added all kinds of new power and battery attributes. Not all UPS cards have all this info, It will report what it can.

As in the past some ups net cards may return different strings than i am queuing off of. If you find this let me know and I fix it.

attribute "outputVoltage", "number"
attribute "inputVoltage", "number"
attribute "outputFrequency", "number"
attribute "inputFrequency", "number"
attribute "outputWattsPercent", "number"
attribute "outoutVAPercent", "number"
attribute "outputCurrent", "number"
attribute "outputEnergy", "number"
attribute "batteryVoltage", "number"
attribute "lastSelfTestResult", "string"
attribute "lastSelfTestDate", "string"
attribute "nextBatteryReplacementDate", "string"

new version 2.1

added 2 levels of debugging,, off, with only a few lines each run, minimal ... shown above, and maximum which corresponds to old debug.

Also added code to automatically turn off debugging after 30 minutes per hubitat guidlines.

new version 2.2. fixed typo in one of the new attribute names.

1 Like

HI,

Seeing the following under current status. telnet : send error: Broken pipe (Write failed)
but seems to be working OK

That's normal as some data still comes back after socket is closed.

Nice !apc

:+1:

new version..

  • v 2.3 cleared telnet error on close,init commands and also fixed version not passed correctly to attribute.

make sure to resave preferences after install

2 Likes

Installed new version. I noticed it took a while until it managed to connect to the ups, but now it seems ok.

And one more suggestion: can you add asterisk password instead of plain text in the device page?

if you can tell me how to do that i dont see any code for that.. regardless it is not really necessary becuase if your home network is compromised you are screwed anyway.

I know i've seen it somewhere, possibly the former ups driver. But yeah, it is not really necessary, if it can not be implemented easily.

Anyway, keep up the good work, and thank you for making this available. :+1:

1 Like

figured it out.. new version 2.4 with type of input changed to password.

:+1: :blush: Thx

Great Device / Driver!
Did anyone ever get the AP9616 (NMC1) card working? i have 2 UPSs with that card that i would love to get working. I have a third with the NMC2 that works great. I can provide logs or access if needed, I even have a spare card i could ship out if that's what it takes.