Huge lag in HA reaction

Hello,

I am experiencing a very strange behaviour in HA for last few weeks.
I have a mesh if mixed Zigbee and WiFi (NsPanel US) light switches. I have found that from trigger light switch on tablet with companion app to actual action sometimes it takes like 10 secs. Sometimes it is instant.

I have started HA on RPI3b, then I moved to HP T610 with 8GB RAM (as it started to be too little RAM for ESP Home compilations). When I have found this happens I moved to Lenovo M910q Core i5 7gen / 16GB RAM and 128 GB nvme based. That did not resolved my problem. Web interface is now snappier but lag is same.

CPU util is roughly 7-10%, Memory consumption is like 2.5 GB /16 used.

One thing I have found is that SSH plugin is constantly restarts itself and the SSH Web console constantly reconnecting. Advanced SSH Web interface does not start at all.

What can I check and where to look what is happening?

Start here:

The Home Assistant Cookbook - Index.

I have a similar issue with automations that are triggered by a motion sensor. Sometimes, but not always, there is a lag of several minutes between trigger and action.

Thank you for your reply - have tried some of this but nothing looks like a good start point - my installation not going to recovery mode nor other symptoms are visible.

Main thing I have found might be that Zigbee are trying to move packets via one node what maybe cause some lags in that area, but this not telling anything about WiFi devices lag. My assumptions (according to issue with SSH Web panel hangs every few secs) is that something is hogging main node - server. Have no idea how to check is there any hiccups there.

The Home Assistant Cookbook also has a Zigbee section.

What have you tried?

May not be a Zigbee issue. What add-ons are you running? Studio Code Server in particular will gradually devour resources until HA grinds to a halt. You should stop it when not in use.

@jackjourneyman how do you “stop” Studio Code Server?

It is just sometimes it will do that.
The linting in VS studio code server goes haywire at times.
Restarting it or just stopping it when it is not used will solve it.
Also closing unused files limit the issue considerably, but do not solve it completely.

The control of the addon can be done from the addon info page.

Hi - sorry for late reply:

@MaxK - I have started from the top and tried to check logs - have found there that HA tries to use the disconnected database. Have recreated it and looks better now - system does not spits that errors now and works snappier. However that didn’t resolved problem with Web SSH - it is still choppy and needs reconnect every few seconds.

@jackjourneyman - Hi - this is the list addons in the system:

I have also rechecked my wireless network and seems that UniFi is not very great with band/channel optimization as it picked Ch. 6 when particularly ALL my neighbors are using this channel. I have manually switched to Ch.11 and after some days I can see that delay between touch and real action has dropped significantly.

Still tracking some log entries to ensure that system works optimal.

Do you get the same behavior using this SSH addon?

Yes - exactly same behavior.

I’m guessing there are still network issues.

Using Terminal/SSH within Home Assistant should be stable. This should allow for using the following:
Common tasks - Operating System - Home Assistant.

1 Like

Just found that there is a continuation :slight_smile: Processing it now

Ok - have done all of below:

** ```
ha core check
ha core info
ha core logs
ha core options
ha core rebuild
ha core restart
ha core restart --safe-mode
ha core start
ha core stats
ha core stop
ha core update


Still SSH plugin asking for reconnect every few sec.

Check if it’s related to this Cannot ssh. "no matching key exchange method found"

That should not restart SSH. It will just refuse the client, if the client use a too old encryption library.

No - looks that is not the one.

t looks like system takes hickups when it get unresponsive for a 3-4 secs and then first will start processing again and at 2nd attempt will ask fro reconnect.Sometimes asking for reconnect at first chance

OK - I think I have found the issue - in my case it was Tuya Vacuum Maps - map extractor plugin for our robovac. Once I have disabled it everything was back to normal.