Skip to content

Qcells active battery control - #3244

Merged
LKuemmel merged 8 commits into
openWB:feature_bat_controlfrom
Xoffroad:qcells-active-battery-control
Apr 14, 2026
Merged

LKuemmel merged 8 commits into
openWB:feature_bat_controlfrom
Xoffroad:qcells-active-battery-control

Conversation

@Xoffroad

@Xoffroad Xoffroad commented Mar 26, 2026 •

Copy link
Copy Markdown
Contributor

adding active battery control for qcells

@LKuemmel
LKuemmel requested a review from ndrsnhs March 26, 2026 08:35
@Xoffroad

Copy link
Copy Markdown
Contributor Author

Neues Feld entfernt und auf die Nutzung von max_charge_power und max_discharge_power umgebaut.

@seaspotter seaspotter left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Mir sei nochmal der Kommentar erlaubt, dass du damit ja im Prinzip jetzt keine zusätzliche Sicherheitsebene einbaust sondern die bereits vorhandene und funktionierende duplizierst und damit ist sie eigentlich unnötig.
Denn schon in der Regelung in ttps://github.com/openWB/core/blob/f3983a443e8f331c1399aeb428f189872185f2ef/packages/control/bat_all.py ist ja sichergestellt das zum einen wenn keine Max Lade-Entladeleistung definiert ist, eine Warnung kommt und zudem das der übergebene power_limit Wert ans Batteriemodul niemals über der Lade- oder der Entladeleistung liegt. Meines Erachtens ist das damit unötig.
In anderen Modulen hat sich zudem power_value etabliert, clamped als Wert ist nicht wirklich sprechend.

Xoffroad and others added 2 commits March 27, 2026 08:53
@Xoffroad

Xoffroad commented Mar 27, 2026 •

Copy link
Copy Markdown
Contributor Author

Mir sei nochmal der Kommentar erlaubt, dass du damit ja im Prinzip jetzt keine zusätzliche Sicherheitsebene einbaust sondern die bereits vorhandene und funktionierende duplizierst und damit ist sie eigentlich unnötig. Denn schon in der Regelung in ttps://github.com/openWB/core/blob/f3983a443e8f331c1399aeb428f189872185f2ef/packages/control/bat_all.py ist ja sichergestellt das zum einen wenn keine Max Lade-Entladeleistung definiert ist, eine Warnung kommt und zudem das der übergebene power_limit Wert ans Batteriemodul niemals über der Lade- oder der Entladeleistung liegt. Meines Erachtens ist das damit unötig. In anderen Modulen hat sich zudem power_value etabliert, clamped als Wert ist nicht wirklich sprechend.

Jein, mir ist bewusst, das dies an anderer Stelle schon existiert. Ich hatte den Code tatsächlich 1:1 so wie deine Anmerkung jetzt. Aber dann viel mir ein, man kann ja über MQTT die Daten manipulieren und die angesprochene Ermittlung könnte auch mal fehlerhaft sein. Es sollte eine zusätzliche Absicherung sein. Ich habe gestern nochmal die Remotesteuerung von QCells/Solax geprüft. Es scheint so oder so nicht möglich zu sein per Remotecontrol den Wechselrichter dazu zu bringen, Werte zu akzeptieren die außerhalb der festen Einstellungen im Wechselrichter selbst liegen. Solange der Anwender also den Wechselrichter passend zu den Spezifikationen der Batterie konfiguriert hat, ist eine Manipulation außerhalb dieser definierten Grenzen über die Befehle die ich nutze nicht möglich. Somit braucht es die Sicherheitsebene überhaupt nicht.

Edit: die Hinweise in der Oberfläche am Batteriemodul würde ich aber gern lassen, siehe UI Repo.

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

Adds active battery power control support for QCells (Solax-based) batteries by writing Solax/QCells “Mode 8 / Individual Duration” remote control Modbus holding registers.

Changes:

  • Introduces constants for Solax/QCells Mode 8 remote control holding registers (0xA0–0xA7) and default duration/timeout values.
  • Implements set_power_limit() and _write_mode8() in QCellsBat to enable/disable remote control and command charge/discharge power.
  • Marks the QCells battery component as power_limit_controllable().

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

@LKuemmel
LKuemmel merged commit e64fe8a into openWB:feature_bat_control Apr 14, 2026
1 check passed
LKuemmel pushed a commit that referenced this pull request Apr 14, 2026
* 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 <[email protected]>

* Apply suggestions from code review

Co-authored-by: SeaSpotter <[email protected]>

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

Co-authored-by: SeaSpotter <[email protected]>

* Indentation corrected

* remove whitespaces

---------

Co-authored-by: SeaSpotter <[email protected]>
LKuemmel pushed a commit that referenced this pull request May 19, 2026
* 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 <[email protected]>

* Apply suggestions from code review

Co-authored-by: SeaSpotter <[email protected]>

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

Co-authored-by: SeaSpotter <[email protected]>

* Indentation corrected

* remove whitespaces

---------

Co-authored-by: SeaSpotter <[email protected]>
LKuemmel added a commit that referenced this pull request May 20, 2026
* Qcells active battery control (#3244)

* 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 <[email protected]>

* Apply suggestions from code review

Co-authored-by: SeaSpotter <[email protected]>

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

Co-authored-by: SeaSpotter <[email protected]>

* Indentation corrected

* remove whitespaces

---------

Co-authored-by: SeaSpotter <[email protected]>

* Qcells active battery control (#3306)

* 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

* Qcells active battery control - some fixes (#3314)

* 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.

* fix: align QCells Mode 1 battery control with openWB semantics and timing (#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

* fix: switch QCells remote control to Enabled Battery Control (mode 12) (#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

* Implement active battery control via SolaX Remote Control Mode 4 in the 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.

---------

Co-authored-by: Xoffroad <[email protected]>
Co-authored-by: SeaSpotter <[email protected]>
ndrsnhs pushed a commit to ndrsnhs/core that referenced this pull request Aug 24, 2026
* Qcells active battery control (openWB#3244)

* 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 <[email protected]>

* Apply suggestions from code review

Co-authored-by: SeaSpotter <[email protected]>

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

Co-authored-by: SeaSpotter <[email protected]>

* Indentation corrected

* remove whitespaces

---------

Co-authored-by: SeaSpotter <[email protected]>

* Qcells active battery control (openWB#3306)

* 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

* Qcells active battery control - some fixes (openWB#3314)

* 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.

* fix: align QCells Mode 1 battery control with openWB semantics and timing (openWB#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

* fix: switch QCells remote control to Enabled Battery Control (mode 12) (openWB#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

* Implement active battery control via SolaX Remote Control Mode 4 in the SolaX battery module. (openWB#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.

---------

Co-authored-by: Xoffroad <[email protected]>
Co-authored-by: SeaSpotter <[email protected]>
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.

5 participants