NUT was working, now get connection error when I try to add server back in

Hi,

I am relatively new to HA, but have had it running for several months. I recently built an ESP32 NUT server and was able to add it in to HA with success.

Unfortunately, that didn’t last. I didn’t reserve the IP address in the router, and when it got a new address, HA didn’t find it. Naively, I tried to delete the old instance and add the NUT server back in with the new IP address. It failed with simply “Connection Error:”. That is, no detail on what the error is.

After much futzing around, I released the old IP from the device that had it and gave it back to my NUT server (with reservation). I am still stuck with the same terse error.

I have debug output on my NUT server that shows HA is talking with it:

HA: USERNAME robert
NUT: OK

HA: PASSWORD xxxxxx
NUT: OK

HA: LIST UPS
NUT:
BEGIN LIST UPS
UPS bobups “esp ups”
END LIST UPS

Then it reconnects and gets the variable list:

HA: USERNAME robert
NUT: OK

HA: PASSWORD xxxxxx
NUT: OK

HA: LIST VAR bobups
NUT:
BEGIN LIST VAR bobups
VAR bobups battery.charge 0.00
VAR bobups battery.voltage 4.61
VAR bobups battery.current 0.00
VAR bobups battery.runtime 240.00
VAR bobups ups.status “OB DISCHRG LB”
VAR bobups ups.time “23:17:20”
VAR bobups ups.date “2026 Aug 6”
VAR bobups ups.uptime 78.40
VAR bobups ups.load 1.60
VAR bobups ups.timezone “PST8PDT,M3.2.0,M11.1.0”
VAR bobups input.voltage 4.61
VAR bobups input.current -0.00
VAR bobups output.voltage 0.00
VAR bobups output.current 0.00
END LIST VAR bobups

Clearly it is connecting to my NUT server, but something is not right. I don’t see anything relevant in any of the logs (but maybe Settings->Logs isn’t everything???).

Another bothersome thing is that the user and password is retained from when I first, successfully, added the NUT server. When I try to re-add it, whether I put in the user/password or not in the “add” form, the actually communication (as logged above) has those original values.

I should also mention that I can successfully access the NUT server using the upsc, upsrw, etc. .tools:
./upsc [email protected]:3493
Init SSL without certificate database
battery.charge: 0.00
battery.charge.low: 10.00
battery.charger.status: discharging
battery.voltage: 4.61
battery.current: 0.00
battery.runtime: 240.00
ups.status: OB DISCHRG LB
ups.time: 23:16:23
ups.date: 2026 Aug 6
ups.uptime: 21.50
ups.load: 1.60
ups.timezone: PST8PDT,M3.2.0,M11.1.0
input.voltage: 4.61
input.current: -0.00
output.voltage: 0.00
output.current: 0.00

Any thoughts or advice on what to try next would be appreciated.

Thanks

Bob

Update. I found the issue. I captured the packets between my NUT and HA with wireshark, and I noticed a trailing space after “BEGIN LIST VAR bobups” and before the 0x0a newline. I took that out and HA is happy now.

Thanks to those who took a look, the issue was not evident in what I posted.

Bob

Another gem I noticed while testing is that if the NUT server reports outlet.count as “1.0”, no entities are added with the integration. If instead, it is reported as “1”, the regular entities are added and it looks good.