GECloud: fix grid/load double-counting when multiple inverters share a CT clamp (no EMS)#3855
Merged
springfall2008 merged 3 commits intomainfrom May 3, 2026
Merged
Conversation
… CT clamp (no EMS) Agent-Logs-Url: https://github.com/springfall2008/batpred/sessions/8c8474e2-e731-4bcb-8158-f633401fb7be Co-authored-by: springfall2008 <48591903+springfall2008@users.noreply.github.com>
… log message Agent-Logs-Url: https://github.com/springfall2008/batpred/sessions/8c8474e2-e731-4bcb-8158-f633401fb7be Co-authored-by: springfall2008 <48591903+springfall2008@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix double-counting of grid power with two battery inverters
GECloud: fix grid/load double-counting when multiple inverters share a CT clamp (no EMS)
May 3, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes incorrect grid/load aggregation in GE Cloud automatic configuration when multiple GE hybrid inverters share a single physical CT clamp (and no Plant EMS is present). This prevents grid_power, load_power, and daily energy totals from being double-counted across inverters.
Changes:
- Extend
GECloudDirect.async_get_devices()to return abattery_metersmapping of inverter/battery serial → connected meter serial numbers. - Add shared-CT detection in
GECloudDirect.async_automatic_config()for multi-inverter, non-EMS setups and apply the existing “single source + zeros” pattern to grid/load sensors and related energy totals. - Update/add GE Cloud tests to cover empty/unique/duplicate meter-serial scenarios and validate the new behavior.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| apps/predbat/gecloud.py | Adds battery_meters to device discovery and uses it to detect shared-CT setups to avoid grid/load double-counting. |
| apps/predbat/tests/test_ge_cloud.py | Updates device-discovery expectations and adds/adjusts multi-inverter auto-config tests for shared vs dedicated meters. |
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.
With two GE hybrid inverters sharing a single physical grid CT clamp and no Plant EMS,
grid_power,import_today,export_today,load_today, andload_powerwere summed across all inverters — producing 2× the real value since both inverters return identical readings from the shared CT.The EMS path already handled this correctly via a "single source + zeros" pattern; the non-EMS multi-inverter path did not.
Changes
gecloud.py—async_get_devices()Returns a new
battery_meterskey: a dict mapping each battery serial to its list of meter serial numbers extracted fromconnections.metersin the GE Cloud API response.gecloud.py—async_automatic_config()Adds shared-CT detection when
num_inverters > 1and no EMS is present:no_dedicated_meters— all batteries haveconnections.meters: [](typical GE hybrid setup)has_duplicate_serials— any meter serial number appears on more than one inverterWhen either condition is true, applies the same pattern the EMS path uses:
Per-inverter sensors (
battery_power,pv_power,pv_today, SOC, etc.) are unaffected.test_ge_cloud.py_test_async_get_devices_empty/_test_async_get_devices_with_batteriesfor the newbattery_metersreturn fieldWarning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
api.octopus.energy/home/REDACTED/work/batpred/batpred/coverage/venv/bin/python3 python3 ../apps/predbat/unit_test.py --quick(dns block)gitlab.com/usr/lib/git-core/git-remote-https /usr/lib/git-core/git-remote-https origin REDACTED(dns block)https://api.github.com/repos/springfall2008/batpred/contents/apps/predbat/home/REDACTED/work/batpred/batpred/coverage/venv/bin/python3 python3 ../apps/predbat/unit_test.py --test ge_cloud(http block)/home/REDACTED/work/batpred/batpred/coverage/venv/bin/python3 python3 ../apps/predbat/unit_test.py --quick(http block)/home/REDACTED/work/batpred/batpred/coverage/venv/bin/python3 python3 ../apps/predbat/unit_test.py --test ge_cloud --test solax --test solis --test gateway(http block)If you need me to access, download, or install something from one of these locations, you can either: