Skip to content

Fix 10x internal AC voltage/frequency on AC500 - #75

Open
viliusdidit wants to merge 1 commit into
Patrick762:mainfrom
viliusdidit:fix/internal-ac-10x
Open

Fix 10x internal AC voltage/frequency on AC500#75
viliusdidit wants to merge 1 commit into
Patrick762:mainfrom
viliusdidit:fix/internal-ac-10x

Conversation

@viliusdidit

@viliusdidit viliusdidit commented Jul 11, 2026

Copy link
Copy Markdown

Problem

DecimalField.parse() computes (raw / 10**scale) * multiplier. AC500 defines:

DecimalField(FieldName.INTERNAL_AC_VOLTAGE, 71, 1, 10),
DecimalField(FieldName.INTERNAL_AC_FREQUENCY, 74, 2, 10),

The AC500 reports these registers in tenths/hundredths (same as AC300), so the multiplier=10 cancels 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_voltage reads 233–238 V, tracking the same unit's ac_input_voltage (no multiplier, always correct) within 0.3 V, and internal_ac_frequency reads 50.0 Hz matching ac_input_frequency. Without it, the same polls render 2334–2380 V / 500 Hz.

Parse sanity check: raw 2334233.4, raw 500150.01. Full test suite passes (73 passed).

Why AC500 only (and #145)

AC200L/M/PL share the same field pattern but there the multiplier=10 is 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

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
viliusdidit force-pushed the fix/internal-ac-10x branch from 4a379bd to fbc9975 Compare July 11, 2026 16:37
@viliusdidit viliusdidit changed the title Fix 10x internal AC voltage/frequency on AC500, AC200L, AC200M, AC200PL Fix 10x internal AC voltage/frequency on AC500 Jul 11, 2026
@matthiasexl

Copy link
Copy Markdown

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.

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.

[Bug]: internal_ac_voltage and internal_ac_frequency are also not correct for AC500

2 participants