Skip to content

feat(drivers): setup_hint says what to switch on in the device - #283

Merged
frahlg merged 1 commit into
mainfrom
setup-hints
Nov 28, 2026
Merged

frahlg merged 1 commit into
mainfrom
setup-hints

Conversation

@frahlg

@frahlg frahlg commented Nov 28, 2026

Copy link
Copy Markdown
Member

Problem

A new owner adds an inverter in FTW's setup guide. FTW cannot reach it, and nothing says that Modbus TCP is off in the inverter. The FTW onboarding review of 27 November 2026 counts this among the places a novice gives up (rows 3 and 11). Only huawei.lua mentioned the step, in a code comment.

Change

  • New optional DRIVER field setup_hint: one sentence, at most 140 characters, in the device's own menu words, saying what to switch on for local access. FTW can show it on the device card and when a connection test fails.
  • Validator: tools/validate_manifest.py (run by make check and make test-driver) reads the hint the way FTW Core does (manifest_parser.setup_hint). It must be one double-quoted string on one line, with no double quote or backslash inside, end with a full stop, and fit in 140 characters. Core's pickString stops at the first double quote, so anything else would reach the owner cut short.
  • Signed channel: tools/ftw_repository.py copies the hint into the generated header Core reads, as it does ws_hosts. A driver without a hint keeps its published bytes.
  • 23 drivers get a hint, each with a patch bump, a CHANGELOG entry and regenerated index.yaml, devices.yaml and support status. No register, reading or command changed.
  • Docs: spec/manifest-v2.md (beside setup) and blueprint/BLUEPRINT.lua. I left docs/WRITING-A-DRIVER.md alone because fix(easee_cloud): report a load-balancer limit while the car charges #172 touches it.

Hints and sources

