Skip to content

fix(zap): read PV and battery under data model v2 (3.1.3) - #209

Merged
davmoz merged 1 commit into
mainfrom
fix/zap-v2-pv-battery
Nov 4, 2026
Merged

davmoz merged 1 commit into
mainfrom
fix/zap-v2-pv-battery

Conversation

@davmoz

@davmoz davmoz commented Nov 4, 2026

Copy link
Copy Markdown
Member

Refs #170. Follows #208, which fixed the meter.

Problem

On Zap firmware 7.x, read_pv and read_battery read nothing. Data model v2 calls the PV DER solar, sends power and energy on one side (_ac or _dc), and moves the ratings to /api/devices.

The table in #170 is out of date on a few names, so this follows fw_controller/API.md and the serializer at Zap v7.0.3:

1.x 7.0.3
ders[].rated_power on battery rated_power_W_dc
ders[].capacity capacity_Wh_dc
ders[].installed_power installed_power_W_dc
solar rated_power (the inverter's rating) rated_power_W_ac on the inverter DER
pv mppt1_V, mppt1_A mppt[1].V_dc, mppt[1].A_dc
pv heatsink_C inverter.temperature_C
battery heatsink_C temperature_C

Change

  • PV and battery read on both the 1.x and the v2 names. A value v2 sends as null stays unknown.
  • An AC-side voltage or current is not reported as the battery's own.
  • The inverter DER is not counted as another resource, and ev_charger_port counts as a charger.
  • Removes draft comments and a pinned version from the test fix(zap): read the meter DER under Zap's data model v2 local API #208 added.

Tested

Zap firmware 7.0.3, through FTW's Lua host (master 22d7e6bf), GET only:

Zap Config Result
Zap-P1, simulated Solis read_pv, read_battery PV -3000 W, 150 kWh total, rated 20 kW. Battery +5000 W, SoC 0.75, 52 V, 10 A. MPPT and temperature metrics read. Meter -1100 W
Zap-P1, simulated Solis defaults Meter only, other_resources 2 (PV inverter, battery)
Zap-HAN, real meter defaults Meter reads, no regression from #208
  • make check: 5018 passed, 936 skipped.
  • test_zap_pv_battery_schema: 7 scenarios. Five fail against 3.1.2. v1 and v2_null pass on both, as they should.

Limits: the firmware and its payloads are real, but the inverter is a Modbus simulator. Not tested on a real inverter, and no Zap on 1.x firmware was available, so the 1.x path is covered by tests only.

🤖 Generated with Claude Code

Zap firmware 7.x calls the PV DER solar, sends power and energy on one side,
_ac or _dc, and moves the ratings to /api/devices. read_pv and read_battery
therefore read nothing on 7.x. The driver now reads the 1.x and the v2 names,
and a value v2 sends as null stays unknown.

An AC-side voltage or current is not reported as the battery's own. The
inverter DER is not counted as another resource.

Also removes draft comments and a pinned version from the meter schema test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: David Mozart <dmozartandraws@gmail.com>
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