I’ve been noticing some really slow (comparatively anyway) automation responses recently - from a sensor being triggered to the corresponding action being executed i.e. a Zigbee motion sensor triggering a Zigbee light switch to turn on (btw I use the Sonoff Zigbee/Matter gateway attached to the Pi, with all devices added via HA, rather than through Tuya/Smart Life) - and I was wondering if this is an issue specific to my system, or whether other ppl running HA on a Pi 4B were noticing something similar, and therefore is HA starting to become a bit “too much” for Pi 4B’s (even the 8GB version I’m running) to handle, and an upgrade (which I’ve been planning anyway) to a Pi 5 is in order?
I should note that
a) I haven’t noticed a huge spike in CPU (usually in single digits) and RAM (averages about 21%) usage that would clearly suggest the Pi is struggling
b) I have another suspect for the slower responses. I added a Ring alarm with associated sensors and cameras (including snapshot pics) via Ring-mqtt a couple of months ago and given the constant stream of MQTT messages that generates, that could be slowing things down. I’m currenty testing this hypothesis by alternating Ring-mqtt 1 week on, 1 week off, so I can get a better feel of the automation response times across different times of the day/week, to try and average out any other contributing factors such as other integrations etc. I already had to remove MQTT Discovery because it added an enormous amount of entities (3000+) and that had a very noticeable effect on the system speed, so adding Ring seems a likely candidate for the slower speeds.
However, it got me thinking about the Pi 5 upgrade I’d been contemplating since its release and whether there will come a point when HA is too demanding for a Pi 4, or whether that point has already arrived if you’re running a system with many CPU/RAM intensive integrations and addons?
So, the Sonoff Zigbee/Matter gateway receives a Zigbee message, has to translate it to Matter, after which the Matter integration in HA picks it up. HA processes the automation, sends out a Matter message to turn the light on, the Sonoff Zigbee/Matter bridge picks it up, translates it to a Zigbee message to turn the light on.
Tell us which specific model it is, what firmware it’s using (multiprotocol or just zigbee?) and how it’s integrated into HA (Matter, ZHA, Z2M or something else?)
Which specific devices and what protocol do they use? Zigbee or Matter?
That’s not bad at all, though it’s double what I would expect for an 8GB model. You’re definitely not running into a RAM bottleneck though.
This would be my prime suspect too, especially if the delays started after you added this integration. No integration should be creating 3000+ entities by default. I suggest you stick to your plan and disable the custom integration (possibly forever), then monitor. That is why the first message you see in the log every time you restart HA is: We found a custom integration which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
Speaking of logs, do you have anything in them which might stand out?