Skip to content

Growatt THOR 22AS causes high memory usage - GetConfiguration(NumberOfConnectors) #1997

Description

@hnktnk

Disclaimer: I troubleshooted all of this with the help of ChatGPT and ChatGPT also helped me fix the issue. If the fix is a good fix or not - I have no clue but... now the integration works for me. This bug report is also more or less created by ChatGPT.

Describe the bug
Home Assistant enters an OOM crash loop when my Growatt THOR charger connects via OCPP 1.6.
From the debug logs I can see that the charger responds to GetConfiguration(NumberOfConnectors) with: 1634030126

This value is accepted by get_number_of_connectors() and later assigned to self.num_connectors.

After the charger connects, Home Assistant memory usage rapidly increases until the Linux OOM killer terminates Core. The system then enters a continuous restart loop.

As a temporary workaround I patched the integration to reject connector counts outside a reasonable range (1-100) and to clamp self.num_connectors. After applying this patch the charger connects successfully and Home Assistant has remained stable (RAM ~26-27%).

I noticed PR #1892 appears to address invalid connector counts, but my installed v0.10.15 still accepted this value, so I'm unsure whether this is a regression or another execution path.

To Reproduce
Steps to reproduce the behavior:

  1. Install the latest OCPP integration from HACS (v0.10.15).
  2. Configure a Growatt THOR charger using OCPP 1.6.
  3. Allow the charger to connect.
  4. Observe the response to GetConfiguration(NumberOfConnectors): 1634030126
  5. Home Assistant memory continuously increases until the Linux OOM killer terminates Core.

Expected behavior
Invalid connector counts returned by the charger should be rejected and the integration should fall back to the configured connector count (or 1) instead of using the returned value.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: Win11
  • Browser: Chrome
  • Version Version 150.0.7871.125

Smartphone (please complete the following information):

  • Device: OnePlus 9 Pro
  • OS: Android 14
  • Browser Chrome
  • Version I dont know.

Software:
HA:

  • Installation method: Home Assistant OS
  • Core: 2026.7.2
  • Supervisor: 2026.07.3
  • Operating System: 18.1
  • Frontend: 20260624.5
    OCPP version: Version v0.10.15

Hardware:
Growatt THOR_22AS
Firmware: THOR_22AS-V5.2.7-20230810-NOVO-Norway

Additional context
Relevant debug log:

GetConfiguration(NumberOfConnectors)

Request:
key = ["NumberOfConnectors"]

Response:
key = "NumberOfConnectors"
value = "1634030126"

As a temporary workaround I changed the following:

In ocppv16.py:

  • Only accept NumberOfConnectors values between 1 and 100.
  • Otherwise fall back to the default value (1).

In chargepoint.py:

  • Clamp self.num_connectors to the range 1..100 before initializing connector slots.

After applying these changes:

  • The charger connects normally.
  • Home Assistant no longer enters an OOM crash loop.
  • RAM remains stable at approximately 26–27%.
  • Integration appears to function normally.

I believe this may be related to PR #1892. My installation was running v0.10.15, but this execution path still accepted the invalid connector count returned by the charger.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions