APC SmartUPS Status Device

5 min, 1 min on battery.

What command are you using via telnet to scrape the status?

apc>detstatus -all
E000: Success
Status of UPS: On Battery, No Alarms Present
Last Transfer: Due to software command or UPS's test control
Runtime Remaining: 0 hr 33 min
Battery State Of Charge: 100.0 %
Output Voltage: 119.4 VAC
Output Frequency: 60.0 Hz
Output Watts Percent: 13.0 %
Output VA Percent: 13.0 %
Output Current: 0.80 A
Input Voltage: 120.9 VAC
Battery Voltage: 25.1 VDC
Internal Temperature: 22.0 C, 71.6 F
Self-Test Result: Passed
Self-Test Date: 08/01/2022
Calibration Result: In progress
Calibration Date: 08/14/2022

apc>ups -st        
E000: Success
State: On Battery, No Alarms Present

apc>detstatus -all
E000: Success
Status of UPS: Discharged, No Other Alarms Present
Last Transfer: Due to software command or UPS's test control
Runtime Remaining: 0 hr 8 min
Battery State Of Charge: 24.0 %
Output Voltage: 118.8 VAC
Output Frequency: 60.0 Hz
Output Watts Percent: 10.4 %
Output VA Percent: 10.4 %
Output Current: 0.64 A
Input Voltage: 118.0 VAC
Battery Voltage: 27.6 VDC
Internal Temperature: 21.6 C, 70.8 F
Self-Test Result: Passed
Self-Test Date: 08/01/2022
Calibration Result: Passed
Calibration Date: 08/14/2022


apc>ups -st
E000: Success
State: Discharged, No Other Alarms Present


apc>detstatus -all
E000: Success
Status of UPS: Discharged, No Other Alarms Present
Last Transfer: Due to software command or UPS's test control
Runtime Remaining: 0 hr 9 min
Battery State Of Charge: 26.0 %
Output Voltage: 119.5 VAC
Output Frequency: 60.0 Hz
Output Watts Percent: 10.4 %
Output VA Percent: 10.4 %
Output Current: 0.64 A
Input Voltage: 119.5 VAC
Battery Voltage: 27.0 VDC
Internal Temperature: 21.6 C, 70.8 F
Self-Test Result: Passed
Self-Test Date: 08/01/2022
Calibration Result: Passed
Calibration Date: 08/14/2022


apc>ups -st        
E000: Success
State: Discharged, No Other Alarms Present


apc>detstatus -all
E000: Success
Status of UPS: On Line, No Alarms Present
Last Transfer: Due to software command or UPS's test control
Runtime Remaining: 0 hr 21 min
Battery State Of Charge: 60.0 %
Output Voltage: 117.3 VAC
Output Frequency: 60.0 Hz
Output Watts Percent: 10.4 %
Output VA Percent: 10.4 %
Output Current: 0.64 A
Input Voltage: 117.3 VAC
Battery Voltage: 27.6 VDC
Internal Temperature: 22.9 C, 73.2 F
Self-Test Result: Passed
Self-Test Date: 08/01/2022
Calibration Result: Passed
Calibration Date: 08/14/2022


apc>ups -st        
E000: Success
State: On Line, No Alarms Present

I think this may have something to do with my settings:

Low Battery Duration
20 minutes
Shutdown Delay
180 seconds
Maximum Required Delay
20 minutes

I kept a watch on things and as soon as Runtime Remaining hit 20 mins, it went back to On Line (see previous post).

Probably all mine are set to like 2mins to get max runtime. I guess if yiu are saying you need 20 mins if min runtime than it could be considered discharged even while its charging weird. Ill lok at adding discharged to battery state.

By the way if anyone is looking to hook up their ups to monitor with the netcard but it is not near your router these work really well with the ups netcard when set to access pt mode

TP-Link AC750 Dual Band Wi-Fi Travel Router TL-WR902AC

new version 2.5 in github and on package manager..

  • v 2.5 aug 2022 apparently even if ups is charging but you set your low battery duration to a weird number like 20 minutes it will show battery status as discharged until it surpasses that
  • so added discharged ups status.
    */

new version 3.0 in git hub and package manger.

added the follwing attributes (model number, serial number, firmware version, battery type, manuf. date) so test on your ups to make sure it didnt break anything

Screenshot 2022-08-18 172439

Seems to work fine, thanks for the driver.

Opera Snapshot_2022-09-11_175125_192.168.1.20

Seems to be working, altough i don't get the new attributes.

You may just need to wait....? For the readings to come through....

You have some of the new attributes

Ie manuf date .serial number etc. To figure out some are missing you will need to turn on debugging and i may need to tweek it for your firmware version.

It looks like only model and battery type are missing.

Also other normal attributes are missing like last My guess is your network card firmware is not fully supported or doesn't have everything. It will be hard to debug Without having one of those cards. What card is it and what firmware version is on it?

Also shouldn't have a current check time as low as 1 minute that can cause undue load on the hub and it may not even finish updating in that time.

Here are all the attributes you should have.

1 Like

Hello,

Turned on debugging and set the refresh rate to 2 min. I need it for Grafana dashboard.

Those attributes are not so important so it is fine without them. Just posted for feedback.

Opera Snapshot_2022-09-11_194204_192.168.1.17

1 Like

Can you add Output in Wh ? It would be very useful for dashboards.
If this is not available in can be calculated in the background. I already used that for the hubitat dashboard but for Grafana this method makes more sense. If you get the model you already have the total watts output. If not maybe you can use a field for manual input. Then you multiply the total by OutputWattsPercentage, and divide by 100.

new version 3.5.
the last round of changes i noticed that quit was being issue too early in the sequence never moved it to the end of the new commands so it was closing the socket too early.. It sometimes worked, but sometimes depending on if and when data came back after quit got out of sync..

Also, I had a quit at the end of the list of commands to be issued, but for some reason the telnet library seems to have changed and hubitat now seems to be interpretting the commands and when it sees the quit now closes the socket immediately even before any input comes back so I had to remove that. Previously i explicitely had to issue the closeConnection command to close the socket..

i dont that that is really accurate.. i am thinkng the outputcurrent * the outputvoltage should be the watts. for one thing the rating on the model number is VA not watts

You have a model rating in VA which for my UPS is 1000 and one rating in Wh which is 700.
(700*35%)/100 = 245 Wh. I know this is accurate because i have a smart plug on the input.

@kahn-hubitat

Have a bunch of these in my logs

Try manually telneting from a command prompt.

. That usually means the ip address changed or the ups is not online or user/
Password is not working.

No problem, username and pw check out fine

Check ip address in driver . Is it the same.

How are you getting that outout?
Right inside it shows telnet disabled.

Must be using ssh?
Enable telnet in the net card