Skip to content

fix(solis): read the inverter again after a silent start (2.2.2) - #312

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

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

Conversation

@frahlg

@frahlg frahlg commented Dec 4, 2026

Copy link
Copy Markdown
Member

Problem

solis 2.2.1 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 only zeros until FTW restarted it.

Those zeros were the second fault: a register that did not answer went out as zero (25 counts in the invented-number baseline). A silent inverter looked like a site with no PV, an empty battery and no grid flow. A missing battery direction (33135) turned every discharge into a charge.

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 33057 answered; the battery only when 33149 and its direction 33135 answered; the meter only when the phase powers at 33257 answered. Other fields that did not answer are left out, and metrics skip them.
  • The serial is read last, once the inverter has answered in that poll.
  • solis leaves invented-number-baseline.json.

Test evidence

  • test_solis_wakes.py, nine tests; eight fail on 2.2.1 and all pass on 2.2.2 (the ninth is a healthy poll that passes on both):
    • test_wakes_after_silence.lua (shared with fix(saj): read the serial and battery again after the inverter wakes (1.3.1) #301): silent from start-up, silent mid-session, each register refused six times. 2.2.1 fails: asleep at start-up: register 33029 not read after the device answered;
    • nothing sent while asleep, every stream and the serial on the first poll that answers;
    • the serial read last;
    • PV, battery and meter left out when their power (or the battery's direction) does not answer;
    • fields that do not answer left out of the streams and the metrics.
  • test_solis_battery_now.py: unchanged, passes.
  • make test-driver ID=solis: 124 passed, 14 skipped.
  • make absent-register-report ID=solis: every address settles.
  • make invented-number-report ID=solis: none.
  • make check: 5583 passed, 927 skipped.

Not yet verified

  • No hardware run. The case needs a Solis hybrid that is asleep or held by another client when FTW starts. The driver is still marked experimental.
  • A firmware that does not answer 33135 now sends no battery at all; before, it sent every discharge as a charge.
  • solis_string is left alone; fix(solis_string): keep asking a sleeping inverter, never send 0 W (1.1.4) #291 touches it. Its baseline line sits next to this one, so whichever merges later needs a rebase there, as does CHANGELOG.md with the other driver PRs in this series.
  • 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 only zeros 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 empty battery 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 33057 answered, the battery only when
33149 and its direction 33135 answered, the meter only when 33257
answered. The serial is read last, once the inverter has answered in that
poll. solis leaves the invented-number baseline.

test_solis_wakes.py fails on 2.2.1 (8 of 9 cases; the ninth is a healthy
poll) and passes on 2.2.2.

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 4, 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-04T18:57:15.415692Z edde695 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