Commit 490aa70
fix: correct 32-bit register decoding errors (EVC EQ_Total, MIC GEN2 meter power, hybrid reactive power)
Three independent 32-bit decoding bugs, all producing absurd values,
all verified against protocol documents and real hardware:
1. EV charger cumulative energy (0x0010 EQ_Total, input u32): the
charger transmits this register high-word-first, contradicting the
doc (EVC_Modbus_V3.5: 0x10=Lo/0x11=Hi) and the same counter's
little-ordered holding copy at 0x0619. Raw 3 (0.3 kWh) displayed as
19660.8 kWh. Adds an optional per-sensor order32 override to
BaseModbusSensorEntityDescription (the read path already honored it
via getattr; only the dataclass field was missing) and sets
order32="big" on charge_added_cum.
2. MIC GEN2 X3 meter phase powers were read one register early: the
MIC-G2 V3.1 doc explicitly places the data words at
R=(0x705:LSB,0x706:MSB), S=(0x707,0x708), T=(0x709,0x70A), while
measured_power_l1/l2/l3 read 0x704/0x706/0x708 - straddling two
different phases (149 MW on an 8 kW inverter). The "_alt" sensors
at 0x705/0x707/0x709 were pointing at the correct addresses all
along; the primaries now use those addresses and the redundant
_alt entities are removed.
3. Hybrid per-phase meter reactive power: the S32 variants at
0xC0/0xC2 gated modbus_min=100..101 are undocumented (V1.02 only
documents 0xDE/0xE0) and contradicted by a real protocol-100
device, which still serves the legacy per-phase S16 layout there
(the S32 read merged two neighbouring S16s into 26 Mvar). Legacy
S16 definitions now cover protocol <= 101; the documented S32
registers (0xDE/0xE0/0xD4) start at protocol 102.
Verified live on X3 EVC 11kW, X3-MIC/PRO-G2 and X3-Hybrid-G4 15kW.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>1 parent 2178c86 commit 490aa70
3 files changed
Lines changed: 19 additions & 68 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
204 | 204 | | |
205 | 205 | | |
206 | 206 | | |
| 207 | + | |
207 | 208 | | |
208 | 209 | | |
209 | 210 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8039 | 8039 | | |
8040 | 8040 | | |
8041 | 8041 | | |
8042 | | - | |
8043 | | - | |
8044 | | - | |
8045 | | - | |
8046 | | - | |
8047 | | - | |
8048 | | - | |
8049 | | - | |
8050 | | - | |
8051 | | - | |
8052 | | - | |
8053 | | - | |
8054 | | - | |
8055 | | - | |
8056 | 8042 | | |
8057 | 8043 | | |
8058 | 8044 | | |
| |||
8079 | 8065 | | |
8080 | 8066 | | |
8081 | 8067 | | |
8082 | | - | |
8083 | | - | |
8084 | | - | |
8085 | | - | |
8086 | | - | |
8087 | | - | |
8088 | | - | |
8089 | | - | |
8090 | | - | |
8091 | | - | |
8092 | | - | |
8093 | | - | |
8094 | | - | |
8095 | | - | |
8096 | 8068 | | |
8097 | 8069 | | |
8098 | 8070 | | |
| |||
8119 | 8091 | | |
8120 | 8092 | | |
8121 | 8093 | | |
8122 | | - | |
| 8094 | + | |
8123 | 8095 | | |
8124 | 8096 | | |
8125 | 8097 | | |
| |||
8132 | 8104 | | |
8133 | 8105 | | |
8134 | 8106 | | |
8135 | | - | |
| 8107 | + | |
8136 | 8108 | | |
8137 | 8109 | | |
8138 | 8110 | | |
| |||
10194 | 10166 | | |
10195 | 10167 | | |
10196 | 10168 | | |
10197 | | - | |
| 10169 | + | |
10198 | 10170 | | |
10199 | 10171 | | |
10200 | 10172 | | |
| 10173 | + | |
| 10174 | + | |
| 10175 | + | |
10201 | 10176 | | |
10202 | 10177 | | |
10203 | 10178 | | |
10204 | 10179 | | |
10205 | 10180 | | |
10206 | 10181 | | |
10207 | 10182 | | |
10208 | | - | |
| 10183 | + | |
10209 | 10184 | | |
10210 | 10185 | | |
10211 | 10186 | | |
| 10187 | + | |
| 10188 | + | |
| 10189 | + | |
10212 | 10190 | | |
10213 | 10191 | | |
10214 | 10192 | | |
10215 | 10193 | | |
10216 | 10194 | | |
10217 | 10195 | | |
10218 | 10196 | | |
10219 | | - | |
10220 | | - | |
10221 | | - | |
10222 | | - | |
10223 | | - | |
10224 | | - | |
10225 | | - | |
10226 | | - | |
10227 | | - | |
10228 | | - | |
10229 | | - | |
10230 | | - | |
10231 | | - | |
10232 | | - | |
10233 | | - | |
10234 | | - | |
10235 | | - | |
10236 | | - | |
10237 | | - | |
10238 | | - | |
10239 | | - | |
10240 | | - | |
10241 | | - | |
10242 | | - | |
| 10197 | + | |
10243 | 10198 | | |
10244 | 10199 | | |
10245 | | - | |
10246 | 10200 | | |
10247 | | - | |
10248 | | - | |
10249 | | - | |
10250 | | - | |
10251 | | - | |
10252 | | - | |
10253 | | - | |
10254 | | - | |
10255 | | - | |
10256 | | - | |
| 10201 | + | |
| 10202 | + | |
10257 | 10203 | | |
10258 | | - | |
10259 | 10204 | | |
10260 | 10205 | | |
10261 | 10206 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1135 | 1135 | | |
1136 | 1136 | | |
1137 | 1137 | | |
| 1138 | + | |
| 1139 | + | |
| 1140 | + | |
| 1141 | + | |
| 1142 | + | |
1138 | 1143 | | |
1139 | 1144 | | |
1140 | 1145 | | |
| |||
0 commit comments