Massive CPU usage of the standard Weather Forecast Card?

Hi, I have been using the standard HA Weather Forecast Card for years but just recently discovered via RPI Monitoring, that apparently the Weather Forecast Card with its simple animations seems to causes Chromium to use an insane amount of CPU (>50%)!

I run the following configuration. One RasPi 5 with 8GB to run HA in a docker container and one RasPi 5 with 8GB that has a touchpanel connected via HDMI and USB that really only runs Chromium in kiosk mode to display a HA dashboard from the HA RasPi.

Rasperian is the latest version:

Operating System: Debian GNU/Linux 12 (bookworm)
Kernel: Linux 6.6.62+rpt-rpi-2712Architecture: arm64

HA is the latest version:

Core 2025.1.2
Frontend 20250109.0

Chromium is the latest version:

Version 130.0.6723.116 (Official Build) built on Debian GNU/Linux 12 (bookworm) (64-bit)

I have a quite complex dashboard that shows various sensor values that update frequently. Without the Weather Forecast Card, the CPU usage of the RasPi (mostly caused by Chromium) is less than 2%.

However, if I now add a simple Weather Forecast Card to the mix, CPU usage shoots up to sometimes almost 60%, average around 50%:

I actually created a conditional card to debug this and made the display of the Weather forecast card conditional on an input_boolean.debug_weather_forecast_card:

  • type: conditional
    conditions:
    • condition: state
      entity: input_boolean.debug_weather_forecast_card
      state: “on”
      card:
      show_current: false
      show_forecast: true
      type: weather-forecast
      entity: weather.openweathermap
      forecast_type: daily

Screenshot 2025-01-18 12.48.21

With that configuration can easily monitor CPU usage with and without the Weather Forecast Card and it is 100% clear that the CPU usage comes from that card. I also of course tried the card on an empty dashboard, i.e. just the weather forecast card nothing else and get the very same behavior. Along with the CPU usage, CPU temperature also shoots up to more than 68 degrees C. Overall this just does not seem to be right?

Can anyone else observe or verify this behavior or could anyone explain what is happening here? Thanks!

I don’t see anything unusual on mine. You could try capturing a debug trace in chrome profiler to see what kind of activity is going on.

My dashboard with a weather card is almost 100% idle.

thanks for testing it @karwosts, really appreciate it! This is very interesting indeed as it looks very different for me:

A big difference seems to be painting and rendering, if I move the weather card out of the viewable area and record again, it is less, but still the scripting is significantly more than in your case:

Is your’s on a RasPi and Chromium as well?

The more entity state updates you have the more activity there will be, since there is a small dashboard update for every update of the hass object.

I’m not sure if there are update that could be made to the weather card that might mitigate some of this usage, but perhaps a raspberry pi is underpowered as a client, I’m not sure.

If your hass has many sensors that are updating very frequently (like multiple times per second?) trying to quiet some of them down may be beneficial.

Your chrome graphs still look mostly idle though (75%?), so I’m not sure how to correllate that with your picture of almost 95% cpu usage.

The dashboard that I am measuring really only has the weather forecast card on it, so the measurement is not related to any other HA entity or sensor. It runs on a RasPi 5 with 8GB which should be plenty.

But what I am hearing is that your measurement was not on a RasPi so probably not a benchmark I should aim for. If anyone with a RasPi sees this and can replicate it, I’d appreciate it!

And as I had mentioned the dashboard with lots of sensor and updates without the weather forecast card leads to << 10% CPU and the dashboard with the weather forecast card that runs at >> 50% CPU usage only has the weather forecast card so there must be something specific the weather forecast card does that is triggering the CPU usage on Chromium on the RasPi.

Oh and I just actually tested it also with the build in HA energy dashboard, which also has an animation for how the power flows and it is the very same! So it must be related to how the RasPi actually handles graphics processing?

The dashboard that I am measuring really only has the weather forecast card on it, so the measurement is not related to any other HA entity or sensor. It runs on a RasPi 5 with 8GB which should be plenty.

The architecture of the frontend is that every time any state in your entire HA changes, there is a partial refresh done on every card currently visible in the frontend. Usually cards try to detect quickly that there’s no update in it that they are looking for and exit the process quickly, but it does trigger some amount of cpu processing the more activity there is on your server.

Doesn’t matter that it’s a view with only one card.

but how would that explain that the CPU usage is very low when the weather forecast card but everything else is not shown? In any case, since it looks like that the animation is the issue, I looked for a replacement without animation and found the “Weather Chart Card” and installed it via HACS. It has a configuration option to disable animation and that works great (and the Weather Chart Card is overall really great and imho even the better option compared to the standard Weather Forecast Card…). Now CPU usage is back to normal and I will need to accept that the RasPi may not be the best choice for frontend rendering… But thanks a lot for all your guidance @karwosts!

I’m still curious what animation you’re referring to. I don’t think I’ve ever seen anything animated on the stock weather card.

:joy: that’s the worst, they animate e.g. the sun and the clouds, it uses a lot of CPU, but nobody notices it… I actually had the same problem and didn’t notice the animation until I dug deeper into it to see what causes so much CPU usage :thinking:

But here is a screen recording that clearly shows the animation. And while for the “Weather Chart Card” one can disable the animation with a setting, the “Stock Weather Card” unfortunately does not have such a “green” option. Another reason for the “Weather Chart Card” and big thanks, kudos and shout out to @mlamberts78!

I have never seen an animation on that card and I’m pretty sure it doesn’t have it.

Are you sure that isn’t created from some custom resource you have installed?

This is my weather-forecast card. Nothing moves.

image

For the video you saw, I am using the code below, which is the stock weather card, not?

type: grid
cards:
  - show_current: true
    show_forecast: false
    type: weather-forecast
    entity: weather.openweathermap
    forecast_type: daily
  - show_current: false
    show_forecast: true
    type: weather-forecast
    entity: weather.openweathermap
    forecast_type: daily

Technically yes that is the stock card, but if you have custom resources installed the could overwrite parts of the codebase that control that.

Curious if you see the same thing in Safe Mode.