core: High CPU usage when GoodWe Inverter integration is enabled on 2022.10.0 - 2022.20.3

The problem

When this integration is enabled, high CPU usage is noticed. When the integration is diabled CPU usage drops to 2% immediately.

Screenshot 2022-10-12 101241

Some entities from GoodWe integration is used to create custom sensors, these have previously worked. I’ve attached the code here for reference in case these are causing the issues.

template:
    # New Sensor to track export to grid in (W)      
  - sensors:
       # Negative values only - if not negative return 0, otherwise provide "Return to Grid" Value
        export_to_grid_value:
            unique_id: export_to_grid_value
            friendly_name: Export to Grid
            icon_template: mdi:transmission-tower-export
            unit_of_measurement: "W"
            device_class: power
            value_template: >
                {% set value = states('sensor.eagle_200_meter_power_demand') | float %}
                {% if value  >= 0 %} 
                  0
                {%- else -%}
                  {{ (value *-1000) | round(2) }}
                {%- endif %}

    # New Sensor to track import from grid in (W)      
  - sensors:
       # Positive values only - if not positive return 0, otherwise provide "Import from Grid" Value
        import_from_grid_value:
            unique_id: import_from_grid_value
            friendly_name: Import from Grid
            icon_template: mdi:transmission-tower-import
            unit_of_measurement: "W"
            device_class: power
            value_template: >
                {% set value = states('sensor.eagle_200_meter_power_demand') | float %}
                {% if value  <= 0 %} 
                  0
                {%- else -%}
                  {{ (value *1000) | round(2) }}
                {%- endif %}

    # New Sensor to track power used by home (W)      
  - sensors:
       # Positve values only - if  negative return 0, otherwise provide Power used by home" Value
        power_used_home_value:
            unique_id: power_used_home_value
            friendly_name: Power used by home
            icon_template: mdi:home-import-outline
            unit_of_measurement: "W"
            device_class: power
            value_template: >
                {% set pvstate = states('sensor.pv_power') %}
                {% if is_number(pvstate) %}
                    {% set value = ( states('sensor.pv_power') | float + states('sensor.import_from_grid_value') | float  - states('sensor.export_to_grid_value') | float )  %}
                    {% if value  <= 0 %} 
                      {{ (value) | round(2) }}
                    {%- else -%}
                      {{ (value) | round(2) }}
                    {%- endif %}
                {%- else -%}

                    {% set value = ( states('sensor.import_from_grid_value') | float  - states('sensor.export_to_grid_value') | float )  %}
                    {% if value  <= 0 %} 
                      {{ (value) | round(2) }}
                    {%- else -%}
                      {{ (value) | round(2) }}
                    {%- endif %}
                {% endif %}

What version of Home Assistant Core has the issue?

2022.10.3

What was the last working version of Home Assistant Core?

2022.09.x

What type of installation are you running?

Home Assistant OS

Integration causing the issue

GoodWe Inverter integration

Link to integration documentation on our website

https://www.home-assistant.io/integrations/goodwe/

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 21 (7 by maintainers)

Most upvoted comments

@starkillerOG This smells like some consequence of https://github.com/home-assistant/core/pull/76793, could you please have a look ?