Skip to content

fix(solax): read the inverter again after a silent start (1.2.1) - #318

Open
frahlg wants to merge 1 commit into
mainfrom
fix/solax-wake
Open

frahlg wants to merge 1 commit into
mainfrom
fix/solax-wake

Conversation

@frahlg

@frahlg frahlg commented Dec 5, 2026

Copy link
Copy Markdown
Member

Problem

solax 1.2.0 read every register through probe_read, which leaves a register alone until restart after three misses. An inverter asleep when FTW started, or held by another Modbus client, used up every try while answering nothing. The driver then sent nothing until FTW restarted it.

A register that did not answer went out as zero (14 fields in the invented-number baseline). A silent inverter looked like a site with no PV, an idle battery at 0 % and no grid flow.

Change

  • A miss counts only in a poll where another read answered, so a silent inverter uses up no tries and is read again on the first poll it answers. A register that misses three times on an inverter that does answer is asked again every five minutes instead of never.
  • probe_read checks every word it asked for, not just the first.
  • PV is the sum of the two strings at 0 and 3. It goes out only when both answered in this poll, or when one answered and the other has been refused three times while other reads answered (a string the inverter does not have adds nothing, as in 1.2.0). A string that misses in one poll leaves PV out rather than sending it low.
  • The battery goes out only when 22 answered, the meter only when 70 answered. Other fields that did not answer are left out. Temperature and BMS limits still need a battery voltage above 0 in the same poll.
  • solax leaves invented-number-baseline.json.

The driver reads no serial, model or firmware, and takes no one-shot decision from a read. It stays read-only.

Test evidence

  • test_solax_wakes.py, eight tests; all eight fail on 1.2.0 and pass on 1.2.1:
    • test_wakes_after_silence.lua (shared with the other PRs in this series): silent from start-up, silent mid-session, each register refused six times;
    • ten silent polls send nothing, then every value on the first poll that answers;
    • PV (either string), battery or meter left out when its power does not answer (four cases);
    • fields that do not answer left out of the streams and the metrics;
    • a string refused on an answering inverter: PV left out at first, then PV1 alone, then both once PV2 answers again.
  • test_solax_battery_now.py passes unchanged.
  • make test-driver ID=solax: 63 passed, 6 skipped.
  • make absent-register-report ID=solax: all 14 addresses print SETTLED 1.
  • make invented-number-report ID=solax: none.
  • make check: 5582 passed, 927 skipped.

Not yet verified

  • No hardware run. The case needs a SolaX inverter that is asleep (at night) or held by another client when FTW starts.
  • The PV rule for a missing string is my call: on a unit that refuses PV2, PV is left out for the first three polls, then PV1 alone. An owner may prefer a different rule.
  • CHANGELOG.md, the shared harness test_wakes_after_silence.lua and invented-number-baseline.json are touched by the other driver PRs in this series; whichever merges later needs a rebase there.
  • After merge, FTW's pin in drivers/BUNDLED_SOURCE.json has to move.

🤖 Generated with Claude Code

Every read went through a guard that left a register alone until restart
after three misses. An inverter asleep at start-up, or held by another
Modbus client, used up every try while answering nothing, and the driver
then sent nothing until FTW restarted it. A register that did not answer
went out as zero, so a silent inverter looked like a site with no PV, an
idle battery at 0 % and no grid flow.

A miss now counts only in a poll where another read answered, so a silent
inverter uses up no tries and is read again on the first poll it answers.
A register that misses three times on an inverter that does answer is
asked again every five minutes. A field whose register did not answer is
left out. PV goes out only when both strings (0 and 3) answered, the
battery only when 22 answered, the meter only when 70 answered. A string
the inverter refuses three times while other reads answer adds nothing to
the PV total, as before. solax leaves the invented-number baseline.

test_solax_wakes.py fails on 1.2.0 (8 of 8 cases) and passes on 1.2.1.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Fredrik Ahlgren <fredrik@sourceful-labs.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Dec 5, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-12-05T05:00:06.221010Z 049fdeb PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

This branch has not been deployed

No deployments
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