Skip to content

fix: scope EVC cumulative-energy big word order to GEN1 only - #2235

Closed
Bl00d-B0b wants to merge 1 commit into
wills106:mainfrom
Bl00d-B0b:fix/evc-cum-word-order-gen1-only
Closed

fix: scope EVC cumulative-energy big word order to GEN1 only#2235
Bl00d-B0b wants to merge 1 commit into
wills106:mainfrom
Bl00d-B0b:fix/evc-cum-word-order-gen1-only

Conversation

@Bl00d-B0b

@Bl00d-B0b Bl00d-B0b commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Fixes the word-order half of #2230; follow-up to the discussion on #2178.

The order32="big" override on charge_added_cum was hardware-verified on my X3-EVC-11kW Gen1 (serial C31103*, ARM v1.18, register 0x25 = 118, classified GEN1 by the plugin): at the same instant, the input copy 0x10-0x11 read [0, 3] (high-word-first, 0.3 kWh only when decoded big) while its holding twin 0x619-0x61A read [3, 0] and decoded to the correct 0.3 kWh little-endian. On that unit the documented order is demonstrably wrong for the input copy.

#2230 shows the opposite population: an X3-HAC 22kW Gen2 (ARM v2.03) follows the documented little order, so the global override inflated its lifetime total by exactly a factor of 65536 (322.6 kWh became 21,141,913.6 - the reporter's cross-check against the independent HTTP integration makes it airtight).

Fix: the definition is split per generation - GEN1 keeps order32="big" (hardware-verified), GEN2 returns to the documented default order. If more firmware populations surface (e.g. #2213, where neither order looks plausible), the same split can be refined per firmware version.

@TCWORLD

TCWORLD commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

I'd already opened a PR to fix this.

The order32="big" override on charge_added_cum (from wills106#2178) was
verified on an X3-EVC-11kW Gen1 (serial C311*, ARM v1.18): at the same
instant the input copy 0x10-0x11 read [0, 3] (high-word-first) while
its holding twin 0x619-0x61A read [3, 0] and decoded to the correct
0.3 kWh little-endian.

Issue wills106#2230 shows the opposite population: an X3-HAC 22kW Gen2
(ARM v2.03) follows the documented little order, so the global
override inflated its lifetime total by a factor of 65536
(322.6 kWh -> 21,141,913.6).

The definition is now split per generation: GEN1 keeps order32="big"
(hardware-verified), GEN2 returns to the documented default order.

Fixes wills106#2230 (word-order part).
@Bl00d-B0b
Bl00d-B0b force-pushed the fix/evc-cum-word-order-gen1-only branch from 276aabf to 3679ac1 Compare July 30, 2026 13:54
@wills106

wills106 commented Aug 1, 2026

Copy link
Copy Markdown
Owner

Does this need closing down then?

@Bl00d-B0b

Copy link
Copy Markdown
Contributor Author

@wills106 yes - closing. #2234 implements the same generational split (and covers GEN3/GEN4 explicitly, which is the better version) and is already merged; I opened this one before spotting TCWORLD's. Verified #2234 against my Gen1 unit's case: GEN1 keeps the big-endian decode it needs, the HAC Gen2 reports in #2230 get the documented order. Nothing from this PR remains needed.

@Bl00d-B0b Bl00d-B0b closed this Aug 2, 2026
@Bl00d-B0b
Bl00d-B0b deleted the fix/evc-cum-word-order-gen1-only branch August 2, 2026 10:35
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.

3 participants