CPU choice for dedicated HA host to beat latency

Maybe I am wrong, but most of older threads weren’t that informative for me, so there is a new one.

I decided to switch my home from FHEM to HA. While nothing out there can beat FHEM for back-end side, once you get to know FHEM ways. Amount of supported devices and other stuff is unbeatable, but look and feel…it lacks ) And FHEM wasn’t never “my thing”, and I am tired of google-translating German. I just went with with FHEM back in time due to hardware I had to support.

But what I found that with HA (I run dev version) there are some noticeable lags, when it is running on rpi3+. Maybe tiny, but still. Things like when you press button, light comes 0.6-0.8 sec after, which pisses me off. Latencies with FHEM were smaller. And I clearly see that most of latency comes from HA (trigger comes from MQTT and action goes to MQTT, so timing MQTT show that there is about 0.4-0.5 sec between trigger and action)

I still want to go with HA, but now I consider dedicated mini-PC, industrial style more or less, from aliexpress, not NUC. And I am trying to figure out, which one to choose (i.e. which CPU). For RAM/SSD my choice is 8GB/128GB. Just to have an option fo future. But with CPU I don’t want overkill in terms of power consumption, heat and costs.

So, this box will run HA, node-red, zigbee2mqtt, FHEM (I still have to keep it to properly support my MAX! heating stuff, homegear/HA combo isn’t there yet, so I export things through MQTT for HA for basic support, and advanced stuff will stay in FHEM), mosquitto, otmonitor, and home-grown piece of software for boiler setpoint calculation depending on the bunch of data. It also will act as wifi AP for dedicated WiFi network for wi-fi home automation devices.

In terms of devices, mostly it is light (about 50 zigbee devices, ±) and heating (20-25 related devices), plus some other stuff. Also all things like homekit and alexa integration.

Currently with my test-setup (not much devices yet) HA consumes approximately 20% of CPU on rpi3+ on 5 minute averages. But unsteady, if you look with higher discretisation (like 0.2-0.3 sec) then it varies between 0 and 90%.

I also want to be ready for future grow, more on sensors side (more occupancy, doors etc), and on control (door locks, curtains etc), maybe cameras, and more exotic stuff.

Currently, for both, FHEM and HA, influxdb and mysql data goes to my home server, where I have mysql and influxdb servers, but I am considering to move HA-related data to the HA host, once it gets more powerful. At least mysql/mariadb. InfluxDB will inevitably produce time to time heavy pressure on the memory, especially if you want to keep lot of data and for long, so I am unconvinced yet.

SO, this is use-case picture.

Now, question which CPU will be good enough for me to reduce latencies and not overkill at the same time.

J1900? J3455? i3-6100U/7100U ? i5-6200U/7200U? Something else?

I’m running HA on the following

  • i5 6600T, 2.7GHz - this is the low-power version
  • 16GB RAM
  • Samsung 950 Pro 256GB M.2

Beside Home Assistant I have a Conbee stick with Phoscon, Mosquitto, InfluxDB and Grafana. For monitoring I run Netdata.

I just moved Unifi Controller and Unifi Video off to a Unifi Protect device.

I also use this server for filesharing (AFP) and Plex, as well as Duplicati for remote backups. I installed this at the time to save money, but probably would not do that again, and rather separate these from the core home automation applications.

The lag issue may not solely be related to CPU resources. I have a small lag (<500ms) just within my ZWave switch when I toggle the physical switch on the wall.
But in a more complex scenarios involving HA, for example when a motion sensor triggers an automation that then turns on a light, I also have a small lag - noticeable but not bothering. But it’s really hard to say how much of CPU capacity or load is contributing to that lag, and how much may be attributed to network latency for example.

That’s pretty good. Especially as the majority (0.4-0.5) sec is the mqtt server. That’s only 0.2-0.3sec for HA.

The slowest part of your chain is zigbee<>mqtt. Changing your CPU isn’t going to make much difference to this.

Not really true :slight_smile:

Changing hardware improved delays.
For both, for zigbee2mqtt and for HA.

I had huge latency performance gains moving to a fast NUC from an rPI with my Zwave. Literally multiple times better.

I assume similar for zig2mqtt as it’s just some polling loops and the faster the CPU the faster those loops can be executed; reducing latency.

Well I cant argue with your results but my original point was made according to the timings you supplied.

What sort of over-all latency are you getting now?

I guess I didn’t explain properly. Most of the delay was in HA )
0.4-0.5 sec was between Z2M sending to MQTT trigger, and HA sending action to MQTT.
Now it is almost negligible on i7-2635QM

1 Like

I run HA under lubuntu on a Gemini-N41 4 cores 4GB 240GB SSD machine and am super-happy with performance.

I have a production instance running on lubuntu itself and another instance running under virtual box.

I am running

  • Hassio
  • Home Assistant
  • Node-RED
  • Mosquito Broker
  • MySQL database
  • InfluxDB
  • Grafana
  • Virtual Box with HA
  • ~25 ZWave devices
  • a handful Tasmota devices

The only latency I really see is on history graphs - despite using MySQL.

My strong recommendation is to run any kind of Linux.