Skip to content

Fix 3-phase AC sensors showing zero/unknown on MOD and SPH TL3 - #22

Merged
0xAHA merged 1 commit into
devfrom
claude/review-diagnostic-py-011CUrJUKdYcXFzhnaG5vzib
Nov 10, 2025
Merged

Fix 3-phase AC sensors showing zero/unknown on MOD and SPH TL3#22
0xAHA merged 1 commit into
devfrom
claude/review-diagnostic-py-011CUrJUKdYcXFzhnaG5vzib

Conversation

@0xAHA

@0xAHA 0xAHA commented Nov 10, 2025

Copy link
Copy Markdown
Owner

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 configs

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 configs
@0xAHA
0xAHA merged commit 19532b0 into dev Nov 10, 2025
4 checks passed
0xAHA added a commit that referenced this pull request Mar 22, 2026
…UKdYcXFzhnaG5vzib

Fix 3-phase AC sensors showing zero/unknown on MOD and SPH TL3
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.

2 participants