Home Assistant constantly losing connection - pls help

I too have that Problem, It started with one of the last Updates I guess. I can’t say when, as I didn’t notice it at first and blamed my Zigbee Setup for Automations not firing /not firing exactly. A Week ago I wanted to edit them, to see what I could simplify, but I got the same behavior from HA as it is described here in the Thread:
Timeout after a few Minutes using the Web-UI or App. Access is only possible right after a restart.

Since I used an USB-SSD as my Main-Drive on a Raspberry Pi 3B, I thought it may be the culprit. It ran the last 3 years in that constellation, without any non-resolvable or understandable errors. So I changed the Drive to a fresh SSD in a new USB-Case with Trim support.

I installed fresh, on a new drive, without importing any Backups, and the Problem still persists. I Replaced The Network Cable, Changed the Network-Switch the Pi is connected to, Replaced the PSU with a rather powerfull one (5V 6A), and by now I was about to replace my Raspberry Pi 3B with new Hardware (Somehting NUC-Like), when I found this thread…

Well, I hope we can find a solution, If all our Problems maybe have the same root… I will now roll back Home Assistant Versions and see if that changes anything.

1 Like

Mine seems coupled with an event in the log where webhooks received some kind of invalid incoming data. Still trying to trap it along with 6 other projects.

I do have a sensor which receives erroneous data (blank instead of JSON) too but that’s every minute that my washing machine is off (most of the time) so more often that the issue I’m getting I believe.

I did just notice something interesting when my doorbell just went offline (running through scrypted on a separate VM in Proxmox on the same hardware) which caused me to look to see if Proxmox had crashed or something. But then checked the summary for my HAOS VM and saw the graph where it seems to spike every 15 mins!

1 Like

