High CPU usage when template triggered evry hour. How to diagnose

Hi,
Struggling with a template sensor. It is updated every hour.

The CPU usage bounces from 1 to 4% and stays there until reboot.

 - trigger:
      - trigger: time_pattern
        minutes: 1
    action:
      - action: weather.get_forecasts
        data:
          type: hourly
        target:
          entity_id: weather.home
        response_variable: hourly
    sensor:
      - name: Weather Condition 3 hour ahead
        unique_id: Weather_Condition_3_hour_ahead
        state: "{{ hourly['weather.home'].forecast[2].condition }}"

See here for some troubleshooting tools: 2024.5+: Tracking down instability issues caused by integrations.

1 Like

That’s not what the config says…

Do you have a bunch of these sensors with individual weather.get_forecasts actions?

trigger: time_pattern
minutes: 1

= one minute past every hour.

Only one forecast action.

When i insert

homeassistant:
  debug: true

I’ve got an error message saying Property debug is not allowed.

There must be something wrong with the Meteorologisk institutt (Met.no) integration.

Just by defining the template sensor, not triggering it. Home Assistant uses 4 times CPU at idle.

Recreated in test environment. Only this template sensor.