Skip to content

Add SOFAR 4KTLM-G3 single-phase inverter profile - #802

Open
davisouzatb wants to merge 1 commit into
StephanJoubert:mainfrom
davisouzatb:codex/sofar-4ktlm-g3
Open

davisouzatb wants to merge 1 commit into
StephanJoubert:mainfrom
davisouzatb:codex/sofar-4ktlm-g3

Conversation

@davisouzatb

Copy link
Copy Markdown

The SOFAR 4KTLM-G3 is a single-phase, non-hybrid inverter with two MPPT inputs. The legacy sofar_lsw3.yaml register map yields incorrect readings on this model, and the hybrid G3 profile requests battery/off-grid registers that are not appropriate for it.

Add a dedicated sofar_4ktlm-g3.yaml profile with the G3 addresses and scales for PV1/PV2, single-phase AC output, generation counters, inverter status, temperatures and raw fault bitfields. It reads the complete aligned ranges 0x0400–0x042E, 0x0480–0x04AF, 0x0580–0x0589 and 0x0680–0x069B; reads starting inside those blocks returned non-standard error frames with invalid Modbus CRC on the tested logger. Zero fault bitfields map to “No error”, while nonzero values remain raw rather than using the legacy fault descriptions. The profile is automatically included in the existing config-flow lookup list and is documented in the README.

Validation:

  • Hardware: SOFAR 4KTLM-G3 with logger firmware LSW3_15_270A_1.68, Solarman V5, Modbus slave 1 and FC03. All four aligned blocks returned CRC-valid data, with plausible PV/output power, approximately 220 V / 60 Hz, generation counters and temperatures. Hardware checks were read-only.
  • Five regression tests pass against the integration's actual ParameterParser: request ranges/register coverage, two-MPPT/single-phase decoding, 32-bit energy word order, G3 status/fault interpretation and config-flow discoverability. Fixtures are synthetic and contain no device identifiers or household telemetry.
  • git diff --check passes.

Run the tests with python -m unittest discover -s tests -v after installing PyYAML.

Other KTLM-G3 models have not been hardware-tested with this profile. This PR does not change global polling/reconnection behavior or claim to eliminate all logger timeouts. Related register-map reports: #25 and davidrapan/ha-solarman#730.

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.

1 participant