Sigenergy MQTT fixes, fix zero rate export#4172
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
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
periodupdates, 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_exportbasic-rate fallback; bump Predbat version tov8.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(...). |
| "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 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 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()) |
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.
No description provided.