Skip to content

Claude/investigate grid import tr3rm - #2

Merged
xntrik merged 2 commits into
mainfrom
claude/investigate-grid-import-Tr3rm
Apr 21, 2026
Merged

xntrik merged 2 commits into
mainfrom
claude/investigate-grid-import-Tr3rm

Conversation

@xntrik

@xntrik xntrik commented Apr 21, 2026

Copy link
Copy Markdown
Owner

No description provided.

claude added 2 commits April 19, 2026 09:28
The Growatt API occasionally returns spurious spikes in the instantaneous
pacToUserTotal field (observed values >6000 W while simultaneously
exporting). These spikes were being plotted as "Grid Import" and
integrated into bogus kWh totals that didn't match the device's own
etoUserToday counter.

Instead of trusting the instantaneous power fields for the chart, diff
the cumulative daily counters (etoUserToday / etoGridToday) between
consecutive samples to derive average power over each interval. The
chart series now integrates back to the counter total by construction,
so the summary card and the chart estimate agree.

https://claude.ai/code/session_01MryGckmy51CK79w35d2g54
Pure counter-delta derivation loses resolution for grid flows below the
counter's 0.1 kWh tick (e.g. ~1200 W for a 5-min interval). Fall back to
the instantaneous pacToUserTotal / pacToGridTotal reading when the
counter is flat, but clamp it to the per-interval ceiling implied by the
counter quantum: if the counter did not tick, the true average power
must have been below that ceiling, so any larger value is a spurious
spike. This preserves low-power resolution while still suppressing the
6 kW+ bogus spikes observed from the API.

https://claude.ai/code/session_01MryGckmy51CK79w35d2g54
@xntrik
xntrik merged commit b8c700b into main Apr 21, 2026
1 check passed
@xntrik
xntrik deleted the claude/investigate-grid-import-Tr3rm branch April 21, 2026 12:15
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