feat: add SunEnergyXT 500 Series battery storage module#3387
Draft
ChristophCaina wants to merge 6 commits into
Draft
feat: add SunEnergyXT 500 Series battery storage module#3387ChristophCaina wants to merge 6 commits into
ChristophCaina wants to merge 6 commits into
Conversation
seaspotter
reviewed
May 23, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new openWB device integration for the SunEnergyXT 500 Series battery storage via the device’s local HTTP API, including active power-limit control support.
Changes:
- Introduces a new
sunenergyxtvendor/device module with configuration schema and device descriptor wiring. - Implements a battery component that reads SoC/power from
/readand writes control parameters to/write. - Adds a device configuration Vue component (settings UI) for IP/port/timeout.
Reviewed changes
Copilot reviewed 5 out of 7 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/modules/devices/sunenergyxt/vendor.py | Registers the new vendor metadata and grouping. |
| packages/modules/devices/sunenergyxt/sunenergyxt/device.py | Wires the configurable device and battery component updater. |
| packages/modules/devices/sunenergyxt/sunenergyxt/config.py | Adds device + component configuration classes (IP/port/timeout). |
| packages/modules/devices/sunenergyxt/sunenergyxt/bat.py | Implements HTTP read/write logic, state parsing, and set_power_limit() control. |
| packages/modules/devices/sunenergyxt/sunenergyxt/device.vue | Adds a settings UI component for configuring the device connection. |
| packages/modules/devices/sunenergyxt/init.py | Package marker. |
| packages/modules/devices/sunenergyxt/sunenergyxt/init.py | Package marker. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Removed default values for ip_address, port, and timeout in SunEnergyXTConfiguration.
refactor(sunenergyxt): apply Copilot review suggestions to bat.py - Replace raw `requests` with `req.get_http_session()` to align with openWB HTTP session conventions (timeout, error handling) - Remove `max_charge_power` / `max_discharge_power` assignments – BatState does not expose these fields - Replace magic constant `9999` with dynamic `self._gs_max`, derived from device field IS (max. inverter power) on each update(). IS reflects both model (500 / 500 Pro) and number of modules (BN), so no manual calculation needed. Falls back to 800W until first update. - Remove `self._timeout` – timeout is now a fixed inline value (5s)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds support for the SunEnergyXT 500 Series (including the 500 PRO) battery storage system to openWB.
Communication
The device exposes a local HTTP API — no cloud dependency, no Modbus:
http://<IP>/readhttp://<IP>/writeFeatures
Read (passive monitoring)
SC)PB)IS)Active control (
power_limit_controllable = True)The module supports full active battery control by openWB:
None— automaticMM=1, GS=00— stop dischargeMM=0, GS=0> 0— discharge N WMM=0, GS=+N< 0— charge N WMM=0, GS=-NConfiguration
805UI
A Vue configuration page is provided via a separate PR to
openwb-ui-settings: ChristophCaina/openwb-ui-settingsTesting
power_limit_controllable) recognized by openWBrequires a real charging session with physical hardware