Skip to content

E3DC: aktive Speichersteuerung über RSCP - #4152

Merged
LKuemmel merged 2 commits into
openWB:masterfrom
seaspotter:e3dc-rscp-bat-control
Nov 11, 2026
Merged

LKuemmel merged 2 commits into
openWB:masterfrom
seaspotter:e3dc-rscp-bat-control

Conversation

@seaspotter

@seaspotter seaspotter commented Oct 20, 2026 •

Copy link
Copy Markdown
Collaborator

UI: openWB/openwb-ui-settings#1135

Aktive Speichersteuerung für E3DC per RSCP (SET_POWER Mode+Value), zusätzlich zum bestehenden Modbus-Lesepfad. Optionale portal_username/portal_password/rscp_key-Config – ohne sie wird der Speicher weiterhin normal ausgelesen, ist aber nicht steuerbar. Mode/Value-Semantik und RSCP-Tags an echter Hardware verifiziert in #3450

Neu hinzugekommene Abhängigkeiten: pye3dc, py3rijndael, tzlocal, websocket-client.
Achtung Python 3.9: die neueste pye3dc-Version (0.10.0) sowie deren neueste eigene Abhängigkeiten (tzlocal, websocket-client) benötigen Python ≥3.10, was mit openWBs Python 3.9 nicht funktioniert. Deshalb auf die jeweils neuesten noch 3.9-kompatiblen Versionen gepinnt (pye3dc==0.9.3, tzlocal==5.3.1, websocket-client==1.9.0), API ist identisch.

Test an echter E3DC-Hardware war mir nicht möglich

Summary by Sourcery

Add optional RSCP-based active power control for E3DC batteries alongside existing Modbus monitoring.

New Features:

  • Enable active E3DC battery power control over RSCP, including automatic, idle, charge, and discharge modes.
  • Add optional E3DC portal credentials and RSCP key configuration for controllable batteries while preserving Modbus-only operation without credentials.

Enhancements:

  • Add datastore migration support for the new E3DC control settings.
  • Pin RSCP-related dependencies to versions compatible with Python 3.9.

Build:

  • Add the E3DC RSCP client and supporting encryption, timezone, and WebSocket dependencies.

Tests:

  • Add coverage for credential-gated battery controllability, RSCP mode translation, and connection reuse.

@seaspotter
seaspotter requested a review from ndrsnhs October 20, 2026 17:58
@LKuemmel
LKuemmel removed the request for review from ndrsnhs November 11, 2026 09:27
@seaspotter
seaspotter force-pushed the e3dc-rscp-bat-control branch from 3cf6429 to aa1604a Compare November 11, 2026 09:44
@sourcery-ai

sourcery-ai Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

Reviewer's Guide

Schema and migrations

Bump the datastore version and backfill the three optional RSCP credential fields for existing E3DC battery configurations.

  • packages/helpermodules/update_config.py L66, L4190-4217

Data structures

Add optional portal credentials and the local RSCP key to the E3DC battery configuration structure.

  • packages/modules/devices/e3dc/e3dc/config.py L1-2, L32-44

Uses of the API

Pass device configuration to E3DC batteries and connect the battery setpoint interface to the RSCP controller only when credentials are configured.

  • packages/modules/devices/e3dc/e3dc/bat.py L64-83 (+5 small edits)
  • packages/modules/devices/e3dc/e3dc/device.py L29-30

Implementation

Implement lazy local RSCP connection reuse and map battery setpoints to E3DC automatic, idle, discharge, and charge requests.

  • packages/modules/devices/e3dc/e3dc/rscp_power_control.py L1-55

Configuration

Pin the RSCP client and its dependencies to versions compatible with Python 3.9.

  • requirements.txt L30-33

Tests

Test credential-dependent controllability, setpoint forwarding, and reuse of the RSCP controller.

  • packages/modules/devices/e3dc/e3dc/bat_test.py L1-54

Test RSCP mode/value translation and lazy connection reuse.

  • packages/modules/devices/e3dc/e3dc/rscp_power_control_test.py L1-53

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@LKuemmel
LKuemmel merged commit 6d6fc2c into openWB:master Nov 11, 2026
2 checks passed
@seaspotter
seaspotter deleted the e3dc-rscp-bat-control branch November 11, 2026 10:14
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.

2 participants