core icon indicating copy to clipboard operation
core copied to clipboard

Unifi integration: Websocket disconnected

Open nagtegaal opened this issue 2 weeks ago • 7 comments

The problem

I get several reports in the log that says: 2025-12-07 03:46:57.785 ERROR (MainThread) [homeassistant.components.twinkly.coordinator] Error fetching twinkly data: 2025-12-07 11:14:40.454 ERROR (MainThread) [aiounifi.interfaces.connectivity] UniFi websocket error: 'No PONG received after 7.5 seconds' 2025-12-07 11:14:40.456 ERROR (MainThread) [homeassistant.components.unifi] Websocket disconnected 2025-12-07 13:53:38.455 ERROR (MainThread) [aiounifi.interfaces.connectivity] UniFi websocket error: 'No PONG received after 7.5 seconds' 2025-12-07 13:53:38.455 ERROR (MainThread) [homeassistant.components.unifi] Websocket disconnected

My connection from my HA system to my modem/routers/switches are all hardwired. I have no clue what causes this, which makes it hard to isolate the problem. And offcourse, how to fix it.

What version of Home Assistant Core has the issue?

core-2025.11 and up

What was the last working version of Home Assistant Core?

unknown

What type of installation are you running?

Home Assistant OS

Integration causing the issue

unify

Link to integration documentation on our website

No response

Diagnostics information

See above

Example YAML snippet


Anything in the logs that might be useful for us?

Nope...

Additional information

No response

nagtegaal avatar Dec 07 '25 19:12 nagtegaal

Image

nagtegaal avatar Dec 07 '25 19:12 nagtegaal

Image

nagtegaal avatar Dec 07 '25 19:12 nagtegaal

Hey there @kane610, mind taking a look at this issue as it has been labeled with an integration (unifi) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of unifi can trigger bot actions by commenting:

  • @home-assistant close Closes the issue.
  • @home-assistant rename Awesome new title Renames the issue.
  • @home-assistant reopen Reopen the issue.
  • @home-assistant unassign unifi Removes the current integration label and assignees on the issue, add the integration domain after the command.
  • @home-assistant add-label needs-more-information Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue.
  • @home-assistant remove-label needs-more-information Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


unifi documentation unifi source (message by IssueLinks)

home-assistant[bot] avatar Dec 08 '25 06:12 home-assistant[bot]

No-one else report this issue, I would guess it is some kind of environment issue for you otherwise it would be more broadly reported

Kane610 avatar Dec 08 '25 13:12 Kane610

I am having the same errors logged as well. They have been appearing for a little while (maybe a month or two) and my whole network setup is unifi (router, switch, 3 APs).

The errors appear intermittently in HA, perhaps a few days apart. I'll add my errors when I next see them appear.

Edit: the error appeared again for me

Screenshot_20251210_114336_Home Assistant.jpg

SeeThisIsMe avatar Dec 08 '25 23:12 SeeThisIsMe

I have a similar error that occurs sporadically. My guess is that it first occurred when UniFi switched the temperature and utilization reporting for the CPU & RAM to “Instant” (which, by the way, is idiotic; reporting every minute would have been more than enough). HA now receives values from UniFi several times per second. In conjunction with the data traffic from other integrations, I suspect that there is an occasional “hiccup” in the connection.

Logger: homeassistant.components.unifi Quelle: components/unifi/hub/websocket.py:84 Integration: UniFi Network (Dokumentation, Probleme) Erstmals aufgetreten: 09:22:29 (1 Vorkommnis) Zuletzt protokolliert: 09:22:29

Websocket disconnected

Logger: aiounifi.interfaces.connectivity Quelle: /usr/local/lib/python3.13/site-packages/aiounifi/interfaces/connectivity.py:237 Erstmals aufgetreten: 09:22:29 (1 Vorkommnis) Zuletzt protokolliert: 09:22:29

'value' Traceback (most recent call last): File "/usr/local/lib/python3.13/site-packages/aiounifi/interfaces/connectivity.py", line 202, in websocket callback(message.data) ~~~~~~~~^^^^^^^^^^^^^^ File "/usr/local/lib/python3.13/site-packages/aiounifi/interfaces/messages.py", line 60, in new_data self.handler(orjson.loads(raw_bytes)) ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.13/site-packages/aiounifi/interfaces/messages.py", line 85, in handler callback(data) ~~~~~~~~^^^^^^ File "/usr/local/lib/python3.13/site-packages/aiounifi/interfaces/api_handlers.py", line 116, in process_message self.process_item(message.data) ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^ File "/usr/local/lib/python3.13/site-packages/aiounifi/interfaces/api_handlers.py", line 131, in process_item self.signal_subscribers( ~~~~~~~~~~~~~~~~~~~~~~~^ ItemEvent.CHANGED if obj_is_known else ItemEvent.ADDED, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ obj_id, ^^^^^^^ ) ^ File "/usr/local/lib/python3.13/site-packages/aiounifi/interfaces/api_handlers.py", line 47, in signal_subscribers callback(event, obj_id) ~~~~~~~~^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/unifi/entity.py", line 220, in async_signalling_callback if not description.supported_fn(self.hub, self._obj_id): ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/unifi/sensor.py", line 309, in async_device_temperatures_supported_fn return _device_temperature(temperature_name, device.temperatures) is not None ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/unifi/sensor.py", line 320, in _device_temperature return temperature["value"] ~~~~~~~~~~~^^^^^^^^^ KeyError: 'value'

Logger: homeassistant.helpers.dispatcher Quelle: util/logging.py:167 Erstmals aufgetreten: 09:22:29 (2 Vorkommnisse) Zuletzt protokolliert: 09:22:45

Exception in async_signal_reachable_callback when dispatching 'unifi-reachable-01JMKQ5X838J2JF7VKQRK1NPE3': () Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/unifi/entity.py", line 231, in async_signal_reachable_callback self.async_signalling_callback(ItemEvent.ADDED, self._obj_id) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/unifi/entity.py", line 220, in async_signalling_callback if not description.supported_fn(self.hub, self._obj_id): ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/unifi/sensor.py", line 309, in async_device_temperatures_supported_fn return _device_temperature(temperature_name, device.temperatures) is not None ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/unifi/sensor.py", line 320, in _device_temperature return temperature["value"] ~~~~~~~~~~~^^^^^^^^^ KeyError: 'value'

Bikervossibaer avatar Dec 09 '25 09:12 Bikervossibaer

Happens here as well since a week or max two weeks. 2025-12-09 13:59:36.875 ERROR (MainThread) [aiounifi.interfaces.connectivity] UniFi websocket error: 'No PONG received after 7.5 seconds'

msteenhuiz avatar Dec 09 '25 22:12 msteenhuiz

Speculation I think they have removed the Websocket option... or changed it. Dont know after what Network app version update... guess 10.x killed it.

I done some research and its not clearly noted in any of the documentation or on their website (not surprised, they s*ck when it comes to information 🥴 ).

I have been trying to figure out how to setup and run a websocket and non of the previous methods are working. Wont get a hold of a CSRF tokens...

The searched continues but... not hopeful.

KIDNORswe avatar Dec 17 '25 14:12 KIDNORswe

Not specifically caused by network v10. I upgraded to v10 about a week ago and was having these errors before that on v9.

SeeThisIsMe avatar Dec 17 '25 14:12 SeeThisIsMe