Driver Hint Source
sungrow 1.7.1 Turn on Modbus TCP port 502 on the WiNet-S dongle; Sungrow ships it closed. Sungrow "WiNet-S/S2 Communication Module User Safety Operation Manual" Ver11 (2025-06), 5.1 Port Matrix: port 502 for Modbus TCP is disabled by default. The vendor gives no menu path, so the hint names none.
huawei 2.2.1 Ask your installer to set Modbus TCP on the SDongle to Enable (unrestricted) in FusionSolar. Huawei Digital Power Suisse, "Instructions pour les onduleurs" (12.03.2026), slide 14: FusionSolar, SmartDongle, Modbus-TCP, "Activer (sans restriction)", installer account. https://solar.huawei.com/admin/asset/v1/pro/view/28c6a653e8b248c0b1053a973453ab70.pdf. The English words are the English label of that option; I did not read an English Huawei page that shows them.
fronius 2.3.1 In the inverter web page, open Communication > Modbus and turn on the TCP server on port 502. Fronius "GEN24 Modbus TCP & RTU" (42,0410,2649), page Modbus: Communication > Modbus, TCP Server block, port 502 or 1502. https://manuals.fronius.com/html/4204102649/en-US.html. The page names no on/off switch.
sma 2.2.1, sma_pv 1.1.2 Log in as Installer and set Device Parameters > External Communication > Modbus > TCP Server > Activated to Yes. SMA "SMA Modbus Technical Information" (SMA-Modbus-TI-en-10), section 4 and 4.1: both Modbus servers are off by default. https://files.sma.de/downloads/SMA-Modbus-TI-en-10.pdf (already in sma's upstream_docs).
kostal 2.2.1 In the inverter web server, turn on Settings > Modbus/SunSpec (TCP) > Activate Modbus; Kostal uses port 1502. KOSTAL PLENTICORE G3 operating manual, "Modbus/SunSpec (TCP)". https://documents.kostal.com/PLENTICORE-G3/BA/en-GB/473015051.html. The driver targets Plenticore plus and PIKO IQ. I assume their web server uses the same words.
goodwe 2.3.1 Fit a WiFi/LAN Kit-20 or LAN module and connect it by network cable; Wi-Fi alone gives no Modbus TCP. GoodWe "Modbus TCP/IP Communication Solution" VER 03 (2021-12-13): a LAN or Wi-Fi+LAN module is needed for Modbus TCP, port 502. https://community.goodwe.com/resources/goodwe/2021-12-14558424.pdf. "WiFi/LAN Kit-20 & WiFi Kit-20 User Manual" V1.6, 3.1: LAN mode only on the WiFi/LAN Kit-20.
solis 2.2.1 Fit an S2-WL-ST Wi-Fi/LAN logger and connect its LAN port to your router; it serves Modbus TCP on port 502. Solis "Modbus TCP Communication Guide for S2-WL-ST Wi-Fi/LAN Logger" rev 1.1 (2024-05-29). https://usservice.solisinverters.com/support/solutions/articles/73000670200
victron 2.2.2 On the GX device, enable Settings > Integrations > Modbus TCP Server (older Venus OS: Settings > Services). Victron Venus GX manual, Configuration (Modbus TCP Server, off by default): https://www.victronenergy.com/media/pg/Venus_GX/en/configuration.html. Older path: https://www.victronenergy.com/live/ccgx:modbustcp_faq
goe 1.1.1 In the go-e app, open Internet > Advanced settings and turn on Modbus at the bottom. go-e modbus-en.md (go-eCharger-API-v2) and the driver header.
goe_http 1.1.1 In the go-e app, turn on HTTP API v2; go-e keeps it off until you do. go-e http-en.md: the HTTP API v2 has to be enabled from the app. Also the driver header.
keba 1.1.1 An electrician sets DIP switch DSW1.3 to ON inside the charger and restarts it; keep the UDP interface off. KEBA "KeContact P30 Modbus TCP Programmers Guide" V1.07 (doc 132578), 1.4. KEBA P30 installation manual V3.70 (doc 105786), 8.1: an electrician, then a restart.
alfen 1.1.2 Your installer turns on Active Load Balancing (paid licence) in ACE Service Installer, with Energy Management System and Modbus TCP/IP. Alfen "Modbus for ACE, Configuration Guide" v1.0 (05/2025), 4.1, 4.4.1, 4.5. https://alfen.com/media/1047/download. Also the driver header.
abb_terra 1.1.2 Ask your installer to set up Modbus TCP/IP under Load Balance in the TerraConfig app, on the LAN port. ABB "TAC Modbus Communication" v1.7, 2 and 4.2, and "TerraConfig App Step by Step Guide" (9AKK108466A3431 Rev B). The guide names no single on/off switch.
mennekes 1.1.2 On ECU models, set Modbus TCP Server to On under Modbus in the charger web interface, then save and restart. MENNEKES "Aktivieren der Modbus TCP Server Schnittstelle" v00 (2021-01-18), German, for electricians: Lastmanagement > Modbus > Modbus TCP Server = An. ECU only. I found no step for the HCC3 models (AMTRON Xtra/Premium), so the hint names ECU.
etrel 1.1.1 Turn on Modbus TCP in the charger web interface. The driver's own description. Etrel's Knowledge Centre links to an article on enabling Modbus that I could not fetch.
ctek 0.3.4, ctek_v2 0.3.4, ctek_hybrid 0.3.3 In the charger web interface, set Automation > ModbusTCPEnable to true and the automation API version to 1 (v2: 2; hybrid: also enable Configuration > MQTT). The drivers' own headers (CSOS setup notes).
nibe_local 1.2.2 On the heat pump, open menu 7.5.15 Local REST API and activate it. NIBE S735C installer manual (IHB EN 2552-1), Service: menu 7.5.15 "Local REST API". Also the driver header.
zap 3.2.1, remne_p1ib 0.1.1, esphome_dsmr 1.0.8 Ask your grid company to open the HAN/P1 port on your meter if it is closed; some let you do it on their website. Ellevio meter sheet (Kaifa MA304H4E): the customer turns the port on via Mina sidor. https://www.ellevio.se/globalassets/content/el/elmatare-produktblad-b2c/kaifa_ma304h4e_infoblad.pdf. Fluvius e360 manual: the user port is off by default, request it at mijn.fluvius.be/poortbeheer. https://www.fluvius.be/sites/fluvius/files/2024-05/handleiding-dm-elek-landisgyr-e360.pdf. Dutch DSMR meters need no request.

Left without a hint

Does the catalog tell FTW what it controls and what it only reads?

Per driver, yes.

  • The manifest's control: is checked against the code by make check, and index.yaml repeats it.
  • The signed channel manifest has read_only and control_enabled.
  • Every read-only signed header says read_only = true.
  • Huawei says control: false and read_only = true, so FTW already knows it only reads.
  • The missing "reads only" label for hybrids comes from FTW's web/driver-control.js. It labels a read-only charger, car, heat pump, or battery without PV, and skips anything that reads PV.

