Skip to content

Commit 3679ac1

Browse files
committed
fix: scope EVC cumulative-energy big word order to GEN1 only
The order32="big" override on charge_added_cum (from #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 #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 #2230 (word-order part).
1 parent d35604f commit 3679ac1

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

custom_components/solax_modbus/plugin_solax_ev_charger.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1118,6 +1118,19 @@ def value_function_sync_rtc_evc(initval: Any, descr: Any, datadict: dict[str, An
11181118
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
11191119
device_class=SensorDeviceClass.ENERGY,
11201120
state_class=SensorStateClass.TOTAL_INCREASING,
1121+
allowedtypes=GEN1,
1122+
),
1123+
SolaXEVChargerModbusSensorEntityDescription(
1124+
name="Charge Added - Cumulative",
1125+
key="charge_added_cum",
1126+
register=0x10,
1127+
register_type=REG_INPUT,
1128+
register_data_type=REGISTER_U32,
1129+
scale=0.1,
1130+
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
1131+
device_class=SensorDeviceClass.ENERGY,
1132+
state_class=SensorStateClass.TOTAL_INCREASING,
1133+
allowedtypes=GEN2,
11211134
),
11221135
SolaXEVChargerModbusSensorEntityDescription(
11231136
name="Charge Added Total",

0 commit comments

Comments
 (0)