Skip to content

Add battery charge current limit number entity to GoodWe - #180296

Open
davibe wants to merge 1 commit into
home-assistant:devfrom
davibe:goodwe-battery-charge-current
Open

Add battery charge current limit number entity to GoodWe#180296
davibe wants to merge 1 commit into
home-assistant:devfrom
davibe:goodwe-battery-charge-current

Conversation

@davibe

@davibe davibe commented Aug 26, 2026

Copy link
Copy Markdown

Proposed change

Adds a Battery charge current limit number entity to the GoodWe integration, exposing the inverter's battery_charge_current setting (Modbus register 45353) under the device's configuration entities.

The entity is only created when the inverter advertises the setting (inverter.settings() contains battery_charge_current), so model families without the register get no entity and no register read is attempted. It is read/written through read_setting/write_setting with the register's 0.1 A resolution (a converter field was added to the entity description so the existing whole-number settings keep their int conversion while this one uses round(value, 1)).

The 0–100 A range is GoodWe's documented range for the register (BattChargeCurrMax RW U16 gain 10 [0,1000] in the ARM Modbus protocol map), not a per-model hardware limit; per that documentation the inverter and battery BMS still apply their own real-time limits. It's a current ceiling: actual charging power depends on battery voltage, available PV power, load, inverter mode and BMS limits. The entity uses box input mode (no slider) and EntityCategory.CONFIG.

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New integration (thank you!)
  • New feature (which adds functionality to an existing integration)
  • Deprecation (breaking change to happen in the future)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

Checklist

  • I understand the code I am submitting and can explain how it works.
  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • I have followed the perfect PR recommendations
  • The code has been formatted using Ruff (ruff format homeassistant tests)
  • Tests have been added to verify that the new code works.
  • Any generated code has been carefully reviewed for correctness and compliance with project standards.

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • The manifest file has all fields filled out correctly.
    Updated and included derived files by running: python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt.
    Updated by running python3 -m script.gen_requirements_all.
  • For the updated dependencies a diff between library versions and ideally a link to the changelog/release notes is added to the PR description.

To help with the load of incoming pull requests:

Copilot AI balanced review requested due to automatic review settings August 26, 2026 15:32
@davibe
davibe requested a review from starkillerOG as a code owner August 26, 2026 15:32

@home-assistant home-assistant Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hi @davibe

It seems you haven't yet signed a CLA. Please do so here.

Once you do that we will be able to review and accept this pull request.

Thanks!

@home-assistant

Copy link
Copy Markdown
Contributor

Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍

Learn more about our pull request process.

@home-assistant

Copy link
Copy Markdown
Contributor

Hey there @mletenay, @starkillerOG, mind taking a look at this pull request as it has been labeled with an integration (goodwe) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of goodwe can trigger bot actions by commenting:

  • @home-assistant close Closes the pull request.
  • @home-assistant mark-draft Mark the pull request as draft.
  • @home-assistant ready-for-review Remove the draft status from the pull request.
  • @home-assistant rename Awesome new title Renames the pull request.
  • @home-assistant reopen Reopen the pull request.
  • @home-assistant unassign goodwe Removes the current integration label and assignees on the pull request, add the integration domain after the command.
  • @home-assistant update-branch Update the pull request branch with the base branch.
  • @home-assistant add-label needs-more-information Add a label (needs-more-information, problem in dependency, problem in custom component, problem in config, problem in device, feature-request) to the pull request.
  • @home-assistant remove-label needs-more-information Remove a label (needs-more-information, problem in dependency, problem in custom component, problem in config, problem in device, feature-request) on the pull request.

@davibe
davibe force-pushed the goodwe-battery-charge-current branch from 89d7f82 to e875471 Compare August 26, 2026 15:40

@home-assistant home-assistant Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hi @davibe

It seems you haven't yet signed a CLA. Please do so here.

Once you do that we will be able to review and accept this pull request.

Thanks!

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@davibe
davibe force-pushed the goodwe-battery-charge-current branch from e875471 to a544c8d Compare August 26, 2026 18:03
Copilot AI review requested due to automatic review settings August 26, 2026 18:03

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

# Battery charge current limit in A (inverter side, BMS limits still apply).
# Only added when the inverter advertises the setting.
GoodweNumberEntityDescription(
key="battery_charge_current",
@davibe
davibe marked this pull request as ready for review August 26, 2026 18:08
@home-assistant
home-assistant Bot dismissed stale reviews from themself August 26, 2026 18:08

Stale

@joostlek joostlek left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please fill in the PR template

@home-assistant
home-assistant Bot marked this pull request as draft August 30, 2026 19:14
Copilot AI review requested due to automatic review settings September 1, 2026 17:27
@davibe
davibe force-pushed the goodwe-battery-charge-current branch from a544c8d to e667546 Compare September 1, 2026 17:27

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@davibe
davibe marked this pull request as ready for review September 1, 2026 17:31
@home-assistant
home-assistant Bot requested a review from joostlek September 1, 2026 17:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants