Skip to content

fix(solinteg): read the inverter again after a silent start (1.2.1) - #322

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

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

Conversation

@frahlg

@frahlg frahlg commented Dec 5, 2026

Copy link
Copy Markdown
Member

Problem

solinteg 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, restarting, or held by another Modbus client used up every try while answering nothing. The driver then sent PV, battery and meter streams full of zeros until FTW restarted it.

A register that did not answer went out as zero (25 fields in the invented-number baseline). With the 30254 block silent, the battery mode read as 0 (discharge) and the battery went out as 0 W at 0 V and 0 % SoC.

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.
  • PV goes out only when 11028 answered. The battery goes out only when the 30254 block (voltage, current, mode and power in one read) answered. The meter goes out only when the 10994 block (phase and total power in one read) answered.
  • MPPT V/A (11038), inverter temperature (11032), generation (31112), SoC (33000), pack temperature (33003), charge and discharge energy (31108/31110), cell temperatures (33009), phase currents (10983), voltages and frequency (11009) and grid energy (11002) are left out when their register did not answer.
  • Signs are unchanged: battery mode 0 discharges (−), anything else charges (+); the meter is still negated from Solinteg's export-positive sign.
  • The pack and cell temperatures still need a battery voltage above 0 in the same poll, as before.
  • driver_command and driver_default_mode are unchanged; they write and never read.
  • driver_cleanup resets the guard and the poll state.
  • solinteg leaves invented-number-baseline.json.

Test evidence

  • drivers/tests/test_solinteg_wakes.py, 9 tests. 6 fail on 1.2.0 and pass on 1.2.1:

    • test_wakes_after_silence.lua (shared with the rest of the series): silent from start-up, silent mid-session, each register refused six times;
    • ten silent polls, then every field, pack and cell temperatures included, on the first poll that answers;
    • PV, battery or meter left out when its power does not answer, three cases;
    • fields that do not answer left out of the streams and the metrics.

    The other 3 pass on both and guard what must not change: the battery sign for mode 0 and 1, and the charge command's write after a silent start.

  • drivers/tests/test_solinteg_battery_now.py passes unchanged.

  • make test-driver ID=solinteg: 62 passed, 6 skipped.

  • make absent-register-report ID=solinteg: every address prints SETTLED 1.

  • make invented-number-report ID=solinteg: none.

  • make check: 5583 passed, 927 skipped.

Not yet verified

  • No hardware run. The case needs a Solinteg inverter that is asleep (at night) or held by another client when FTW starts.
  • CHANGELOG.md, drivers/tests/lua_harness/test_wakes_after_silence.lua and invented-number-baseline.json are shared with the other 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, restarting or held by another
Modbus client at start-up used up every try, and the driver then sent
zeros until FTW restarted it.

A miss now counts only in a poll where another read answered, and a
register given up is asked again every five minutes. A field whose
register did not answer is left out. PV goes out only when 11028
answered, the battery only when the 30254 block answered, the meter only
when the 10994 block answered. Control is unchanged.

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:08:05.003276Z e95effe 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