Home assistant slow / unresponsive

I have installed HA on a dedicated machine with 7th i3 , 32gb ram and 500gb ssd.

I have 7 wifi devices added out of which 5 are led bulbs and 2 are sockets. The socket and bulbs are from different manufacturers but are tuya based. I have added them to HA as tuya devices.

I am running automations where if the socket is turned on it turns on a led bulb and switching off the socket switch (not the power supply) turns off the led bulb.

HA is very slow in running the automations (the led bulbs turn off after around 5-10 secs of turning off the socket) and many times does not respond to the webui operations. Update to ui is also spotty. Once I restart HA (reboot), HA seems very responsive but status showing lethargic behaviour after a while.

I have ESPhome add on installed.

Looking for help and suggestions.

HI, as a test: what happens if you manually switch these lights on/off (regarding responsiveness of course)

Your HA sounds nice and all, but is your WiFi network (router/AP’s) just as good? It won’t matter how nice your HA machine is if you’re running it using a 15 year old router, for example.

Manually, their response is instantaneous. Even using the dedicated manufacturer’s / Tuya mobile app they respond almost instantaneously.

Agreed, however my router is my ISP provided router which is a Dasan Network Solutions H660GM-A. It is a cost effective (cheap) router from which I do not expect good performance. But I never expected this terrible latency.

Are we talking about the same: manually from within HA, not an automation and 1 device at the time.

Manually from within HA is not responsive. I am able to turn on / off the lights in HA but the lights themselves respond after a while. The latency is huge.

How are they integrated in HA?

They are added as tuya devices. They require internet as these devices communicate with tuya servers. The sockets are also added as tuya devices and I have two automations for each socket. When the switch on the socket is set to on, the automations are supposed to turn on a light bulb (same applies to off). The automations work but with high latency

The ISP provided router is usually crap. They buy the lowest-bidder router they can. Often with just enough memory for 20-30 IP clients.

agreed, let me run some tests on my local network and confirm this. I will probably borrow a separate router and set up a local network just for HA and other devices. Problem is how do I overcome Tuya devices requirement of internet.

Due to geopolitical tensions between my country and China, I do not expect a faster route over internet to the servers for Tuya devices which I assume is located in China.

Tuya Local.

I installed the “LocalTuya” integration from HACS. I even setup the cloud account in Tuya Developer platform.

When I configure the integration by providing cloud id, secret, uid and username (I assume this is the username for tuya developer account). I get a message saying the integration was configured successfully. However the devices do not show up. When I try to configure the integration once again, I get this error message:

@stevemann looking for your help here :slight_smile:

There seems to be a compatibility issue with the version of HA and localtuya. I followed the instructions provided by vjmaz
(Config flow could not be loaded: 500 Internal Server Error Server got itself in trouble · Issue #2130 · rospogrigio/localtuya · GitHub)
This resolved by localtuya error.