Skip to content

feat(zap): treat Zap as the P1/HAN meter only - #81

Closed
frahlg wants to merge 2 commits into
mainfrom
zap/p1-han-meter-only
Closed

feat(zap): treat Zap as the P1/HAN meter only#81
frahlg wants to merge 2 commits into
mainfrom
zap/p1-han-meter-only

Conversation

@frahlg

@frahlg frahlg commented Aug 13, 2026

Copy link
Copy Markdown
Member

Summary

  • Zap 3.0.0 is the P1/HAN site meter for FTW. It no longer ingests PV, battery or V2X from devices attached to the gateway.
  • If Zap lists an inverter, battery or charger, the driver logs that and emits other_resources so the operator adds those devices in FTW with their own drivers.
  • disable_pv / disable_battery / disable_v2x are 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.

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
  • Full driver/test suite: 3571 passed
  • FTW pin move after this merges (scripts/sync-bundled-drivers.sh)

frahlg added 2 commits August 13, 2026 09:26
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.
@frahlg

frahlg commented Aug 13, 2026

Copy link
Copy Markdown
Member Author

Replaced by a single Signed-off-by commit on zap/p1-han-meter-signed (DCO failed on the first two commits).

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e96d0739ec

ℹ️ 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".

Comment thread drivers/lua/zap.lua
Comment on lines 180 to +182
if der.type == "meter" then
rec.meter = true
if not first_meter then first_meter = sn end
elseif der.type == "pv" and not disable_pv then
rec.pv = true
rec.pv_rated_w = number(der.rated_power) or number(der.installed_power) or rec.pv_rated_w
elseif der.type == "battery" and not disable_battery then
rec.battery = true
rec.battery_rated_w = number(der.rated_power) or rec.battery_rated_w
rec.battery_capacity_wh = number(der.capacity) or rec.battery_capacity_wh
elseif der.type == "v2x_charger" and not disable_v2x then
rec.v2x = true
rec.v2x_capacity_wh = number(der.capacity) or rec.v2x_capacity_wh
is_meter = true
if not first_meter then first_meter = tostring(dev.sn) end

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Restrict fallback selection to a P1/HAN meter

When /api/devices contains a non-P1 attached energy meter but no type == "p1_uart" entry, discover_devices() assigns that device to first_meter, and the later selection fetches and emits it as the site meter. This retains the proxy behavior that version 3.0.0 claims to remove and can report the wrong site telemetry; restrict selection to known P1/HAN identifiers, including explicitly mapped legacy identifiers if needed, and treat other meters as external resources.

Useful? React with 👍 / 👎.

Comment thread manifests/zap.yaml
notes: "Official Sourceful Zap local-API integration for meter, PV, battery and V2X telemetry; safe leased control is pending firmware support."
min_driver_version: "2.0.0"
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"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Record the Zap API in upstream_docs

The edited driver identifies the official Zap Local API as the contract it was decoded against, but the manifest still has no upstream_docs entry for that URL. Consequently, the repository's watcher cannot detect when this API reference changes or disappears; add it as an api_docs entry in the manifest.

AGENTS.md reference: AGENTS.md:L60-L66

Useful? React with 👍 / 👎.

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