feat(zap): treat Zap as the P1/HAN meter only - #82
Conversation
FTW must not ingest inverters, batteries or chargers through Zap. Those devices belong in FTW with their own drivers. If Zap lists any of them, the driver now says so and leaves them unread. BREAKING CHANGE: sites that used Zap as a proxy for PV, battery or V2X lose that telemetry until they add the native driver. Signed-off-by: Fredrik Ahlgren <fredrik@sourceful-labs.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6a54a1831a
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| notes: "P1/HAN site meter from a Sourceful Zap. Inverters, batteries and chargers found on Zap must be added in FTW with their own drivers." | ||
| min_driver_version: "3.0.0" |
There was a problem hiding this comment.
Record the Zap API under upstream_docs
The rewritten driver explicitly depends on the Zap Local API, but the updated manifest still omits upstream_docs. This prevents the repository's weekly watcher from detecting changes or disappearance of the API contract that defines these discovery and meter payloads; add the durable API-reference URL already named in drivers/lua/zap.lua.
AGENTS.md reference: AGENTS.md:L60-L66
Useful? React with 👍 / 👎.
| local msg = other_resources_message(other_resources) | ||
| if msg and not warned_other then | ||
| host.log("warn", "Zap: " .. msg) | ||
| warned_other = true |
There was a problem hiding this comment.
Re-warn when the discovered resource set changes
When a site already has an extra resource at startup and later attaches a different inverter, battery, or charger, periodic discovery updates other_resources but this process-wide boolean remains true, so the new resource is never named in the operator log. The emitted metric contains only a count—which can remain unchanged when one resource type replaces another—so the operator receives no actionable instruction for the newly discovered device; suppress only repeated warnings for an unchanged resource set.
Useful? React with 👍 / 👎.
Summary
other_resourcesso the operator adds those devices in FTW with their own drivers.disable_pv/disable_battery/disable_v2xare gone because those DERs are no longer read.People have been adding an inverter to Zap and then using the Zap integration in FTW as a proxy. That is unnecessary and not recommended.
Replaces #81 (DCO: the first commits lacked Signed-off-by).
Breaking
Sites that used Zap as the only path for an inverter, battery or charger lose that telemetry until they add the native FTW driver.
Test plan
make test-driver ID=zap