Having a similar issue. Might be caused by zha (as the vmware vm my hus band made seems to losecobtact with the usb (skyconnect) and then i can’t control connected livhts and devices

Logger: homeassistant.components.websocket_api.http.connection
Source: components/websocket_api/http.py:521
integration: Home Assistant WebSocket API (documentation, issues)
First occurred: 09:51:08 (2 occurrences)
Last logged: 09:51:27

[139796634957664] xxx xxxx from 127.0.0.1 (Home Assistant/2024.12.1-14604 (Android 14; SM-G996B)): Disconnected: Received non-Text message.
[139796633519440] xxx xxx from 127.0.0.1 (Mozilla/5.0 (Linux; Android 14; SM-G996B Build/UP1A.231005.007; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/131.0.6778.39 Mobile Safari/537.36 Home Assistant/2024.12.1-14604 (Android 14; SM-G996B)): Disconnected: Received non-Text message.

Same here!
Is anyone know what’s the solution?

Logger: homeassistant.components.websocket_api.http.connection
Source: components/websocket_api/http.py:521
integration: Home Assistant WebSocket API (documentation, issues)
First occurred: December 12, 2024 at 11:09:49 AM (64 occurrences)
Last logged: 2:59:40 PM

The issue I was having was related to the docker network my swag container was running in. I deleted the container and the network and created fresh ones. That solved the issue. I’ve run into this problem with other tools in the past. Sometimes something happens to the docker network that causes connections to get refused, dropped, or closed. I haven’t pinpointed exactly what causes it. But recreating the network solves the issue for me.

1 Like

Same issue, it has been running now for 3-4 weeks or so

Logger: homeassistant.components.websocket_api.http.connection
Source: components/websocket_api/connection.py:175
integration: Home Assistant WebSocket API (documentation, issues)
First occurred: 22:09:13 (16 occurrences)
Last logged: 22:19:54

[139643897590208] Received binary message for non-existing handler 5
[139643897590208] Received binary message for non-existing handler 10
[139643915484848] Received binary message for non-existing handler 7
[139644780767712] Received binary message for non-existing handler 5

5-20 seconds of losing connection every few minutes. Only happens from Windows, not from ubuntu or companion app. Been happening for 5 weeks. I’ve been putting it down to replacement router. Running windows and ubuntu side by side and only windows loses the connection.
I’m trying ShadowFist’s suggestion.
Ok I tried turning off the automatically close connection. Didn’t help but I noticed connecting to other devices websockets disconnecting. So I think my problem is something else causing the disconnect.

Not sure if it is related but today I couldn’t get to the Add-on page. The system health is all green.

On my proxmox console

Rebooting the VM solved it for now, but doesn’t feel comfortable.

I can also confirm that at times automation are being delayed (~10-15 secs)

Got similar issues, its driving me crazy, especially the delay in automations (e.g. motion lights etc.) is getting VERY annoying VERY quick. I’m running Home Asisstant on an RPI5 and basically everything I’ve tried and tested (network, hard disk, add-ons, DNS, power, etc. etc.) doesnt point to an issue, utilization (Memory/CPU) is constantly low, but for whatever crazy reason the system seems to have these occasional disconnects and slow-downs…

On my hypervisor I am getting the following

2025-01-13 08:42:03.159 INFO (MainThread) [supervisor.api.proxy] Home Assistant WebSocket API error: Cannot proxy websocket message of unsupported type: 258

Is that related?

i am having he same issue. I only happens when conneted via nabu casa for me:

2025-01-13 19:12:11.826 WARNING (MainThread) [homeassistant.components.websocket_api.http.connection] [140440040226624] username from 127.0.0.1 (Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36): Disconnected: Received non-Text message.

2025-01-13 19:12:11.826 WARNING (MainThread) [homeassistant.components.websocket_api.http.connection] [140440040226624] username from 127.0.0.1 (Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36): Disconnected: Received non-Text message.

Hi guys, this problem was solved for me by changing the power supply for my NUC to one with a higher output. Since then, everything has been working as it should.

Hi, I keep having problems with the connection getting lost and I also have various error messages in the log. I’m trying to get to the bottom of this and have therefore opened the developer tools in the browser and found various errors. One relates to Browser Mod, which I was able to solve. Now I have several more errors, mostly related to Mushroom. But I still don’t know what the problem could be. Can anyone help me here?

Screenshot 2025-01-26 230126

Now just by chance I could see the connection being reloaded and this error occurred at exactly that moment.

By the way, I use Home Assistant via Preoxmox.

And after the error occurred, I could no longer access my Home Assistant instance via Nabusa. However, access works locally

On proxmox I see only this Error. Could this related to the mistake?

Jan 27 02:57:35 pve kernel: pcieport 0000:00:1d.0: PCIe Bus Error: severity=Correctable, type=Physical Layer, (Receiver ID)
Jan 27 02:57:35 pve kernel: pcieport 0000:00:1d.0: device [8086:54b0] error status/mask=00000001/00002000
Jan 27 02:57:35 pve kernel: pcieport 0000:00:1d.0: [ 0] RxErr (First)


A little update. I’ve now removed a few cards from my dashboard, including Frigate Lovelace and Bring. There are no more errors now and it seems to be running more smoothly. I still have to observe it over a longer period of time. But if problems arise, I would take a look at the whole thing with the developer tools in the browser and look for errors.

Interesting, I’m also using Proxmox on an NUC I got on eBay and rebuilt with a new SSD.

I noticed automations being slow and disconnects from websocket happening at the same time. And then confirmed this often lined up with CPU usage spikes in the Proxmox graphs.

Good to hear you resolved it (at least as it seems). Not being an expert on tracing the problem (e.g. I don’t recognize your mushroom and card.js screenshot), can you point me a bit more into how to use the develop tools? And how to troubleshoot this myself?

I do also see CPU spikes in my HA proxmox VM (but only from 15% to 28%). Interestingly it is happening every 16 minutes. I can confirm that during these spikes the connection is lost (although not every time). Another observation, when I removed Visual Code Studio the drop in connections significantly reduced.

Thanks for your support, highly appreciated!

I’m not an expert, I can only describe what I did. I opened the Chrome browser, opened the dashboard and then opened the developer tools under additional tools. It then showed me several errors and then I simply removed a few cards and checked whether the errors were gone.

1 Like

Thanks, that helps. In between the 16 minutes I do not see any errors in the chrome developer tool.

But then again at 16 minutes I get

Not sure if these errors are related as they refer to icons (and not specific code). After websocket restart, all errors disappear. Am I missing something?