Skip to content

Huawei SUN2000: support import/export for grid/battery#29790

Draft
CiNcH83 wants to merge 7 commits into
evcc-io:masterfrom
CiNcH83:huawei_importexport
Draft

Huawei SUN2000: support import/export for grid/battery#29790
CiNcH83 wants to merge 7 commits into
evcc-io:masterfrom
CiNcH83:huawei_importexport

Conversation

@CiNcH83
Copy link
Copy Markdown
Contributor

@CiNcH83 CiNcH83 commented May 9, 2026

Depends on #29805.

Notes:
Huawei does not provide self-consumption information.

Open Questions:

  • what is import/export for the inverter (pv)? Is production export? Or do we leave it at energy?

Copy link
Copy Markdown
Contributor

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've left some high level feedback:

  • Renaming the existing energy fields to import/export changes the metric contract; consider either keeping a backward-compatible energy alias or explicitly handling the migration for existing consumers of this template.
  • The import register for the battery meter uses two separate if blocks for storageunit 1 and 2; if another value is passed, no address is set, so it may be safer to add an else/default branch or validation to avoid generating an invalid configuration.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Renaming the existing `energy` fields to `import`/`export` changes the metric contract; consider either keeping a backward-compatible `energy` alias or explicitly handling the migration for existing consumers of this template.
- The `import` register for the battery meter uses two separate `if` blocks for `storageunit` 1 and 2; if another value is passed, no address is set, so it may be safer to add an `else`/default branch or validation to avoid generating an invalid configuration.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@CiNcH83 CiNcH83 force-pushed the huawei_importexport branch from f92fb19 to e7a1fc0 Compare May 10, 2026 09:36
@andig andig added the devices Specific device support label May 10, 2026
@andig andig marked this pull request as draft May 10, 2026 10:02
@CiNcH83
Copy link
Copy Markdown
Contributor Author

CiNcH83 commented May 19, 2026

@andig Think we are missing #29805.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

devices Specific device support

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants