You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
zap: read the Zap's data model v2 local API (pv → solar, W → W_ac, ...) #170
Zap firmware main (d9cefe5, srcfl/srcful-zap-x-firmware#294) serves its local API in data model v2 (srcful-data-models 2.3.0). drivers/lua/zap.lua still reads the 1.x names, so a Zap running that firmware gives FTW no readings:
emit_meter reads raw.W. That field no longer exists, so the driver emits no meter. FTW loses its P1/HAN site meter.
PV is no longer found: /api/devices lists the DER as solar, and /data/json keys it as solar, not pv.
Battery W, SoC, energy, V and A all read nil.
No Zap release carries this yet; the latest release is v2.3.15, still 1.x. The firmware will not be released before NovaCore runs v2 on the target environment. This has to land before a v2 Zap release reaches FTW users.
What changed in the Zap local API
GET /api/devices: ders[].type is solar (was pv) and ev_charger_port (was v2x_charger). rated_power, installed_power and capacity are unchanged.
GET /api/devices/{sn}/data/json: the envelope keys are the v2 DER types, version is "v2", every field of the type is present, and an unread value is null. Names zap.lua reads today:
zap.lua reads (1.x)
v2 name
data.pv
data.solar
meter W
W_ac
meter total_import_Wh / total_export_Wh
total_import_Wh_ac / total_export_Wh_ac
meter L1_V / L1_A / L1_W (L2, L3 alike)
l1_V_ac / l1_A_ac / l1_W_ac
pv W
W_ac (inverter output) or W_dc (DC side)
pv rated_power_W
rated_power_W_ac / rated_power_W_dc
pv total_generation_Wh
total_generation_Wh_ac / total_generation_Wh_dc
pv mppt1_V / mppt1_A (and 2)
mppt1_V_dc / mppt1_A_dc
battery W
W_dc (a battery's own measurement is DC), W_ac for AC-coupled
not in telemetry any more: use /api/devicesders[].rated_power / capacity
heatsink_C
unchanged
Signs are unchanged: + import/charge, − export/generation/discharge. The full field list for each type is in the data model REFERENCE, and the Zap's own copy is fw_controller/API.md on Zap main.
What zap.lua needs
Read the v2 names. Take pv → solar in both discovery and the data envelope.
Accept 1.x as well, because FTW users have Zaps on both firmware lines during the rollout. version == "v2" in /data/json tells them apart.
Activity