Commit e8b4b38
fix: EVC energy word order, unreachable protocol gates, reactive power, MIC-G2 sensors
Seven hardware-verified fixes (raw Modbus TCP reads cross-checked
against the official protocol documents):
1. EVC Charge Added - Cumulative read 19660.8 kWh instead of 0.3 kWh:
the charger sends EQ_Total (0x10, u32) high-word-first. Adds the
per-sensor order32 override field (read path already honored it)
and sets order32="big" on charge_added_cum.
2. modbus_min=101/102 gates were unreachable: no device reports more
than 100 from register 0x82 (the values conflated the protocol
register with the document revision). Relaxed to 100 after raw-read
verification; misleading dataclass comments corrected; peakshaving
complementary pairs re-split at the documented boundary
(unscaled max=99, X1/X3-scaled min=100).
3. Grid Reactive Power L1/L2 showed ~26 Mvar: 0xC0/0xC2-as-S32 merged
two S16 values. L1/L2 now use the documented S32 registers 0xDE/0xE0
for protocol >=100 (raw-verified, phases sum to total) and the
legacy S16 quad for <=99; the V1.00-derived 0xC0/0xC2 S32 defs are
removed (doc error confirmed, resolves the open question in #2099).
4. MIC pv_total_power removed: exact computed duplicate of
pv_power_total (same value_function, same device).
5. MIC-G2 measured power: doc V4.0 marks the whole 0x700-0x70A block
as EVC-only; live testing shows the block has no address decoder
(any read returns the current internal frame) and no frame contains
per-phase power. The _alt sensors, built on the doc's off-by-one
parentheticals, are removed; the primaries are renamed to the doc's
terminology (Feed-in Power L1/L2/L3, Int32 per the authoritative
address column) and stay default-disabled. The verified-correct
meter registers - Feed-in Power 0x43B (doc "Feed In Power", Int32)
and the 0x43D/0x43F energy counters (Uint32) - are renamed per the
doc and now enabled by default (they read clean zeros without a
meter). All 32-bit MIC registers cross-checked for signedness.
6. MIC-G2 Q Curve select always showed unknown: readback 0x347 is
byte-packed (mode in low byte, Pf in high byte) but was decoded as
full u16. Now REGISTER_U8L.
7. RTC sensors (hybrid 0x85, MIC 0x318) are now proper TIMESTAMP
entities: value_function_rtc returns a timezone-aware datetime
(host local zone attached - the device stores host-local time,
verified live; Sync RTC writes datetime.now()), matching the EV
charger's RTC implementation.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>1 parent 2178c86 commit e8b4b38
4 files changed
Lines changed: 58 additions & 118 deletions
File tree
- custom_components/solax_modbus
- tests/unit
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
204 | 204 | | |
205 | 205 | | |
206 | 206 | | |
207 | | - | |
208 | | - | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
209 | 210 | | |
210 | 211 | | |
211 | 212 | | |
| |||
252 | 253 | | |
253 | 254 | | |
254 | 255 | | |
255 | | - | |
256 | | - | |
| 256 | + | |
| 257 | + | |
257 | 258 | | |
258 | 259 | | |
259 | 260 | | |
| |||
268 | 269 | | |
269 | 270 | | |
270 | 271 | | |
271 | | - | |
272 | | - | |
| 272 | + | |
| 273 | + | |
273 | 274 | | |
274 | 275 | | |
275 | 276 | | |
| |||
288 | 289 | | |
289 | 290 | | |
290 | 291 | | |
291 | | - | |
292 | | - | |
| 292 | + | |
| 293 | + | |
293 | 294 | | |
294 | 295 | | |
295 | 296 | | |
| |||
307 | 308 | | |
308 | 309 | | |
309 | 310 | | |
310 | | - | |
311 | | - | |
| 311 | + | |
| 312 | + | |
312 | 313 | | |
313 | 314 | | |
314 | 315 | | |
| |||
336 | 337 | | |
337 | 338 | | |
338 | 339 | | |
339 | | - | |
340 | | - | |
| 340 | + | |
| 341 | + | |
341 | 342 | | |
342 | 343 | | |
343 | 344 | | |
| |||
585 | 586 | | |
586 | 587 | | |
587 | 588 | | |
588 | | - | |
589 | | - | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
590 | 598 | | |
591 | 599 | | |
592 | 600 | | |
| |||
0 commit comments