Repository navigation
Fix/fox half kw capacity - #4534
Closed
springfall2008 wants to merge 2 commits into
Closed
springfall2008 wants to merge 2 commits into
springfall2008 wants to merge 2 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR improves the Fox ESS integration by correcting inverter capacity handling for half‑kW models (e.g., KH10.5 reporting a truncated integer capacity) and by rounding production “today/month” totals to avoid floating-point artifacts in published sensor states.
Changes:
- Add
FoxAPI.capacity_watts()and use it when clamping scheduler power limits and publishing inverter capacity. - Round Fox production totals for “_today” and “_month” sensors to 2 decimal places via
dp2(). - Extend Fox API test coverage with targeted cases for half‑kW capacity correction and production rounding.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| apps/predbat/fox.py | Adds half‑kW capacity correction helper, applies it to scheduler clamping and published capacity, and rounds production totals. |
| apps/predbat/tests/test_fox_api.py | Adds regression tests for half‑kW capacity correction, scheduler clamping behavior, and production rounding. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
908
to
+910
| if result is not None: | ||
| self.device_detail[deviceSN] = result | ||
| self.log("Fox: Device detail {}".format(result)) |
…n totals Fox's device/detail 'capacity' field is a truncated integer, so a 10.5kW KH10.5 inverter reported as 10kW everywhere - both the reported inverter_capacity/inverter_limit sensor and the fdpwr_max clamp that was silently capping the correct 10500W scheduler value down to 10000W. Now corrects the value from deviceType when it ends in '.5'. Also round the _today/_month production sensors (e.g. generation_today) which were carrying long floating-point summation artifacts from Fox's raw history data. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…e margin Cap at inverter_capacity directly now that capacity_watts() already corrects half-kW deviceTypes - the earlier +999W tolerance was a blunter hack that could let a genuinely bogus fdpwr reading through undetected.
springfall2008
force-pushed
the
fix/fox-half-kw-capacity
branch
from
August 15, 2026 14:30
9d96930 to
f3eee8f
Compare
Owner
Author
|
Superseded by #4532 - rebasing onto main leaves this PR empty (identical tree). |
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.