[RELEASE] APC SmartUPS Status Driver

Mark,

I see two potential issues. The first is on the driver side. That warning says it's somehow confused and isn't polling the device. Go in to the device and click on "initialize." That will reset the driver, get rid of the warning, and start polling again. Check the lastUpdate attribute in the driver, I'm sure its stale.

The second issue is related to the polling frequency. What to you have it set to? The default 5 minutes? That event at 15:24:02 (on battery) and then returning to mains at 15:25:19 can completely occur outside a polling cycle. We'd have to be lucky to see it flip like that and have a poll occur within such a short window.

Unfortunately, we can't subscribe to SNMP traps and a 5 or 10 second polling frequency is just too heavy for the hub. I see you what I do, I get traps that instantly notify me of small events through Schneider's app/e-mail.

As for the second, longer, on battery condition, that should've been seen but we have the confused driver problem I stated earlier. It's stuck in an initialization loop and isn't polling.

I've seen that init problem before and, thought I had the watchdog working to correct that. Seems it needs a little work. :frowning:

I just checked my four devices. They've been humming along just fine for the past 12 days. That was the last time I updated the code to add in the nextBatteryReplacement attribute for you. :wink:

I've seen that loop occur if the hub was rebooted during a telnet poll. Upon restart, the driver sees the stale data and clears it. That's what the "Detected residual state keys (deferredCommand) during sendUPSCommand" message means. It appears the watchdog detected the stale state.deferredCommand variable but didn't (or couldn't) clear it. State variables are... well... fun. :stuck_out_tongue:

I've rebooted my hub a few times in the past couple of weeks, and it's been clean so I don't have an example of the driver getting hung.

There is a timing adjustment I can make that might be just what the doctor ordered. I need to see a bit more of the device log to see if my hunch is right. Can you PM me the full log?

I have polling set to 5 mins online and one minute on battery. I have re-initialized but I'm not sure how I can tell whether the HE<>UPS is connected, since I now understand that's not what UPS Status nor Connect Status refers to. For things like this, I usually run my own watchdog rule on an attribute or Last Date or something similar that indicates health of HE connection. What would you suggest I use with this driver?

As it stands now, I suspect the UPS was still not connected to HE because my Last Activity Date for the problematic UPS had been last night, whereas my others all showed Last Activity Dates (er, Time) of a few minutes ago. Note however: I did just wait a full 5 minutes after initializing and sure enough the Last Activity Date updated to now-ish so it looks like it reconnected.

FWIW, the device was on battery a little over an hour so I don't think all the events happened intra-poll.

One suspicious thing I just noticed: look at the web UI a few messages up in this thread. This event happened last night but the dates on the web UI are all 12/26/2025. Like there's a date mismatch. When I look at the HE device, it indicates a UPS Date of 12/22/2025 and a Last Update of 12/24/2025. Would you expect this pattern? Seems odd to me but I don't think I have semantic command of the attribute terminology.

Will PM you full logs in a sec....

After updating that reset method, I tried to break it... but couldn't. I think the update might just have this one licked... at least I hope so.

I pounded on it and it the watchdog recovered each time.

Log

dev:9762026-12-29 14:59:04.669

info

[APC SmartUPS Status (Test Track)] connectStatus=Disconnected

dev:9762026-12-29 14:59:04.648

info

[APC SmartUPS Status (Test Track)] lastCommandResult=Complete (Reconnoiter completed normally)

dev:9762026-12-29 14:59:04.643

info

[APC SmartUPS Status (Test Track)] connectStatus=Disconnecting

dev:9762026-12-29 14:59:04.640

info

[APC SmartUPS Status (Test Track)] lastUpdate=12/29/2025 2:59:04 PM (Data Capture Run Time = 4.796s)

dev:9762026-12-29 14:59:04.634

info

[APC SmartUPS Status (Test Track)] lastSelfTestDate=12/17/2025 (UPS Last Self-Test Date = 12/17/2025)

dev:9762026-12-29 14:59:04.627

info

[APC SmartUPS Status (Test Track)] lastSelfTestResult=Passed (UPS Last Self Test Result = Passed)

dev:9762026-12-29 14:59:04.615

info

[APC SmartUPS Status (Test Track)] outputWattsPercent=13.0 (Output Watts = 13.0%)

dev:9762026-12-29 14:59:04.606

info

[APC SmartUPS Status (Test Track)] Battery run time recovered above 4 minutes (126 remaining)

dev:9762026-12-29 14:59:04.604

info

[APC SmartUPS Status (Test Track)] UPS Run Time Remaining = 02:06

dev:9762026-12-29 14:59:04.598

info

[APC SmartUPS Status (Test Track)] Monitoring scheduled every 5 minutes at 7 past the hour.

dev:9762026-12-29 14:59:04.528

info

[APC SmartUPS Status (Test Track)] nmcUptime=120 Days 1 Hour 37 Minutes (NMC Uptime = 120 Days 1 Hour 37 Minutes)

dev:9762026-12-29 14:59:04.517

info

[APC SmartUPS Status (Test Track)] manufactureDate=01/13/2005 (UPS Manufacture Date = 01/13/2005)

dev:9762026-12-29 14:59:04.512

info

[APC SmartUPS Status (Test Track)] firmwareVersion=601.3.D (Firmware Version = 601.3.D)

dev:9762026-12-29 14:59:04.509

info

[APC SmartUPS Status (Test Track)] serialNumber=AS0503222211 (UPS Serial Number = AS0503222211)

dev:9762026-12-29 14:59:04.506

info

[APC SmartUPS Status (Test Track)] model=Smart-UPS 1500 (UPS Model = Smart-UPS 1500)

dev:9762026-12-29 14:59:04.502

info

[APC SmartUPS Status (Test Track)] UPS outlet group support: False

dev:9762026-12-29 14:59:04.492

info

[APC SmartUPS Status (Test Track)] upsUptime=120 Days 1 Hour 37 Minutes (UPS Uptime = 120 Days 1 Hour 37 Minutes)

dev:9762026-12-29 14:59:04.483

info

[APC SmartUPS Status (Test Track)] upsDateTime=12/29/2025 2:59:01 PM (UPS Date/Time = 12/29/2025 2:59:01 PM)

dev:9762026-12-29 14:58:59.844

info

[APC SmartUPS Status (Test Track)] connectStatus=Connected

dev:9762026-12-29 14:58:59.231

info

[APC SmartUPS Status (Test Track)] connectStatus=Connecting

dev:9762026-12-29 14:58:59.228

info

[APC SmartUPS Status (Test Track)] Executing UPS command: Reconnoiter

dev:9762026-12-29 14:58:59.222

info

[APC SmartUPS Status (Test Track)] connectStatus=Initializing

dev:9762026-12-29 14:58:59.219

info

[APC SmartUPS Status (Test Track)] APC SmartUPS Status (Test Track) v1.0.1.5 (2025.12.29) refreshing...

dev:9762026-12-29 14:58:52.965

info

[APC SmartUPS Status (Test Track)] connectStatus=Disconnected

dev:9762026-12-29 14:58:49.769

info

[APC SmartUPS Status (Test Track)] connectStatus=Connected

dev:9762026-12-29 14:58:49.732

info

[APC SmartUPS Status (Test Track)] connectStatus=Connecting

dev:9762026-12-29 14:58:49.728

info

