Fix 10x internal AC voltage/frequency on AC500 - #75
Open
viliusdidit wants to merge 1 commit into
Open
Conversation
DecimalField's parse computes (raw / 10**scale) * multiplier. AC500 defines INTERNAL_AC_VOLTAGE (scale=1) and INTERNAL_AC_FREQUENCY (scale=2) with multiplier=10, which cancels the scale: the AC500 reports these registers in tenths/hundredths (like AC300), so values render 10x too high (2334 V instead of 233.4 V, 500 Hz instead of 50.0 Hz). AC200L/M/PL keep their multiplier: that family reports integer volts and the multiplier was added deliberately from device feedback (see hassio-bluetti-bt#145 / commit b37276e). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
viliusdidit
force-pushed
the
fix/internal-ac-10x
branch
from
July 11, 2026 16:37
4a379bd to
fbc9975
Compare
|
I do have two AC500 which report it wrong. But I also have an AC200M which reports it correctly. If you need more info, just let me know what I should do/which info you require. |
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.
Problem
DecimalField.parse()computes(raw / 10**scale) * multiplier. AC500 defines:The AC500 reports these registers in tenths/hundredths (same as AC300), so the
multiplier=10cancels the scale and both values render 10x too high — 230.4 V shows as 2304 V, 50.0 Hz as 500 Hz.Fixes Patrick762/hassio-bluetti-bt#248.
Verification
Measured on a real AC500 (grid-tied): with this fix
internal_ac_voltagereads 233–238 V, tracking the same unit'sac_input_voltage(no multiplier, always correct) within 0.3 V, andinternal_ac_frequencyreads 50.0 Hz matchingac_input_frequency. Without it, the same polls render 2334–2380 V / 500 Hz.Parse sanity check: raw
2334→233.4, raw5001→50.01. Full test suite passes (73 passed).Why AC500 only (and #145)
AC200L/M/PL share the same field pattern but there the
multiplier=10is intentional: that family reports integer volts, and the multiplier was added from device feedback to correct 23 V → 230 V (Patrick762/hassio-bluetti-bt#145, integration commit b37276e) — the exact opposite direction of the AC500 bug. That likely means #145 is already resolved on current 0.2.x and just needs reporter confirmation; if reports still show wrong values there, the fix would mirror this one on the AC200x definitions. I'm leaving those untouched — I have no AC200-series hardware to verify against, and this family has already been bitten once by cross-device assumptions.🤖 Generated with Claude Code