Skip to content

Sigenergy MQTT fixes, fix zero rate export#4172

Merged
springfall2008 merged 3 commits into
mainfrom
fix/misc5
Jul 2, 2026
Merged

Sigenergy MQTT fixes, fix zero rate export#4172
springfall2008 merged 3 commits into
mainfrom
fix/misc5

Conversation

@springfall2008

Copy link
Copy Markdown
Owner

No description provided.

Copilot AI review requested due to automatic review settings July 2, 2026 16:01

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

This PR updates the Sigenergy integration’s MQTT ingestion and sign-handling, adds tests for MQTT delta message behavior and topic scoping, and adjusts export-rate fallback handling (plus a version bump).

Changes:

  • Sigenergy MQTT: merge partial period updates, subscribe per managed system (no # wildcard), and defensively ignore messages for out-of-scope systems.
  • Sigenergy sign-convention adjustments for battery/grid power across MQTT and REST ingestion paths, with expanded test coverage.
  • Allow “all zero” export rates via rates_export basic-rate fallback; bump Predbat version to v8.44.0.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 10 comments.

File Description
apps/predbat/tests/test_sigenergy.py Updates/adds tests around sign conventions, MQTT delta merging, and subscription scoping.
apps/predbat/sigenergy.py Implements MQTT delta merging, scoped subscriptions, and sign-convention changes in ingestion/publishing.
apps/predbat/predbat.py Version bump to v8.44.0.
apps/predbat/fetch.py Export-rate fallback now permits zero-only export rates by always running basic_rates(...).

Comment thread apps/predbat/sigenergy.py
Comment thread apps/predbat/tests/test_sigenergy.py
"batteryPower": 2.0, # kW discharging (Predbat convention: positive=discharge)
"pvPower": 3.5, # kW
"gridPower": 1.0, # kW export (positive=export, will be inverted to negative)
"gridPower": 1.0, # kW export (Predbat convention: positive=export)
Comment thread apps/predbat/sigenergy.py
Comment thread apps/predbat/sigenergy.py
Comment on lines +1165 to +1169
Field sign convention matches Predbat's own battery_power/grid_power convention:
batteryPower — positive = discharging, negative = charging
gridPower — positive = export, negative = import
pvPower — always positive
loadPower — derived as ``pvPower − batteryPower − gridPower``

loadPower — derived as ``pvPower + batteryPower - gridPower``
Comment thread apps/predbat/sigenergy.py Outdated
Comment thread apps/predbat/sigenergy.py
Comment on lines 1367 to 1369
# Refresh system list for subscription if not yet known
if not system_id_list:
system_id_list = list(self.systems.keys())
Comment thread apps/predbat/tests/test_sigenergy.py
Comment thread apps/predbat/tests/test_sigenergy.py
Comment thread apps/predbat/tests/test_sigenergy.py
@springfall2008 springfall2008 merged commit 1c57be0 into main Jul 2, 2026
2 checks passed
@springfall2008 springfall2008 deleted the fix/misc5 branch July 2, 2026 16:10
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