[APC SmartUPS Status (Test Track)] Executing UPS command: Reconnoiter

dev:9762026-12-29 14:58:49.726

info

[APC SmartUPS Status (Test Track)] connectStatus=Initializing

dev:9762026-12-29 14:58:49.723

info

[APC SmartUPS Status (Test Track)] APC SmartUPS Status (Test Track) v1.0.1.5 (2025.12.29) refreshing...

dev:9762026-12-29 14:58:48.736

info

[APC SmartUPS Status (Test Track)] connectStatus=Disconnected

dev:9762026-12-29 14:58:48.732

warn

[APC SmartUPS Status (Test Track)] resetTransientState(): Detected residual state keys (deferredCommand) during sendUPSCommand

dev:9762026-12-29 14:58:48.731

warn

[APC SmartUPS Status (Test Track)] sendUPSCommand(): repeated deferral detected for Reconnoiter; forcing full session reset

dev:9762026-12-29 14:58:48.729

info

[APC SmartUPS Status (Test Track)] Reconnoiter deferred 15s (Telnet busy with Reconnoiter)

dev:9762026-12-29 14:58:48.728

info

[APC SmartUPS Status (Test Track)] APC SmartUPS Status (Test Track) v1.0.1.5 (2025.12.29) refreshing...

dev:9762026-12-29 14:58:46.760

info

[APC SmartUPS Status (Test Track)] connectStatus=Connected

dev:9762026-12-29 14:58:46.519

info

[APC SmartUPS Status (Test Track)] connectStatus=Connecting

dev:9762026-12-29 14:58:46.516

info

[APC SmartUPS Status (Test Track)] Executing UPS command: Reconnoiter

dev:9762026-12-29 14:58:46.514

info

[APC SmartUPS Status (Test Track)] connectStatus=Initializing

dev:9762026-12-29 14:58:46.511

info

[APC SmartUPS Status (Test Track)] APC SmartUPS Status (Test Track) v1.0.1.5 (2025.12.29) refreshing...

dev:9762026-12-29 14:58:45.852

info

[APC SmartUPS Status (Test Track)] connectStatus=Disconnected

dev:9762026-12-29 14:58:44.199

info

[APC SmartUPS Status (Test Track)] Reconnoiter deferred 15s (Telnet busy with Reconnoiter)

dev:9762026-12-29 14:58:44.197

info

[APC SmartUPS Status (Test Track)] APC SmartUPS Status (Test Track) v1.0.1.5 (2025.12.29) refreshing...

dev:9762026-12-29 14:58:44.023

info

[APC SmartUPS Status (Test Track)] connectStatus=Connected

dev:9762026-12-29 14:58:43.993

info

[APC SmartUPS Status (Test Track)] Reconnoiter deferred 15s (Telnet busy with Reconnoiter)

dev:9762026-12-29 14:58:43.991

info

[APC SmartUPS Status (Test Track)] APC SmartUPS Status (Test Track) v1.0.1.5 (2025.12.29) refreshing...

dev:9762026-12-29 14:58:43.816

info

[APC SmartUPS Status (Test Track)] connectStatus=Connecting

dev:9762026-12-29 14:58:43.812

info

[APC SmartUPS Status (Test Track)] Executing UPS command: Reconnoiter

dev:9762026-12-29 14:58:43.811

info

[APC SmartUPS Status (Test Track)] connectStatus=Initializing

dev:9762026-12-29 14:58:43.807

info

[APC SmartUPS Status (Test Track)] APC SmartUPS Status (Test Track) v1.0.1.5 (2025.12.29) refreshing...

dev:9762026-12-29 14:58:43.633

info

[APC SmartUPS Status (Test Track)] connectStatus=Disconnected

dev:9762026-12-29 14:58:43.630

warn

[APC SmartUPS Status (Test Track)] resetTransientState(): Detected residual state keys (pendingCmds, deferredCommand) during sendUPSCommand

dev:9762026-12-29 14:58:43.628

warn

[APC SmartUPS Status (Test Track)] sendUPSCommand(): repeated deferral detected for Reconnoiter; forcing full session reset

dev:9762026-12-29 14:58:43.626

info

[APC SmartUPS Status (Test Track)] Reconnoiter deferred 15s (Telnet busy with Reconnoiter)

dev:9762026-12-29 14:58:43.625

info

[APC SmartUPS Status (Test Track)] APC SmartUPS Status (Test Track) v1.0.1.5 (2025.12.29) refreshing...

dev:9762026-12-29 14:58:43.524

info

[APC SmartUPS Status (Test Track)] connectStatus=Connected

dev:9762026-12-29 14:58:43.415

info

[APC SmartUPS Status (Test Track)] Reconnoiter deferred 15s (Telnet busy with Reconnoiter)

dev:9762026-12-29 14:58:43.414

info

[APC SmartUPS Status (Test Track)] APC SmartUPS Status (Test Track) v1.0.1.5 (2025.12.29) refreshing...

dev:9762026-12-29 14:58:43.238

info

[APC SmartUPS Status (Test Track)] connectStatus=Connecting

dev:9762026-12-29 14:58:43.235

info

[APC SmartUPS Status (Test Track)] Executing UPS command: Reconnoiter

dev:9762026-12-29 14:58:43.229

info

[APC SmartUPS Status (Test Track)] connectStatus=Initializing

dev:9762026-12-29 14:58:43.225

info

[APC SmartUPS Status (Test Track)] APC SmartUPS Status (Test Track) v1.0.1.5 (2025.12.29) refreshing...

dev:9762026-12-29 14:58:43.020

info

[APC SmartUPS Status (Test Track)] connectStatus=Disconnected

dev:9762026-12-29 14:58:43.016

warn

[APC SmartUPS Status (Test Track)] resetTransientState(): Detected residual state keys (deferredCommand) during sendUPSCommand

dev:9762026-12-29 14:58:43.014

warn

[APC SmartUPS Status (Test Track)] sendUPSCommand(): repeated deferral detected for Reconnoiter; forcing full session reset

dev:9762026-12-29 14:58:43.013

info

[APC SmartUPS Status (Test Track)] Reconnoiter deferred 15s (Telnet busy with Reconnoiter)

dev:9762026-12-29 14:58:43.011

info

[APC SmartUPS Status (Test Track)] APC SmartUPS Status (Test Track) v1.0.1.5 (2025.12.29) refreshing...

dev:9762026-12-29 14:58:42.829

info

[APC SmartUPS Status (Test Track)] Reconnoiter deferred 15s (Telnet busy with Reconnoiter)

dev:9762026-12-29 14:58:42.827

info

[APC SmartUPS Status (Test Track)] APC SmartUPS Status (Test Track) v1.0.1.5 (2025.12.29) refreshing...

dev:9762026-12-29 14:58:41.958

info

[APC SmartUPS Status (Test Track)] connectStatus=Connected

dev:9762026-12-29 14:58:41.735

info

[APC SmartUPS Status (Test Track)] Reconnoiter deferred 15s (Telnet busy with Reconnoiter)

dev:9762026-12-29 14:58:41.733

info

[APC SmartUPS Status (Test Track)] APC SmartUPS Status (Test Track) v1.0.1.5 (2025.12.29) refreshing...

dev:9762026-12-29 14:58:41.521

info

[APC SmartUPS Status (Test Track)] connectStatus=Connecting

dev:9762026-12-29 14:58:41.517

