Home Assistant causing Network issues

Hello Fellow Comrads,

I am an enthusiastic user of Home Assistant, but I’ve encountered a recurring issue that appears to primarily affect Local Tuya, a component I heavily rely on for over 120 devices, making it impractical for me to remove for testing purposes.

To give some context, I discovered a thread discussing a similar issue, although no definitive solution was provided, and it seemed to resolve itself for the original poster: Home assistant keeps crashing my network

The problem manifests as intermittent network instability, during which only LAN connections function properly while WiFi connections encounter difficulties. Local Tuya struggles to communicate with most of my devices during these episodes.

When this instability arises, my smart devices, such as lights, remain accessible via the Tuya Mobile App. However, Local Tuya often disables the switch function or even greys out the device, indicating its unavailability.

Moreover, I find it challenging to establish WiFi connections with some devices during these periods. However, Home Assistant can still ping the affected smart devices, indicating a functional connection.

Initially, to address the issue, I upgraded my WiFi equipment, switching from Tenda’s to TP-Links and Ubiquity Devices. I also replaced all network switches. Additionally, I have a Mikrotik Firewall in place which enables me to monitor and troubleshoot my network.

When network instability occurs, my first line of action is to reboot my devices, such as WiFi units, routers and switches. This strategy provides some temporary relief as things seem to start to work but does not fully resolve the problem. Most devices seem to still struggle some way or another.

Ultimately, rebooting my Home Assistant Pi (a Pi 4 with 4GB RAM) brings everything back to normal operation. This isn’t just a soft reload; it requires a complete physical restart. The stability lasts for several days until the cycle repeats. I even replaced the Pi and conducted a fresh installation, but the issue persists. Intriguingly, a cold reboot of the Pi is the only measure that reliably restores network functionality.

Although Local Tuya appears to be the most affected, other integrations seem to function fine unless the connected device is on WiFi when the problem arises.

Despite my best efforts, replacing virtually all components, I remain at my wit’s end, unable to pinpoint the source of the issue. Can anyone provide some insight or potential solutions to this persistent network puzzle? Your advice would be greatly appreciated.

That is a lot of devices. Are they all on the same WiFi network and same subnet? And on top of those 120 LocalTuya devices do you have more devices on the same WiFi network and same subnet? If so, all that might contribute to your problem.
During those incidents, can you see a lot of network errors or packet drops, etc. on your access point(s)? It might be necessary to further segregate the network to reduce the number of devices per subnet.

1 Like

Hi.

So to answer you question I have a class B network.

I have a network range of 10.0.0.0-10.0.255.255 in order to handle that many IP addresses.

I use dhcp to static the devices as I add them. For example IoT devices and similar are set to a static ip of 10.0.10.x other device types get their own IP, for example phones are set to 10.0.11. x and so forth.

I did this originally when I started having the problem so I could ping the device in question when I was using Tuya local.

At that time I found I could not ping the device from the PI I was running but I could ping them from the mikrotik router. There was an odd occasion where I couldn’t ping the item and then I resolved it by adding more WiFi units.

Now, after installing more than 10 ubiquity WiFi units for inside the house and 10 EAP outside (also with channel management) I have good wifi everywhere. When the problem happens now I can ping every devices and the Tuya app is able to still control each light when I have the problem. It really seems to be on the PI

Why do I have so many lights, well it’s a big property for one and a majority of the lights are GU10 which I wanted to control individual lights and not just the switches. So a majority of the devices are gu10.

To understand this a bit more we have load shedding in South Africa so the HA talks to my inverter and when it detects load shedding I program the HA to power off all unnecessary lights (hence why I need to control individual lights) so that I can only use the power I need and make my batteries last longer.

What I’m worried is maybe the PI is not handling the load and is struggling. Maybe I should rather run this on a mini I5 pc

So I don’t know if the above answers your query, but when this started happening I only had around 40 devices and I house cheap router and desktop Wi-Fi’s. I replaced everything only to still have the same problem. I even upgrade the pi3 with a pi4. I initially thought my problem was Tuya local and after going Tuya cloud I gave up and posted here.

Did you ever sort this out?

I’m having the same problem but I run HA on a MacBook Pro in VirtualBox.
About once a week my entire network becomes unstable and devices keep disconnecting then reconnecting.
Driving me crazy!

Thanks!

In my view WiFi is not made for such a large number of devices concurrently on the same wireless network and on the same IP network. Upgrading the network with more sophisticated devices that have more tricks up their sleeves is certainly helpful.
But if all the devices are still on the same class B network, they are still broadcasting and congesting the network.
I personally would avoid having more than maybe 80-100 WiFi devices on a single IP network.

Up!
Any resolution other than to remove HA?

Hello,

I wanted to share an update on my experiences with Tuya Local and smart light switches. Interestingly, Tuya Local began functioning correctly without any specific intervention from my side; it seems that consistent updates eventually resolved the issues I was encountering.

However, I still face challenges with Tuya’s online services, which have not improved despite my efforts. Consequently, I decided to remove the online component from my setup entirely.

Some of the challenges I experienced above were caused by the smart light switches without a neutral wire that I installed with capacitors that they came with, and I’ve identified that their WiFi connectivity was problematic causing knock on affects. I’m in the process of replacing them with neutral wire-required versions to rectify this issue which so far has been looking good.

To summarize, the situation with Tuya Local resolved itself over time, though Tuya’s online services continue to be problematic for me. The connectivity issues were narrowed down to the non-neutral wire light switches. After experimenting and ultimately removing the capacitors I had installed to facilitate their operation, I observed that the switches connected to lights worked correctly. Based on my experience, I recommend opting for smart light switches that require a neutral wire, as the non-neutral versions seem to introduce complications.

I’m sorry I didn’t respond to this sooner, as it became so busy for me, I haven’t had time till now to revisit this article.