Skip to content

feat(site): say whether FTW controls each device, and why not - #245

Merged
frahlg merged 2 commits into
mainfrom
catalog-says-control
Nov 21, 2026
Merged

frahlg merged 2 commits into
mainfrom
catalog-says-control

Conversation

@frahlg

@frahlg frahlg commented Nov 21, 2026 •

Copy link
Copy Markdown
Member

Why

On 21 November a new owner added a Zaptec Go through zaptec_cloud, which then declared read_only = true, so FTW accepted the charger and never controlled it and nothing told the owner why. The catalog page showed a faint "Read only" badge with no reason, and it took control from the manifest's control: field, which had drifted from the code. The channel had the opposite fault too: it counted any driver_command as control, so four drivers whose command only refuses shipped as controlling.

What changes

  • One rule for control. tools/ftw_repository.py gains driver_controls(source): a driver controls when it has driver_command and its DRIVER table does not say read_only = true. The channel build already used this rule inline; now the channel, the catalog page and the manifest checks all call the same function.
  • Four stub drivers say read-only. alphaess, kstar, solax and varta have a driver_command that only logs "not yet implemented" and refuses, so the channel shipped them as controlling. Each gains a DRIVER table with read_only = true and a description that says why: no control code has been written for it yet. Each is bumped a patch version (1.1.2), with a CHANGELOG.md entry. Their channel artifacts change: the generated header marks them read-only and drops their write permissions. Reading is unchanged. Their manifests stay control: false.
  • Three manifests now say control: true, matching code that commands the device: deye, pixii and solaredge. index.yaml and devices.yaml follow; no Lua changes for these three.
  • Checks.
    • tests/test_control_claims.py fails when a manifest's control: disagrees with driver_controls.
    • is_inert now ignores host.log, so a stub that logs and refuses counts as one.
    • A new test fails when a driver ships as control with such a stub.
    • tests/test_site.py holds the page to the channel's answer and checks the three states, the reasons and the rendering. On main the stub check catches all four drivers.
  • The catalog page says one of three things for every driver, on the row, in the open card, in the "By device" view and in the no-JavaScript list:
    • Controls the device (32): "Experimental until a field report confirms control on real hardware", or "Confirmed on real hardware" when the driver's own verification_status is production or tested. zaptec_cloud 0.2.1 shows the experimental line.
    • Reads only (32): "FTW reads this device but cannot control it", then what stops it ("The driver has no control code yet" or "The driver turns its control off"), then the driver's own reason when its description, manifest notes or header comment gives one.
    • Telemetry only (27): meter and PV drivers, where control is not expected.
  • Reasons do not repeat the note. A lead-in such as "FTW can read it but not control it:" or "Read-only:" is dropped, the first letter is a capital, and a reason with fewer than five words left is not shown (sonnen's "Read-only.", zap's "The driver never writes."). For tesla_wall_connector the page now reads "Tesla offers no way for another system to set its current. …". FTW Core uses the same rule in readOnlyReason (fix(web): say when FTW reads a charger but cannot control it ftw#2059); each points at the other.
  • README and spec/manifest-v2.md say that control: true means FTW can command the device: driver_command writes to it. Having a driver_command is not enough, and a stub declares read_only.
  • The column header row had seven grid columns for eight cells since Reach was added, so headers sat over the wrong column. It now matches the rows.

Pairs with

srcfl/ftw#2059: Core shows the same fact on the box, in Settings, setup and the EV card, and leaves out Charge now for a charger it cannot control. Neither PR depends on the other to merge.

Overlap with open PRs

  • fix(pixii): detect active battery calibration via Modbus #228 (pixii) changes pixii's version, size and sha in index.yaml on the lines right below the control: line this PR changes. That PR has right of way: merge it first, then rerun the generators here (make check does it) and push.
  • No other open PR touches tools/, the tests here, or the alphaess, kstar, solax, varta, deye or solaredge files.

Tests

🤖 Generated with Claude Code

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 21, 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-11-21T17:06:26.772602Z f83d696 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.

@frahlg
frahlg force-pushed the catalog-says-control branch 3 times, most recently from aab52b1 to 3749d3b Compare November 21, 2026 17:35
frahlg and others added 2 commits November 21, 2026 18:52
The catalog page took control from the manifest's control field, which
had drifted from the code in seven drivers, and showed a faint "Read only"
badge with no reason. An owner who added a Zaptec Go through zaptec_cloud
had no way to learn FTW would only read the charger.

The page now reads control the way the signed channel does, through one
function in tools/ftw_repository.py: driver_command present and no
read_only = true in the DRIVER table. Each driver says one of three things:

- Controls the device: experimental until a field report confirms it, or
  confirmed when the driver's own record says production or tested.
- Reads only: what stops it (no control code yet, or the driver turns
  control off), then the driver's own reason when its description,
  manifest notes or header comment gives one.
- Telemetry only: meter and PV drivers, where control is not expected.

The seven manifests that said control: false for drivers the channel ships
with control (alphaess, deye, kstar, pixii, solaredge, solax, varta) now say
true, and a test holds every manifest to the code. index.yaml and
devices.yaml follow.

Signed-off-by: Fredrik Ahlgren <fredrik@sourceful-labs.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review of this branch: alphaess, kstar, solax and varta have a
driver_command that only logs "not yet implemented" and refuses. The
channel counts any driver_command as control, so it shipped them as
controlling, and flipping their manifests made the catalog say "Controls
the device". That is the false claim this work removes.

- The four keep control: false. Each gains a DRIVER table with
  read_only = true and a description that says why: no control code has
  been written for it yet. Each is bumped a patch version, with a
  CHANGELOG entry. Their channel artifacts change.
- is_inert ignores host.log, so a logging stub counts as a refusal, and a
  new check fails when a driver ships as control with such a stub.
- The page's reason drops a lead-in that repeats the note ("FTW can read
  it but not control it:", "Read-only:"), starts with a capital, and is
  left out when fewer than five words remain, as for sonnen and zap.
  Core's readOnlyReason does the same; each points at the other.
- README and spec/manifest-v2.md say control: true means FTW can command
  the device, not that driver_command exists.

Signed-off-by: Fredrik Ahlgren <fredrik@sourceful-labs.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@frahlg
frahlg force-pushed the catalog-says-control branch from 3749d3b to a703e12 Compare November 21, 2026 17:53
@frahlg
frahlg merged commit 9ba4d7d into main Nov 21, 2026
5 checks passed
@frahlg
frahlg deleted the catalog-says-control branch November 21, 2026 17:56
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