info

[APC SmartUPS Status (Test Track)] Executing UPS command: Reconnoiter

dev:9762026-12-29 14:58:41.509

info

[APC SmartUPS Status (Test Track)] connectStatus=Initializing

dev:9762026-12-29 14:58:41.505

info

[APC SmartUPS Status (Test Track)] APC SmartUPS Status (Test Track) v1.0.1.5 (2025.12.29) refreshing...

dev:9762026-12-29 14:58:41.414

info

[APC SmartUPS Status (Test Track)] connectStatus=Disconnected

dev:9762026-12-29 14:58:41.411

warn

[APC SmartUPS Status (Test Track)] resetTransientState(): Detected residual state keys (pendingCmds, deferredCommand) during sendUPSCommand

dev:9762026-12-29 14:58:41.409

warn

[APC SmartUPS Status (Test Track)] sendUPSCommand(): repeated deferral detected for Reconnoiter; forcing full session reset

dev:9762026-12-29 14:58:41.408

info

[APC SmartUPS Status (Test Track)] Reconnoiter deferred 15s (Telnet busy with Reconnoiter)

dev:9762026-12-29 14:58:41.406

info

[APC SmartUPS Status (Test Track)] APC SmartUPS Status (Test Track) v1.0.1.5 (2025.12.29) refreshing...

dev:9762026-12-29 14:58:40.250

info

[APC SmartUPS Status (Test Track)] Reconnoiter deferred 15s (Telnet busy with Reconnoiter)

dev:9762026-12-29 14:58:40.245

info

[APC SmartUPS Status (Test Track)] APC SmartUPS Status (Test Track) v1.0.1.5 (2025.12.29) refreshing...

dev:9762026-12-29 14:58:39.506

info

[APC SmartUPS Status (Test Track)] connectStatus=Connected

dev:9762026-12-29 14:58:39.476

info

[APC SmartUPS Status (Test Track)] connectStatus=Connecting

dev:9762026-12-29 14:58:39.473

info

[APC SmartUPS Status (Test Track)] Executing UPS command: Reconnoiter

dev:9762026-12-29 14:58:39.471

info

[APC SmartUPS Status (Test Track)] connectStatus=Initializing

dev:9762026-12-29 14:58:39.468

info

[APC SmartUPS Status (Test Track)] APC SmartUPS Status (Test Track) v1.0.1.5 (2025.12.29) refreshing...

dev:9762026-12-29 14:58:16.171

info

[APC SmartUPS Status (Test Track)] connectStatus=Disconnected

dev:9762026-12-29 14:58:14.044

info

[APC SmartUPS Status (Test Track)] connectStatus=Connected

dev:9762026-12-29 14:58:14.010

info

[APC SmartUPS Status (Test Track)] connectStatus=Connecting

dev:9762026-12-29 14:58:14.006

info

[APC SmartUPS Status (Test Track)] Executing UPS command: Reconnoiter

dev:9762026-12-29 14:58:14.005

info

[APC SmartUPS Status (Test Track)] lastCommandResult=Pending (Reconnoiter queued for execution)

dev:9762026-12-29 14:58:13.986

info

[APC SmartUPS Status (Test Track)] connectStatus=Initializing

dev:9762026-12-29 14:58:13.981

info

[APC SmartUPS Status (Test Track)] APC SmartUPS Status (Test Track) v1.0.1.5 (2025.12.29) refreshing...

dev:9762026-12-29 14:58:13.459

info

[APC SmartUPS Status (Test Track)] Monitoring scheduled every 5 minutes at 7 past the hour.

dev:9762026-12-29 14:58:13.410

info

[APC SmartUPS Status (Test Track)] upsControlEnabled=false (UPS Control Disabled)

dev:9762026-12-29 14:58:13.399

info

[APC SmartUPS Status (Test Track)] IP=192.168.10.32, Port=23

dev:9762026-12-29 14:58:13.397

info

[APC SmartUPS Status (Test Track)] driverInfo=APC SmartUPS Status (Test Track) v1.0.1.5 (2025.12.29)

dev:9762026-12-29 14:58:13.394

info

[APC SmartUPS Status (Test Track)] APC SmartUPS Status (Test Track) v1.0.1.5 (2025.12.29) initializing...

dev:9762026-12-29 14:58:13.392

info

[APC SmartUPS Status (Test Track)] Preferences updated

I pushed the update to Git and HPM.

As for the time issue...

The driver checks the time between the hub and the UPS each pass. You'll get a logWarn if they are off more than a minute from each other and a logError if the delta is more than 5 minutes.

I don't reset the clock, just report. Check for a “UPS clock skew” message in the logs.

If this is one UPS that got “stuck” that would explain the difference. It hasn't really logged in to the UPS.

Bad news....I purposely created an on-battery scenario with my misbehavin' UPS. It behaved as expected, but the UPS did not. Below are logs and events. Turns out the device had disconnected from HE earlier this morning, so the test was never going to work. Anyway, here's the output if it helps any....

Logs around the time period that the UPS stopped polling successfully

Events around the same time

have u tried my older driver to see if it works for your ups.

1 Like

@MHedish Marc, I tried the older driver by @kahn-hubitat and it is keeping my own misbehaving UPS current. Not sure why or how, but this (your) driver keeps losing its connection with the APC. Is there something I can do/provide to help with troubleshooting this?

1 Like

@mluck Mark, it's not "losing connection." The watchdog isn't fully resetting when it sees a session that leaves breadcrumbs.

Interestingly, I haven't had any issues since I updated that code the last time and, there it is, I just had the same issue come up earlier today on one of my four. :frowning: Karma?

Summary

dev:3912026-01-05 07:47:15.284warn[APC SmartUPS Status] resetTransientState(): Detected residual state keys (deferredCommand) during sendUPSCommand
dev:3912026-01-05 07:47:15.283warn[APC SmartUPS Status] sendUPSCommand(): repeated deferral detected for Reconnoiter; forcing full session reset
dev:3912026-01-05 07:47:15.281info[APC SmartUPS Status] Reconnoiter deferred 15s (Telnet busy with Reconnoiter)
dev:3912026-01-05 07:47:15.280info[APC SmartUPS Status] APC SmartUPS Status v1.0.1.5 (2025.12.29) refreshing...
dev:3912026-01-05 07:47:00.256info[APC SmartUPS Status] Reconnoiter deferred 15s (Telnet busy with Reconnoiter)
dev:3912026-01-05 07:47:00.254info[APC SmartUPS Status] APC SmartUPS Status v1.0.1.5 (2025.12.29) refreshing...
dev:3912026-01-05 07:42:15.276warn[APC SmartUPS Status] resetTransientState(): Detected residual state keys (deferredCommand) during sendUPSCommand
dev:3912026-01-05 07:42:15.274warn[APC SmartUPS Status] sendUPSCommand(): repeated deferral detected for Reconnoiter; forcing full session reset
dev:3912026-01-05 07:42:15.268info[APC SmartUPS Status] Reconnoiter deferred 15s (Telnet busy with Reconnoiter)
dev:3912026-01-05 07:42:15.265info[APC SmartUPS Status] APC SmartUPS Status v1.0.1.5 (2025.12.29) refreshing...
dev:3912026-01-05 07:42:00.237info[APC SmartUPS Status] Reconnoiter deferred 15s (Telnet busy with Reconnoiter)
dev:3912026-01-05 07:42:00.235info[APC SmartUPS Status] APC SmartUPS Status v1.0.1.5 (2025.12.29) refreshing...

