History-graph performance is terrible now

I have a history graph for monitoring power usage. It shows the last 24 hours of power on specific devices. The card looks like this:

type: history-graph
entities:
  - entity: sensor.greg_s_desk_power
  - entity: sensor.ray_s_desk_power
  - entity: sensor.media_equipment_power
  - entity: sensor.ray_s_hot_blanket_power
  - entity: sensor.voron_control_power
hours_to_show: 24
refresh_interval: 0
title: Office Computer Power

I upgraded recently to 2024.2.2 and started to notice that one of my pages caused the Home Assistant frontend to grind to a halt. I could tell that my mouse cursor wouldn’t change as fast as it should when hovering over things. Then I pulled up Windows system monitor and I could see that the tab was consuming 100% of one core on my CPU. Anyway, I determined that the problem was the history graph I show above. I noticed that if I cut down the hours to 2, it helped a little and if I removed all the entities but 1 it helped a little. Doing 2 hours and 1 entity made it perform as expected. When I added entities back, it seemed to exponentially get slower. With all 5 of them in there, it’s basically unusable.

This wasn’t the case with previous versions of Home Assistant but I don’t know if 2024.2.1 worked or 2024.1.6.

Unrelated to your question: this option is deprecated.

1 Like

Good to know thanks. I tried it without this option and the performance problem is still just as bad. :expressionless:

It looks like there’s something in progress that might address this issue. I found this ticket: CSE7766 hard to use since ESPHome 2024.2.0 · Issue #5501 · esphome/issues · GitHub

Explaining that the cse7766 is now sending MUCH more data than it used to and maybe that change will be backed out in an update. For now, I’ll use delta and throttle filters to reduce the number of data points.