Commit 5b78a61
committed
Fix 3-phase AC sensors showing zero/unknown on MOD and SPH TL3
PROBLEM:
User reported 3-phase AC voltage, current, and power sensors showing as
"unknown" or not appearing at all on MOD 6000-15000TL3-XH inverter.
Register scan showed valid AC data but sensors weren't created.
ROOT CAUSES:
1. Register name mismatch:
- Profiles defined: 'ac_voltage_r', 'ac_current_r', 'ac_power_r_low'
- Code looked for: 'ac_voltage', 'ac_current', 'ac_power_low'
- Result: Registers not found → zero values
2. Missing dataclass fields:
- GrowattData only had generic ac_voltage/current/power
- No individual phase fields (ac_voltage_r/s/t, etc.)
3. Missing sensors from profile:
- THREE_PHASE_SENSORS didn't include 'ac_voltage_r/s/t'
- Sensors defined but not enabled
4. No code to read individual phases:
- Only generic AC reading code existed
- Individual 3-phase registers never accessed
FIXES:
1. Enhanced register lookup to support aliases:
- _find_register_by_name() now checks both 'name' and 'alias'
- Allows phase-specific registers to be found by generic names
2. Added generic aliases in profiles (MOD and SPH TL3):
- ac_voltage_r → alias 'ac_voltage'
- ac_current_r → alias 'ac_current'
- ac_power_r_low → alias 'ac_power_low'
- Phase R serves as "main" AC output for compatibility
3. Added 3-phase fields to GrowattData dataclass:
- ac_voltage_r/s/t, ac_current_r/s/t, ac_power_r/s/t
- ac_voltage_rs/st/tr (line-to-line)
4. Added code to read individual 3-phase registers:
- Reads all phases R, S, T individually
- Reads line-to-line voltages
- Populates all phase-specific dataclass fields
5. Updated THREE_PHASE_SENSORS:
- Added 'ac_voltage_r', 'ac_voltage_s', 'ac_voltage_t'
- Now all phase sensors are enabled
RESULT:
- Generic AC sensors (ac_voltage/current/power) now work via Phase R alias
- Individual phase sensors (R/S/T) now populate with correct values
- All 3-phase inverters (MOD, SPH TL3) get full 3-phase monitoring
- Backwards compatible with existing configs1 parent 7b73fc3 commit 5b78a61
4 files changed
Lines changed: 84 additions & 17 deletions
File tree
- custom_components/growatt_modbus
- profiles
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
| 62 | + | |
62 | 63 | | |
63 | | - | |
64 | | - | |
| 64 | + | |
| 65 | + | |
65 | 66 | | |
66 | 67 | | |
67 | 68 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
75 | | - | |
| 75 | + | |
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
80 | 96 | | |
81 | 97 | | |
82 | 98 | | |
| |||
496 | 512 | | |
497 | 513 | | |
498 | 514 | | |
499 | | - | |
| 515 | + | |
500 | 516 | | |
501 | 517 | | |
502 | 518 | | |
503 | 519 | | |
504 | | - | |
| 520 | + | |
505 | 521 | | |
506 | 522 | | |
507 | 523 | | |
| |||
510 | 526 | | |
511 | 527 | | |
512 | 528 | | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
513 | 574 | | |
514 | 575 | | |
515 | 576 | | |
| |||
611 | 672 | | |
612 | 673 | | |
613 | 674 | | |
614 | | - | |
| 675 | + | |
615 | 676 | | |
616 | 677 | | |
| 678 | + | |
617 | 679 | | |
618 | 680 | | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
619 | 684 | | |
620 | 685 | | |
621 | 686 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
46 | 47 | | |
47 | 48 | | |
48 | 49 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| |||
0 commit comments