I really thought I had that licked after your last report. I'll take a deeper dive into an RCA.

The whole idea of the watchdog was to do a full reset if we didn't complete cleanly.

One of the major architectural differences between the drivers is that the old one doesn't try to close out the telnet session. It's that flag I'm tripping over. When you're not looking to close the telnet session, it just times out and when the next scheduled pass comes, there's nothing warning it to not start another one because it's busy. That's why the older one doesn't get hung up.

I have an idea. :bulb:

actually it sends a quit command which if you try it via telent the ups closes the telnet connection immediatly on receiving the command..

the bug is in hubitat not expecting a telnet connetion to close that way.. which is a bug since many systems do that.

ie

even though in this case hubitat gives the warning message i have found like you are seeing if you instead of issueing the quit and just force close the connection on the ups without issueing quit it eventually stops answerting to new session in certain cases/firmwares?

I'm honestly trying to understand what you mean there.

I never issue a quit, bye, or exit in my driver, so I don't understand what that screenshot is trying to tell us. I've not seen any issues with closing out the telnet session (errors or warnings) the way I'm handling it. I never see “telnetStatus: receive error: Stream is closed” or “[warn] telnet input stream closed” in the logs or events. In the past four months (since I began the project), I've not had a UPS fail to connect to a telnet request.

The issue I'm working through is in my watchdog code. It has nothing to do with the telnet session itself. That's never been a problem. I believe the issue is related to the lazy-right of state variables. I'm reworking the watchdog to not use a state variable. The original idea to use a state variable to track the reconnoiter was to be able to track a session across a reboot (since we have cron jobs that could be running when a hub is rebooted.


Here's why I said:

I see two places you have quit in your v4.5 driver and no instance of bye or exit.

The quit here is checking lastCommand (not sending to the UPS); instead, if it sees a command quit it calls closeConnection():

Quit
      sendEvent(name: "lastCommand", value: "getStatus")     
	        def sndMsg =[
	        		"$Username"
	        		, "$Password"
	        	    , "detstatus -rt"
                    , "detstatus -ss"
                    , "detstatus -soc"
                    , "detstatus -all"
                    , "detstatus -tmp"
                    , "upsabout"
                   
	            ]  
             def res1 = seqSend(sndMsg,500)
         }     
   
       else if (lastCommand == "quit")//  , "quit"
        { 
            sendEvent(name: "lastCommand", value: "Rescheduled")
            if (state.nextRunTime == "Unknown") log.info "Will run again in $state.currentCheckTime Minutes!"
            state.nextRunTime = state.currentCheckTime
            closeConnection()
            sendEvent([name: "telnet", value: "Ok"])
           } 
   

The second time is here. This “quit” would be sent to the NMC provide the UPS was sending back a data pair of “Battery” and “SKU:” This conflicts with your changelog:

  • v 3.5 cannot do quit at end of battery and cannot include in initial string as the libraries now close the telnet immediately
Battery/SKU
               else if ((p0 == "Battery") && (p1 == "SKU:"))
               {
                     sendEvent(name: "batteryType", value: p2)
                     if (getloglevel() > 0) log.debug "Got Battery Type: $p2"
                   
                   sendEvent(name: "lastCommand", value: "quit")  
                   def res1 = sendData("quit",500)
                   
               }

Smaller UPSs don't report battery and battery SKU (at least my four don't: APC 1400x2, APC 1500x2), so when I was using your driver, it would never sent that command to the telnet session.

