Skip to content

fix(varta): read the storage again after a silent start (1.1.3) - #314

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

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

Conversation

@frahlg

@frahlg frahlg commented Dec 4, 2026

Copy link
Copy Markdown
Member

Problem

varta 1.1.2 read every register through probe_read, which leaves a register alone until restart after three misses. A unit that was off, restarting or held by another Modbus client when FTW started used up every try while answering nothing. The driver then sent battery and meter streams full of zeros until FTW restarted it: 0 W battery, 0 % SoC, 0 W grid. A register that did not answer went out as zero (five fields in the invented-number baseline).

Change

  • A miss counts only in a poll where another read answered, so a silent unit uses up no tries and is read again on the first poll it answers. A register that misses three times on a unit that does answer is asked again every five minutes instead of never.
  • The battery goes out only when 1066 (battery power) answered; the meter only when 1078 (grid power) answered. SoC, L1 voltage and L1 current are left out when their register did not answer.
  • driver_cleanup resets the guard and the poll state.
  • Signs are unchanged: 1066 is already positive on charge, 1078 positive on import.
  • The read-only driver_command and empty driver_default_mode are unchanged.
  • varta leaves invented-number-baseline.json.

Test evidence

  • drivers/tests/test_varta_wakes.py, six tests; all six fail on 1.1.2 and pass on 1.1.3:
    • 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 on the first poll that answers;
    • battery or meter left out when its power does not answer;
    • SoC, L1 V and L1 A left out when they do not answer;
    • a given-up register read again within five minutes.
  • make test-driver ID=varta: 51 passed, 9 skipped.
  • make absent-register-report ID=varta: every address prints SETTLED 1.
  • make invented-number-report ID=varta: none.
  • make check: 5580 passed, 927 skipped.

Not yet verified

  • No hardware run. The driver is a community driver with no field report. The case needs a VARTA unit that is off 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. A unit that was off, 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; the battery goes out only when 1066
answered, the meter only when 1078 answered.

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-04T22:32:04.067210Z 9aa30ab 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