Unifi integration entity disconnect loop

New to Home Assistant - I’ve set up the server on a HyperV VM and connected it to my UDM-Pro via the Unifi Network integration.

Connected entities through the Unifi integration are continuously connecting and disconnecting roughly every minute. I think there may be an issue with the websocket but I’m not sure how to troubleshoot this further.

Troubleshooting so far:

HA setup - created a new VM (running on Hyper-V created from VHDX). Reinstalled Unifi Network integration. Time until considered away increased to 900 seconds.

Wireshark - no packet loss seen

Firewall - Rule made to allow from HA server to firewall on port 443

UDM logs - shows Websocket dropping:

[2022-10-18T11:55:19,715] <ws-notify> WARN  api    - unable to send over websocket java.lang.IllegalStateException: The WebSocket session [49ef] has been closed and no method (apart from close()) may be called on a closed session
[2022-10-18T11:55:37,458] <webapi-4783> WARN  api    - websocket session error:Connection reset by peer

HA logs - Also shows Websocket dropping:

2022-10-18 10:34:03.247 WARNING (MainThread) [homeassistant.components.unifi] Lost connection to UniFi Network
2022-10-18 10:34:09.761 INFO (MainThread) [homeassistant.components.websocket_api.http.connection] [140499567899072] Connection closed by client
2022-10-18 10:34:28.867 ERROR (MainThread) [aiounifi.websocket] AIOHTTP websocket error

Haven’t seen a similar issue before. Highly likely related to your system setup else it would like be reported by more users.

Thanks Robban

I took a further look into the setup and found the UDM-Pro was running at 95% memory.

After a restart and disabling the ‘Protect’ camera service that was unused it’s hovering much lower and Home assistant is working correctly

1 Like