You have a closeConnection() method that is called from multiple sections of your code. (That's a good thing.) The problem is that method, as implemented, doesn't work.

def closeConnection()
{
    if (closeTelnet){
        try {
            telnetClose()
        } catch(e) {
            if (getloglevel() > 1) log.debug("Connection Closed")
        }
    }
}

:rotating_light: The Issue

  1. closeTelnet is never defined anywhere in the driver —
    not as:
  • a local variable (def closeTelnet)
  • a parameter (closeConnection(closeTelnet)),
  • a state variable (state.closeTelnet),
  • or a global constant.
  1. In Groovy, referencing an undefined variable that isn’t declared throws a MissingPropertyException at runtime unless the compiler is operating in dynamic context (which Hubitat does for device handlers).
  2. In Hubitat’s Groovy environment:
  • An undefined variable evaluates to null.
  • if (null)evaluates to false.

:white_check_mark: Therefore, the if (closeTelnet) condition will always fail.


:abacus: Behavior in Practice

Since closeTelnet is never truthy:

  • telnetClose() is never called.
  • The catch(e) block never executes (because try never runs).
  • So the log "Connection Closed" will never actually appear — unless this code gets accidentally triggered by a Groovy scoping quirk (see below).

However, if a higher scope or parent script (e.g., the Hubitat runtime) happens to have a variable named closeTelnet (from another driver, or leftover state binding — unlikely but possible), it could become truthy and log “Connection Closed” without ever closing the socket, because that string appears only in the catch, not after telnetClose() succeeds.

So effectively, this method:

“Never closes the connection, and never logs anything under normal circumstances.”


:toolbox: Correct Implementation

To fix it, the intent is almost certainly to always close Telnet, not conditionally.
The corrected, robust form should be:

def closeConnection() {
    try {
        telnetClose()
        if (getloglevel() > 1) log.debug "Telnet connection closed successfully."
    } catch (e) {
        if (getloglevel() > 1) log.debug "Telnet already closed or error: ${e.message}"
    }
}

Or, if the author intended a guard variable (like a “safe close” flag):

def closeConnection(Boolean safeClose = true) {
    if (!safeClose) return
    try {
        telnetClose()
        if (getloglevel() > 1) log.debug "Telnet closed (safe mode)"
    } catch (e) {
        if (getloglevel() > 1) log.debug "Telnet already closed or error: ${e.message}"
    }
}

:receipt: Summary

Behavior Outcome
closeTelnet undefined Always false → telnetClose() never executes
Result Telnet connection never actually closes
Logging “Connection Closed” never emitted unless an unrelated variable named closeTelnet leaks in
Fix Remove condition or add explicit boolean parameter

:white_check_mark: Verdict:
As written, that function is effectively a no-op under all normal runtime conditions.

[UPDATE]

I just pushed 1.0.2.2 to HPM and Git. This should resolve the watchdog recovery issue. (At least I hope so.) :wink:

I moved the session flags from state variables to atomicState variables which eliminates the lazy writes of state variables. From what I can tell, the watchdog was resetting the flags but was then reading them back before the write happened, so it never recognized the reset.

Also, while working on the update, I discovered an error in checkUPSClock() and resolved that so the clock sync should be at 100% now.

Notes:

1.0.2.0 — Watchdog Refinement

  • Improved session watchdog logic for faster recovery from hung Telnet sessions.
  • Hardened finalization process and synchronization timing between transient cleanup and deferred retries.

1.0.2.1 — Deferred Command Handling and Clock Validation Fix

  • Introduced residual transient detection to prevent recursive reconnoiter loops.
  • Resolved checkUPSClock() exception caused by invalid reference object type.

1.0.2.2 — Stable Core Release

  • Hybrid state / atomicState lifecycle separation for precise session control.
  • Eliminated watchdog recursion and deferredCommand residue.

It's been working for two weeks solid on four instances for me. Here's a log snippet from an intentional overload and forcing a busy condition (pounding on the [Refresh] command):

Log

2026-01-11 13:45:46.182 info [APC SmartUPS Status] connectStatus=Disconnected
2026-01-11 13:45:46.171 info [APC SmartUPS Status] lastCommandResult=Complete (Reconnoiter completed normally)
2026-01-11 13:45:46.154 info [APC SmartUPS Status] connectStatus=Disconnecting
2026-01-11 13:45:46.150 info [APC SmartUPS Status] lastUpdate=01/11/2026 1:45:46 PM (Data Capture Run Time = 4.724s)
2026-01-11 13:45:46.142 info [APC SmartUPS Status] lastSelfTestDate=01/06/2026 (UPS Last Self-Test Date = 01/06/2026)
2026-01-11 13:45:46.135 info [APC SmartUPS Status] lastSelfTestResult=Passed (UPS Last Self Test Result = Passed)
2026-01-11 13:45:46.116 info [APC SmartUPS Status] Battery run time recovered above 4 minutes (126 remaining)
2026-01-11 13:45:46.114 info [APC SmartUPS Status] UPS Run Time Remaining = 02:06
2026-01-11 13:45:46.107 info [APC SmartUPS Status] Monitoring scheduled every 5 minutes at 32 past the hour.
2026-01-11 13:45:46.021 info [APC SmartUPS Status] nmcUptime=133 Days 0 Hours 23 Minutes (NMC Uptime = 133 Days 0 Hours 23 Minutes)
2026-01-11 13:45:46.009 info [APC SmartUPS Status] manufactureDate=01/13/2005 (UPS Manufacture Date = 01/13/2005)
2026-01-11 13:45:46.004 info [APC SmartUPS Status] firmwareVersion=601.3.D (Firmware Version = 601.3.D)
2026-01-11 13:45:46.000 info [APC SmartUPS Status] serialNumber=* REDACTED * (UPS Serial Number = * REDACTED *)
2026-01-11 13:45:45.997 info [APC SmartUPS Status] model=Smart-UPS 1500 (UPS Model = Smart-UPS 1500)
2026-01-11 13:45:45.993 info [APC SmartUPS Status] UPS outlet group support: False
2026-01-11 13:45:45.978 info [APC SmartUPS Status] upsUptime=133 Days 0 Hours 23 Minutes (UPS Uptime = 133 Days 0 Hours 23 Minutes)
2026-01-11 13:45:45.969 info [APC SmartUPS Status] upsDateTime=01/11/2026 1:45:40 PM (UPS Date/Time = 01/11/2026 1:45:40 PM)
2026-01-11 13:45:40.853 info [APC SmartUPS Status] connectStatus=Connected
2026-01-11 13:45:40.816 info [APC SmartUPS Status] connectStatus=Connecting
2026-01-11 13:45:40.812 info [APC SmartUPS Status] Executing UPS command: Reconnoiter
2026-01-11 13:45:40.810 info [APC SmartUPS Status] connectStatus=Initializing
2026-01-11 13:45:40.804 info [APC SmartUPS Status] APC SmartUPS Status v1.0.2.2 (2026.01.11) refreshing...
2026-01-11 13:45:26.461 info [APC SmartUPS Status] connectStatus=Disconnected
2026-01-11 13:45:22.656 info [APC SmartUPS Status] connectStatus=Connected
2026-01-11 13:45:22.626 info [APC SmartUPS Status] connectStatus=Connecting
2026-01-11 13:45:22.624 info [APC SmartUPS Status] Executing UPS command: Reconnoiter
2026-01-11 13:45:22.619 info [APC SmartUPS Status] lastCommandResult=Pending (Reconnoiter queued for execution)
2026-01-11 13:45:22.615 info [APC SmartUPS Status] connectStatus=Initializing
2026-01-11 13:45:22.609 info [APC SmartUPS Status] APC SmartUPS Status v1.0.2.2 (2026.01.11) refreshing...
2026-01-11 13:45:15.738 info [APC SmartUPS Status] connectStatus=Disconnected
2026-01-11 13:45:15.715 info [APC SmartUPS Status] lastCommandResult=Failed (Reconnoiter watchdog-triggered recovery)
2026-01-11 13:45:15.710 warn [APC SmartUPS Status] checkSessionTimeout(): Reconnoiter still Connected after 10008ms — assuming hung session; forcing cleanup
2026-01-11 13:45:07.585 info [APC SmartUPS Status] Reconnoiter deferred 15s (Telnet busy with Reconnoiter)
2026-01-11 13:45:07.581 info [APC SmartUPS Status] APC SmartUPS Status v1.0.2.2 (2026.01.11) refreshing...
2026-01-11 13:45:05.715 info [APC SmartUPS Status] connectStatus=Connected
2026-01-11 13:45:05.672 info [APC SmartUPS Status] connectStatus=Connecting
2026-01-11 13:45:05.669 info [APC SmartUPS Status] Executing UPS command: Reconnoiter
2026-01-11 13:45:05.667 info [APC SmartUPS Status] connectStatus=Initializing
2026-01-11 13:45:05.653 info [APC SmartUPS Status] APC SmartUPS Status v1.0.2.2 (2026.01.11) refreshing...
2026-01-11 13:45:05.525 info [APC SmartUPS Status] connectStatus=Disconnected
2026-01-11 13:45:05.518 2026-01-11 13:45:46.182 info [APC SmartUPS Status] connectStatus=Disconnected
2026-01-11 13:45:46.171 info [APC SmartUPS Status] lastCommandResult=Complete (Reconnoiter completed normally)
2026-01-11 13:45:46.154 info [APC SmartUPS Status] connectStatus=Disconnecting
2026-01-11 13:45:46.150 info [APC SmartUPS Status] lastUpdate=01/11/2026 1:45:46 PM (Data Capture Run Time = 4.724s)
2026-01-11 13:45:46.142 info [APC SmartUPS Status] lastSelfTestDate=01/06/2026 (UPS Last Self-Test Date = 01/06/2026)
2026-01-11 13:45:46.135 info [APC SmartUPS Status] lastSelfTestResult=Passed (UPS Last Self Test Result = Passed)
2026-01-11 13:45:46.116 info [APC SmartUPS Status] Battery run time recovered above 4 minutes (126 remaining)
2026-01-11 13:45:46.114 info [APC SmartUPS Status] UPS Run Time Remaining = 02:06
2026-01-11 13:45:46.107 info [APC SmartUPS Status] Monitoring scheduled every 5 minutes at 32 past the hour.
2026-01-11 13:45:46.021 info [APC SmartUPS Status] nmcUptime=133 Days 0 Hours 23 Minutes (NMC Uptime = 133 Days 0 Hours 23 Minutes)
2026-01-11 13:45:46.009 info [APC SmartUPS Status] manufactureDate=01/13/2005 (UPS Manufacture Date = 01/13/2005)
2026-01-11 13:45:46.004 info [APC SmartUPS Status] firmwareVersion=601.3.D (Firmware Version = 601.3.D)
2026-01-11 13:45:46.000 info [APC SmartUPS Status] serialNumber=REDACTED (UPS Serial Number = REDACTED)
2026-01-11 13:45:45.997 info [APC SmartUPS Status] model=Smart-UPS 1500 (UPS Model = Smart-UPS 1500)
2026-01-11 13:45:45.993 info [APC SmartUPS Status] UPS outlet group support: False
2026-01-11 13:45:45.978 info [APC SmartUPS Status] upsUptime=133 Days 0 Hours 23 Minutes (UPS Uptime = 133 Days 0 Hours 23 Minutes)
2026-01-11 13:45:45.969 info [APC SmartUPS Status] upsDateTime=01/11/2026 1:45:40 PM (UPS Date/Time = 01/11/2026 1:45:40 PM)
2026-01-11 13:45:40.853 info [APC SmartUPS Status] connectStatus=Connected
2026-01-11 13:45:40.816 info [APC SmartUPS Status] connectStatus=Connecting
2026-01-11 13:45:40.812 info [APC SmartUPS Status] Executing UPS command: Reconnoiter
2026-01-11 13:45:40.810 info [APC SmartUPS Status] connectStatus=Initializing
2026-01-11 13:45:40.804 info [APC SmartUPS Status] APC SmartUPS Status v1.0.2.2 (2026.01.11) refreshing...
2026-01-11 13:45:26.461 info [APC SmartUPS Status] connectStatus=Disconnected
2026-01-11 13:45:22.656 info [APC SmartUPS Status] connectStatus=Connected
2026-01-11 13:45:22.626 info [APC SmartUPS Status] connectStatus=Connecting
2026-01-11 13:45:22.624 info [APC SmartUPS Status] Executing UPS command: Reconnoiter
2026-01-11 13:45:22.619 info [APC SmartUPS Status] lastCommandResult=Pending (Reconnoiter queued for execution)
2026-01-11 13:45:22.615 info [APC SmartUPS Status] connectStatus=Initializing
2026-01-11 13:45:22.609 info [APC SmartUPS Status] APC SmartUPS Status v1.0.2.2 (2026.01.11) refreshing...
2026-01-11 13:45:15.738 info [APC SmartUPS Status] connectStatus=Disconnected
2026-01-11 13:45:15.715 info [APC SmartUPS Status] lastCommandResult=Failed (Reconnoiter watchdog-triggered recovery)
2026-01-11 13:45:15.710 warn [APC SmartUPS Status] checkSessionTimeout(): Reconnoiter still Connected after 10008ms — assuming hung session; forcing cleanup
2026-01-11 13:45:07.585 info [APC SmartUPS Status] Reconnoiter deferred 15s (Telnet busy with Reconnoiter)
2026-01-11 13:45:07.581 info [APC SmartUPS Status] APC SmartUPS Status v1.0.2.2 (2026.01.11) refreshing...
2026-01-11 13:45:05.715 info [APC SmartUPS Status] connectStatus=Connected
2026-01-11 13:45:05.672 info [APC SmartUPS Status] connectStatus=Connecting
2026-01-11 13:45:05.669 info [APC SmartUPS Status] Executing UPS command: Reconnoiter
2026-01-11 13:45:05.667 info [APC SmartUPS Status] connectStatus=Initializing
2026-01-11 13:45:05.653 info [APC SmartUPS Status] APC SmartUPS Status v1.0.2.2 (2026.01.11) refreshing...
2026-01-11 13:45:05.525 info [APC SmartUPS Status] connectStatus=Disconnected
2026-01-11 13:45:05.518 warn [APC SmartUPS Status] resetTransientState(): Detected residual state keys (pendingCmds, deferredCommand, whoamiAckSeen) during sendUPSCommand
2026-01-11 13:45:05.514 warn [APC SmartUPS Status] sendUPSCommand(): repeated deferral detected for Reconnoiter; forcing full session reset
2026-01-11 13:45:05.510 info [APC SmartUPS Status] Reconnoiter deferred 15s (Telnet busy with Reconnoiter)
2026-01-11 13:45:05.504 info [APC SmartUPS Status] APC SmartUPS Status v1.0.2.2 (2026.01.11) refreshing...
2026-01-11 13:45:05.290 info [APC SmartUPS Status] Reconnoiter deferred 15s (Telnet busy with Reconnoiter)
2026-01-11 13:45:05.286 info [APC SmartUPS Status] APC SmartUPS Status v1.0.2.2 (2026.01.11) refreshing...
2026-01-11 13:45:05.144 info [APC SmartUPS Status] Reconnoiter deferred 15s (Telnet busy with Reconnoiter)
2026-01-11 13:45:05.142 info [APC SmartUPS Status] APC SmartUPS Status v1.0.2.2 (2026.01.11) refreshing...
2026-01-11 13:45:04.937 info [APC SmartUPS Status] Reconnoiter deferred 15s (Telnet busy with Reconnoiter)
2026-01-11 13:45:04.934 info [APC SmartUPS Status] APC SmartUPS Status v1.0.2.2 (2026.01.11) refreshing...
2026-01-11 13:45:04.770 info [APC SmartUPS Status] Reconnoiter deferred 15s (Telnet busy with Reconnoiter)
2026-01-11 13:45:04.767 info [APC SmartUPS Status] APC SmartUPS Status v1.0.2.2 (2026.01.11) refreshing...
2026-01-11 13:45:04.570 info [APC SmartUPS Status] Reconnoiter deferred 15s (Telnet busy with Reconnoiter)
2026-01-11 13:45:04.567 info [APC SmartUPS Status] APC SmartUPS Status v1.0.2.2 (2026.01.11) refreshing...
2026-01-11 13:45:03.981 info [APC SmartUPS Status] Reconnoiter deferred 15s (Telnet busy with Reconnoiter)
2026-01-11 13:45:03.979 info [APC SmartUPS Status] APC SmartUPS Status v1.0.2.2 (2026.01.11) refreshing...
2026-01-11 13:45:03.748 info [APC SmartUPS Status] Reconnoiter deferred 15s (Telnet busy with Reconnoiter)
2026-01-11 13:45:03.744 info [APC SmartUPS Status] APC SmartUPS Status v1.0.2.2 (2026.01.11) refreshing...
2026-01-11 13:45:01.823 info [APC SmartUPS Status] Reconnoiter deferred 15s (Telnet busy with Reconnoiter)
2026-01-11 13:45:01.818 info [APC SmartUPS Status] APC SmartUPS Status v1.0.2.2 (2026.01.11) refreshing...
2026-01-11 13:45:00.533 info [APC SmartUPS Status] connectStatus=Connected
2026-01-11 13:45:00.486 info [APC SmartUPS Status] connectStatus=Connecting
2026-01-11 13:45:00.484 info [APC SmartUPS Status] Executing UPS command: Reconnoiter
2026-01-11 13:45:00.482 info [APC SmartUPS Status] lastCommandResult=Pending (Reconnoiter queued for execution)
2026-01-11 13:45:00.474 info [APC SmartUPS Status] connectStatus=Initializing
2026-01-11 13:45:00.468 info [APC SmartUPS Status] APC SmartUPS Status v1.0.2.2 (2026.01.11) refreshing... [APC SmartUPS Status] resetTransientState(): Detected residual state keys (pendingCmds, deferredCommand, whoamiAckSeen) during sendUPSCommand
2026-01-11 13:45:05.514 warn [APC SmartUPS Status] sendUPSCommand(): repeated deferral detected for Reconnoiter; forcing full session reset
2026-01-11 13:45:05.510 info [APC SmartUPS Status] Reconnoiter deferred 15s (Telnet busy with Reconnoiter)
2026-01-11 13:45:05.504 info [APC SmartUPS Status] APC SmartUPS Status v1.0.2.2 (2026.01.11) refreshing...
2026-01-11 13:45:05.290 info [APC SmartUPS Status] Reconnoiter deferred 15s (Telnet busy with Reconnoiter)
2026-01-11 13:45:05.286 info [APC SmartUPS Status] APC SmartUPS Status v1.0.2.2 (2026.01.11) refreshing...
2026-01-11 13:45:05.144 info [APC SmartUPS Status] Reconnoiter deferred 15s (Telnet busy with Reconnoiter)
2026-01-11 13:45:05.142 info [APC SmartUPS Status] APC SmartUPS Status v1.0.2.2 (2026.01.11) refreshing...
2026-01-11 13:45:04.937 info [APC SmartUPS Status] Reconnoiter deferred 15s (Telnet busy with Reconnoiter)
2026-01-11 13:45:04.934 info [APC SmartUPS Status] APC SmartUPS Status v1.0.2.2 (2026.01.11) refreshing...
2026-01-11 13:45:04.770 info [APC SmartUPS Status] Reconnoiter deferred 15s (Telnet busy with Reconnoiter)
2026-01-11 13:45:04.767 info [APC SmartUPS Status] APC SmartUPS Status v1.0.2.2 (2026.01.11) refreshing...
2026-01-11 13:45:04.570 info [APC SmartUPS Status] Reconnoiter deferred 15s (Telnet busy with Reconnoiter)
2026-01-11 13:45:04.567 info [APC SmartUPS Status] APC SmartUPS Status v1.0.2.2 (2026.01.11) refreshing...
2026-01-11 13:45:03.981 info [APC SmartUPS Status] Reconnoiter deferred 15s (Telnet busy with Reconnoiter)
2026-01-11 13:45:03.979 info [APC SmartUPS Status] APC SmartUPS Status v1.0.2.2 (2026.01.11) refreshing...
2026-01-11 13:45:03.748 info [APC SmartUPS Status] Reconnoiter deferred 15s (Telnet busy with Reconnoiter)
2026-01-11 13:45:03.744 info [APC SmartUPS Status] APC SmartUPS Status v1.0.2.2 (2026.01.11) refreshing...
2026-01-11 13:45:01.823 info [APC SmartUPS Status] Reconnoiter deferred 15s (Telnet busy with Reconnoiter)
2026-01-11 13:45:01.818 info [APC SmartUPS Status] APC SmartUPS Status v1.0.2.2 (2026.01.11) refreshing...
2026-01-11 13:45:00.533 info [APC SmartUPS Status] connectStatus=Connected
2026-01-11 13:45:00.486 info [APC SmartUPS Status] connectStatus=Connecting
2026-01-11 13:45:00.484 info [APC SmartUPS Status] Executing UPS command: Reconnoiter
2026-01-11 13:45:00.482 info [APC SmartUPS Status] lastCommandResult=Pending (Reconnoiter queued for execution)
2026-01-11 13:45:00.474 info [APC SmartUPS Status] connectStatus=Initializing
2026-01-11 13:45:00.468 info [APC SmartUPS Status] APC SmartUPS Status v1.0.2.2 (2026.01.11) refreshing...

You'll see the forced cleanup and recovery.

Have at it @mluck! :wink:

1 Like

Thanks Marc -- I got my units updated with your driver and will monitor over the next few days. Appreciate the continued cleanup and versioning!


EDIT: Thanks to @MHedish, this driver now has a built-in watchdog feature, so this unwieldy rule that I shared below is not necessary. I encourage folks to look a message down in this thread for a much simpler approach. Unless of course you enjoy manipulating datetime strings just for fun :wink:


Just a quick update for others that are following. This driver works great on my six APC SmartUPS boxes. I simulated several power outages and the driver responded exactly as expected. Thanks to @MHedish for all the refinements.

The one thing the driver doesn't have is a healthStatus indicator that gives me confidence that the driver is still continuously and successfully polling the UPS. Personally I like to have some kind of watchdog that warns me when my key devices go offline.

The good news is that the driver does have a lastUpdate time from the UPS. Unfortunately it's a raw string that isn't readable into an RM DateTime variable. So I created a rule to manipulate the raw string, manipulate it into a string that the RM5 Time String function can read, and then evaluate whether it's been too long since the driver connected to the UPS.

_

Here's the rule. You should (1) set your time difference to GMT in hours in the second row; (2) change the notification in the second to last row to whatever your want; and (3) swap out my device for yours in the 8th row. In addition, you may want to change the trigger to be what you want. I just picked 8-10 times each day to check. Not the kind of thing that needs to run every five minutes.

_

Create these local variables

If you'd prefer to get the RM file to import directly, feel free to DM me.

1 Like

Version 1.0.3.0 is now available in HPM and Git.

I finally nailed the issue that could cause the driver to not recover from a reboot and enter an infinite loop. That was an interesting little gremlin.

To go along with @mluck's check watchdog, I built one in. It's a separate method that is set to check one minute after each Telnet session. If it doesn't see a new report from the UPS, connectStatus is set to 'Watchdog'

You can set a rule or piston to look for connectStatus==Watchdog and send a notification or take any action you want.

I pulled the network cable from one of my UPSs and watched the connectStatus get triggered. Plugged the cable back in, and the next Telnet attempt went right back to normal.

1 Like

Marc, does the value of connectStatus remain "Watchdog" until the driver successfully reconnects or could there be other states? I'm asking because I typically like to trigger a second "all clear" message once the trouble has passed. Trying to figure out what I could trigger that message on...thx

That field will always show the current state; it’s a live attribute. It will cycle back the connect process and then end up with Watchdog again if it still can't connect.

A “normal” run for connectStatus is:

  • Initializing
  • Connecting
  • Connected
  • Disconnect

The watchdog process happens one minute after the scheduled reconnoiter. If lastUpdate hasn’t changed for two attempts, connectStatus is set to 'Watchdog' -- that's the alarm.

Here's a real world example:

I pulled the network cable from the back of the UPS. You can follow the alerts and status in these two:

Log

2026-02-09 16:14:21.195info[APC SmartUPS Status (Test Track) Online | 01:51 | 10.9% | 90.3°
2026-02-09 16:14:20.584info[APC SmartUPS Status (Test Track) Online | 01:51 | 10.9% | 90.3°
2026-02-09 16:14:20.436warn[APC SmartUPS Status (Test Track)] sendUPSCommand(): Reconnoiter deferred 3 times; forcing initialization
2026-02-09 16:14:10.458info[APC SmartUPS Status (Test Track) Online | 01:51 | 10.9% | 90.3°
2026-02-09 16:14:00.443info[APC SmartUPS Status (Test Track) Online | 01:51 | 10.9% | 90.3°
2026-02-09 16:09:47.113error[APC SmartUPS Status (Test Track)] safeTelnetConnect(): All 3 attempts failed (No route to host (Host unreachable))
2026-02-09 16:09:47.111warn[APC SmartUPS Status (Test Track)] safeTelnetConnect(): No route to host (Host unreachable) ? max retries reached
2026-02-09 16:09:34.061warn[APC SmartUPS Status (Test Track)] checkSessionTimeout(): Reconnoiter still Connecting after 13124ms — forcing cleanup
2026-02-09 16:09:24.115info[APC SmartUPS Status (Test Track) Online | 01:51 | 10.9% | 90.3°
2026-02-09 16:09:24.007warn[APC SmartUPS Status (Test Track)] safeTelnetConnect(): No route to host (Host unreachable) ? retrying in 10s (attempt 1/3)
2026-02-09 16:09:20.457info[APC SmartUPS Status (Test Track) Online | 01:51 | 10.9% | 90.3°
2026-02-09 16:09:20.262warn[APC SmartUPS Status (Test Track)] sendUPSCommand(): Reconnoiter deferred 3 times; forcing initialization
2026-02-09 16:09:10.284info[APC SmartUPS Status (Test Track) Online | 01:51 | 10.9% | 90.3°
2026-02-09 16:09:00.267info[APC SmartUPS Status (Test Track) Online | 01:51 | 10.9% | 90.3°
2026-02-09 16:04:39.561error[APC SmartUPS Status (Test Track)] safeTelnetConnect(): All 3 attempts failed (No route to host (Host unreachable))
2026-02-09 16:04:39.559warn[APC SmartUPS Status (Test Track)] safeTelnetConnect(): No route to host (Host unreachable) ? max retries reached
2026-02-09 16:04:26.471warn[APC SmartUPS Status (Test Track)] safeTelnetConnect(): No route to host (Host unreachable) ? retrying in 10s (attempt 2/3)
2026-02-09 16:04:13.498warn[APC SmartUPS Status (Test Track)] checkSessionTimeout(): Reconnoiter still Connecting after 13193ms — forcing cleanup
2026-02-09 16:04:03.467info[APC SmartUPS Status (Test Track) Online | 01:51 | 10.9% | 90.3°
2026-02-09 16:04:03.368warn[APC SmartUPS Status (Test Track)] safeTelnetConnect(): No route to host (Host unreachable) ? retrying in 10s (attempt 1/3)
2026-02-09 15:59:26.494error[APC SmartUPS Status (Test Track)] safeTelnetConnect(): All 3 attempts failed (No route to host (Host unreachable))
2026-02-09 15:59:26.492warn[APC SmartUPS Status (Test Track)] safeTelnetConnect(): No route to host (Host unreachable) ? max retries reached
2026-02-09 15:59:13.419warn[APC SmartUPS Status (Test Track)] checkSessionTimeout(): Reconnoiter still Connecting after 13124ms — forcing cleanup
2026-02-09 15:59:03.469info[APC SmartUPS Status (Test Track) Online | 01:51 | 10.9% | 90.3°
2026-02-09 15:59:03.368warn[APC SmartUPS Status (Test Track)] safeTelnetConnect(): No route to host (Host unreachable) ? retrying in 10s (attempt 1/3)
2026-02-09 15:54:41.961error[APC SmartUPS Status (Test Track)] safeTelnetConnect(): All 3 attempts failed (No route to host (Host unreachable))
2026-02-09 15:54:41.959warn[APC SmartUPS Status (Test Track)] safeTelnetConnect(): No route to host (Host unreachable) ? max retries reached
2026-02-09 15:54:28.915warn[APC SmartUPS Status (Test Track)] checkSessionTimeout(): Reconnoiter still Connecting after 28539ms — forcing cleanup
2026-02-09 15:54:18.978info[APC SmartUPS Status (Test Track) Online | 01:51 | 10.9% | 90.3°
2026-02-09 15:54:18.856warn[APC SmartUPS Status (Test Track)] safeTelnetConnect(): No route to host (Host unreachable) ? retrying in 10s (attempt 1/3)
2026-02-09 15:51:05.841info[APC SmartUPS Status (Test Track) Online | 01:51 | 11.4% | 90.3°
2026-02-09 15:49:00.500info[APC SmartUPS Status (Test Track) Online | 01:51 | 10.9% | 90.3°

Events
Name Value Unit Description Date/Time
connectStatus Disconnected 2/9/2026 16:14:26.5
lastCommandResult Complete Reconnoiter completed normally 2/9/2026 16:14:26.4
lastUpdate 2/9/2026 16:14:26.0 Data Capture Run Time = 4.749s 2/9/2026 16:14:26.4
inputVoltage 117 VAC Input Voltage = 117.0 VAC 2/9/2026 16:14:26.4
outputWattsPercent 9.8 % Output Watts = 9.8% 2/9/2026 16:14:26.4
outputVoltage 117 VAC Output Voltage = 117.0 VAC 2/9/2026 16:14:26.4
runTimeMinutes 47 min UPS Run Time Remaining = 01:47 2/9/2026 16:14:26.4
nmcUptime 0 Days 0 Hours 11 Minutes NMC Uptime = 0 Days 0 Hours 11 Minutes 2/9/2026 16:14:26.3
upsUptime 0 Days 0 Hours 11 Minutes UPS Uptime = 0 Days 0 Hours 11 Minutes 2/9/2026 16:14:26.2
upsDateTime 2/9/2026 16:14:21.0 UPS Date/Time = 02/09/2026 4:14:21 PM 2/9/2026 16:14:26.2
connectStatus Connecting 2/9/2026 16:14:21.1
connectStatus Connected 2/9/2026 16:14:21.1
lastCommandResult Pending Reconnoiter queued for execution 2/9/2026 16:14:21.1
connectStatus Initializing 2/9/2026 16:14:21.1
connectStatus Disconnected 2/9/2026 16:14:20.5
upsControlEnabled FALSE UPS Control Disabled 2/9/2026 16:14:20.5
connectStatus Watchdog No UPS update for 18 minutes 2/9/2026 16:10:00.4
connectStatus Disconnected 2/9/2026 16:09:34.1
lastCommandResult Failed Reconnoiter watchdog-triggered recovery 2/9/2026 16:09:34.1
connectStatus Connecting 2/9/2026 16:09:20.9
lastCommandResult Pending Reconnoiter queued for execution 2/9/2026 16:09:20.9
connectStatus Initializing 2/9/2026 16:09:20.9
connectStatus Disconnected 2/9/2026 16:09:20.4
upsControlEnabled FALSE UPS Control Disabled 2/9/2026 16:09:20.3
connectStatus Watchdog No UPS update for 13 minutes 2/9/2026 16:05:00.4
lastCommandResult Failed Reconnoiter watchdog-triggered recovery 2/9/2026 16:04:13.5
lastCommandResult Pending Reconnoiter queued for execution 2/9/2026 16:04:00.3
lastCommandResult Failed Reconnoiter watchdog-triggered recovery 2/9/2026 15:59:13.4
lastCommandResult Pending Reconnoiter queued for execution 2/9/2026 15:59:00.3
lastCommandResult Failed Reconnoiter watchdog-triggered recovery 2/9/2026 15:54:28.9
summaryText Online | 01:51 | 10.9% | 90.3° 2/9/2026 15:54:19.0
lastCommandResult Pending Reconnoiter queued for execution 2/9/2026 15:54:00.3

After we get connectStatus==Watchdog, the "all clear" is the first connectStatus==Connected

If you want the belt and braces version:

(lastCommandResult==Complete&&connectStatus==Disconnected)

You could set your alerts to fire each time it sees 'Watchdog" so you get repeated notifications or just do it the first time and don't send a notification again until you get the 'all clear.'

1 Like