Gaps, not built here:

  1. 19 read-only drivers do not declare read_only = true in their own DRIVER table, though AGENTS.md asks for it: abb_meter, acrel, carlo_gavazzi, chint, circutor, fronius_api, hello, janitza, opendtu, opendtu_mqtt, p1_dsmr, p1_encrypted, p1_hdlc, p1_meter, schneider_meter, shelly, siemens_pac, socomec, victron_mqtt. FTW reads a bundled copy from source, so for these it sees "not stated" rather than "reads only".
  2. control is one flag per driver. No field says which DERs a controlling driver steers. Today the actions line up: every control driver with a battery handles battery, and PV is steered only through curtail. The few pv-curtail tags in DRIVER.capabilities do not reach the signed header, because its capabilities come from the manifest's ders. FTW uses its own supports_pv_curtail config, so nothing breaks today.
  3. Bug found on the way: the signed header copies description with a pattern that stops at the first apostrophe. Nine signed copies carry a cut description: etrel, home_assistant_vehicle, nibe_local, openevse, remne_p1ib, schrack_ev, tesla_cloud, teslamate_vehicle, wallbox. For example, tesla_cloud's reads "Reads a Tesla", so FTW loses the read-only reason it shows. Fixing it changes published bytes and needs nine bumps, so it should be its own PR. setup_hint uses its own parser and keeps apostrophes.

Smallest metadata I propose:

  • Have make check require read_only = true in the DRIVER table of every control: false driver, which means adding a table to the six that lack one.
  • Have FTW label any read-only driver with a battery as "reads only".
  • Add no per-DER field until a driver controls some of its DERs and not others.

Order with FTW

FTW Core ignores unknown DRIVER keys today, so this PR does not wait for the FTW PR.

  • pickString reads only named fields.
  • Lua ignores an extra table key.
  • driverrepo decodes the channel manifest with plain json.Unmarshal into drivers.CatalogEntry, so an unknown metadata.setup_hint is dropped.
  • The contract tests (bundled_startup_contract_test.go, catalog_signed_artifact_test.go) check id, version, read_only and capabilities, not the set of keys.

Order:

  1. Merge this PR. drivers-beta then carries the hints in signed headers, and current Core is unaffected.
  2. The FTW PR (branch onboarding-guide-one-flow) adds SetupHint with pickString(block, "setup_hint") and the UI. It moves drivers/BUNDLED_SOURCE.json to this PR's merge commit and runs scripts/sync-bundled-drivers.sh, so bundled copies carry the hints too. If the FTW PR merged first, it would show nothing until the pin moves, and nothing would break.

Evidence

  • make check: 91 manifests, 0 errors; 5565 passed, 927 skipped.
  • make test-driver ID=<id> for each of the 23 drivers: all pass. Two harness tests pinned the old version strings (test_nibe_local_ftw.lua, test_esphome_dsmr_aliases.lua); I moved them to the new versions.
  • tests/test_setup_hint.py (112 cases) covers:
    • every driver's hint reads back through Core's own patterns;
    • the 23 hints stay in place;
    • each malformed form is refused, as are a hint outside the DRIVER table and one over 140 characters;
    • the signed header carries the hint and Core's alias rule reads it from the artifact;
    • a driver without a hint keeps its header.
  • I also ran FTW Core's own parser: catalog.go, catalog_controls.go and catalog_thermal.go, copied unchanged from srcfl/ftw master 97c2d346 into a scratch module. I ran it on the 23 files before and after, and on their generated signed copies.
    • Of the fields Core reads (id, description, read_only, capabilities, connection_defaults), only version changed.
    • The hint reads back the same from the bundled and the signed copy.

Not tested

  • No hint was checked against a real device or vendor app screen. Vendor menus change between firmware versions.
  • I did not run the check-versions comparison against the published drivers-beta manifest locally. This PR's "signed channel accepts this tree" check runs it.
  • The FTW side, which shows the hint, is the other PR.
  • Kostal documents port 1502 while kostal.lua's connection_defaults says 502. The hint names 1502; the default is unchanged here.

Refs the FTW onboarding review of 27 November 2026, rows 3 and 11.

🤖 Generated with Claude Code

A new owner adds an inverter, FTW cannot reach it, and nothing says that
Modbus TCP is off in the inverter. A driver may now say what to switch on,
in one sentence of the device's own menu words, as setup_hint in its
DRIVER table.

make check holds the field to what FTW Core reads: one double-quoted
string on one line, no double quote or backslash, one sentence ending
with a full stop, at most 140 characters. The signed channel copies it
into the header Core reads; a driver without a hint keeps its bytes.

23 drivers get a hint, from the vendor's document or the driver's own
notes, each with a patch version: sungrow, huawei, fronius, sma, sma_pv,
kostal, goodwe, solis, victron, goe, goe_http, keba, alfen, abb_terra,
mennekes, etrel, ctek, ctek_v2, ctek_hybrid, nibe_local, zap, remne_p1ib,
esphome_dsmr.

Refs srcfl/ftw onboarding review, rows 3 and 11.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Fredrik Ahlgren <fredrik@sourceful-labs.com>
@frahlg
frahlg marked this pull request as ready for review November 28, 2026 05:53
@frahlg
frahlg merged commit 77cfcda into main Nov 28, 2026
5 checks passed
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 28, 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-28T05:54:32.309791Z 4882d2f Draft marked ready
ℹ️ 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.

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