Skip to content

Qcells, Solax active battery control#3360

Open
LKuemmel wants to merge 6 commits into
masterfrom
feature_bat_control
Open

Qcells, Solax active battery control#3360
LKuemmel wants to merge 6 commits into
masterfrom
feature_bat_control

Conversation

@LKuemmel
Copy link
Copy Markdown
Contributor

@LKuemmel LKuemmel commented May 11, 2026

@LKuemmel LKuemmel added this to the 2.2.0-Patch.1 milestone May 19, 2026
@LKuemmel LKuemmel changed the title Feature bat control Qcells, Solax active battery control May 19, 2026
@LKuemmel LKuemmel force-pushed the feature_bat_control branch from 07bebf7 to 4575fd2 Compare May 19, 2026 14:21
Xoffroad and others added 5 commits May 19, 2026 16:22
* adding active battery control for qcells and new field for overload security

* remove field for max_power and use max_charge_power and max_discharge_power instead

* Apply suggestion from @seaspotter

Co-authored-by: SeaSpotter <florian.horch@gmail.com>

* Apply suggestions from code review

Co-authored-by: SeaSpotter <florian.horch@gmail.com>

* Update packages/modules/devices/qcells/qcells/bat.py

Co-authored-by: SeaSpotter <florian.horch@gmail.com>

* Indentation corrected

* remove whitespaces

---------

Co-authored-by: SeaSpotter <florian.horch@gmail.com>
* adding active battery control for qcells and new field for overload security

* remove field for max_power and use max_charge_power and max_discharge_power instead

* fix: switch qcells battery control to mode 1 with dynamic timing; mode 8 was not stable
* adding active battery control for qcells and new field for overload security

* remove field for max_power and use max_charge_power and max_discharge_power instead

* fix: stabilize QCells active battery control in mode 1
Reworked QCells battery control to a stable Mode 1 workflow aligned with the validated HA behavior. The target calculation was corrected to avoid unintended forced charging, import limiting was applied consistently for net import control, and the full Mode 1 control payload is now written each cycle with dynamic timing based on the configured openWB control interval.
…ming (#3318)

* adding active battery control for qcells and new field for overload security

* remove field for max_power and use max_charge_power and max_discharge_power instead

* fix: align QCells Mode 1 battery control with openWB semantics and timing
#3320)

* adding active battery control for qcells and new field for overload security

* remove field for max_power and use max_charge_power and max_discharge_power instead

* fix: switch QCells remote control to Enabled Battery Control (mode 12)

* fix: switch QCells battery control to SolaX mode 4 push-power with atomic Modbus block writes
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds active battery power control for QCells/Solax devices via Modbus remote-control registers, with minimal tests for the openWB-to-Mode4 power sign conversion.

Changes:

  • Adds QCells battery set_power_limit support using Mode 4 push-power Modbus writes.
  • Adds helper logic for converting openWB charge/discharge semantics to QCells/Solax push-power semantics.
  • Extends test mocking and adds basic QCells battery tests.

Reviewed changes

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

File Description
packages/modules/devices/qcells/qcells/bat.py Implements active battery control and Modbus payload writing for QCells/Solax batteries.
packages/modules/devices/qcells/qcells/bat_test.py Adds tests for sign conversion of Mode4 push power.
packages/modules/conftest.py Adds a mock for BinaryPayloadBuilder so modules importing it can load in tests.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +131 to +133
with self.client:
# data_type=None with list payload writes a contiguous FC16 block.
self.client.write_register(REMOTE_CONTROL_MODE_REG, payload, unit=unit)
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Nicht unbedingt erforderlich.

@LKuemmel LKuemmel marked this pull request as ready for review May 19, 2026 14:27
…he SolaX battery module. (#3351)

* adding active battery control for qcells and new field for overload security

* remove field for max_power and use max_charge_power and max_discharge_power instead

* fix(solax): enable mode4 battery control for g3 hybrids only

Implement active battery control via SolaX Remote Control Mode 4 in the SolaX battery module. Gate controllability to version g3 (Gen3/Gen4 Hybrid) and keep g2/g4 non-controllable; add unit tests for sign mapping and version gating.
@LKuemmel LKuemmel requested a review from Copilot May 19, 2026 14:33
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 5 out of 5 changed files in this pull request and generated no new comments.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants