FranklinWH aGate SunSpec Implementation Quirks¶
Documenting non-standard behaviors, missing registers, and implementation-specific issues discovered during development.
Model 713 - DER Storage Capacity¶
Sta (Status) is not a battery state¶
Issue: Sta in Model 713 is a status flag, not a charge/discharge state. It read 0 while the battery was charging at 400 W (2026-03-10). Under SunSpec 2, 0 means OK, so that reading is consistent with the spec. It does not tell you whether the battery is charging.
SunSpec 2 M713.Sta enum (model_713.json):
| Value | Meaning |
|-------|---------|
| 0 | OK: no warnings or errors pending |
| 1 | WARNING: one or more warnings pending |
| 2 | ERROR: one or more errors pending |
Whether this aGate ever reports 1 or 2 has not been tested.
Battery state: derived from the direction of M714 DCW (±50 W deadband):
# M714.DCW sign on V12R02B60D00 (c8, 2026-10-23: 5000 W discharge read DCW +4900 to +5000):
# positive = power OUT of battery (Discharging)
# negative = power INTO battery (Charging)
if dc_power < -50:
state = 'CHARGING'
elif dc_power > 50:
state = 'DISCHARGING'
else:
state = 'IDLE'
Correction (#114)
An earlier version of this snippet had the sign reversed (positive = charging). The code (read_battery_status()) uses positive = discharging. The 2026-03-10 observation above (charging at −400 W) also fits positive = discharging. The enum table earlier listed 0 OFF … 6 TESTING, which is not the SunSpec 2 Model 713 enum.
Code Location: src/franklinwh_modbus/controller.py:read_battery_status() returns battery_state (derived from DCW) and status_raw (M713.Sta: 0 OK, 1 WARNING, 2 ERROR).
Model 714 - Battery DC Measurements¶
Points that read 0 instead of "not implemented" (#129)¶
FranklinWH's PICS (SunSpec certificate SM-000028) declares every Model 714 point below supported, read-only. A point a device doesn't implement should return SunSpec's not-implemented value (int16 0x8000, uint16/enum16 0xFFFF, bitfield32 0xFFFFFFFF, uint64 all ones). The aGate returns plain 0 for the points it doesn't populate. A client can't tell that 0 from a real reading of 0 A, 0 V or 0 °C. Against the PICS that is non-compliant.
| Point (PDU) | V10R01B04D00 (2026-05-14) | V12R02B60D00 (2026-10-20) | PICS SM-000028 |
|---|---|---|---|
DCW (1048), DC power |
✅ +500 W | ✅ −600 W | supported R |
DCWhInj / DCWhAbs (1049 / 1053), lifetime discharged / charged |
✅ non-zero | ✅ non-zero | supported R |
DCA (1047), DC current |
❌ 0 while DCW +500 W | ❌ 0 while DCW −600 W | supported R |
NPrt (1046) |
1 | 1 | 1 R |
| Scale factors (1057–1061) | all 0 | all 0 | 0 R |
Prt.1.PrtTyp (1062) |
not read | ❌ 0 = PV (the port is a battery, ESS = 1) | supported R |
Prt.1.IDStr (1064–1071) |
not read | ❌ "ID_String" (placeholder) | supported R |
Prt.1.DCA (1072) |
not read | ❌ 0 | supported R |
Prt.1.DCV (1073), DC voltage |
not read | ❌ 0 | supported R |
Prt.1.DCW (1074) |
not read | ❌ 0 while model DCW −600 W | supported R |
Prt.1.DCWhInj / DCWhAbs (1075 / 1079) |
not read | ❌ 0 while the model totals are non-zero | supported R |
Prt.1.Tmp (1083), battery temperature |
not read | ❌ 0 (decodes as 0 °C) | supported R |
Prt.1.DCSta (1084) |
not read | ❌ 0 = OFF while the battery moves 600 W | supported R |
Prt.1.DCAlrm (1085) |
not read | 0 | supported R |
- Sources: V10,
docs/AGATE_FULL_SCAN_2026-05-14.txt(Model 714; that scan did not read the port block). V12, the re-scan in SUNSPEC_SNAPSHOT_2026-10-20_V12R02B60D00.md. Each is a single read at one site. The record is infirmware_quirks.json(m714_dca,m714_dcv_tmp,m714_port_block). - Correction (#129): earlier versions of this page listed
DCVandTmpas working on V10. No raw read supports that; the port block was never read on V10. They also called the DCA workaround robust. On V12, DCV is 0, so I = P/V can't be computed. - DCW sign: positive = discharging (out of the battery), negative = charging (into it). Source: V12R02B60D00 c8, 2026-10-23 (#104). An earlier version of this page had the sign reversed (#114 C2).
Battery current: with DCA 0, current can only be derived as I = DCW / DCV, which needs a non-zero port DCV. No firmware on record provides one.
Library: read_battery_status() reads each port from the M714 Prt group. A value the aGate doesn't report is None, not 0: SunSpec's not-implemented value, or any value on a port whose DCV reads 0. On V12R02B60D00, battery_temp_c, battery_current_a and every port value are None; battery_power_w and battery_state come from model DCW (#130). Before #130 the library never read the port block and reported 0.
Code Location: src/franklinwh_modbus/controller.py:read_battery_status() (M714 section)
Model 701 - Inverter Measurements¶
TmpAmb and TmpCab Implementation¶
Status: ✅ Working as of aGate firmware
FranklinWH aGate X implements these temperature registers:
- TmpAmb (40105) - Ambient temperature
- TmpCab (40106) - Cabinet temperature
Earlier firmware versions may not expose these.
TotWhInj and TotWhAbs — AC Lifetime Energy Accumulators¶
Status: ✅ Working (confirmed 2026-03-23)
The M701 AC lifetime energy accumulators report cumulative grid energy (Wh, acc64 with TotWh_SF):
TotWhInj(40089) — Total Energy Injected: lifetime grid export (DER → grid)TotWhAbs(40093) — Total Energy Absorbed: lifetime grid import (grid → DER, e.g. grid-charging battery)
These are separate from the M714 DC battery accumulators (DCWhInj/DCWhAbs). Both register sets are independently useful:
| Register | Model | Measures | Example Value |
|---|---|---|---|
TotWhInj |
M701 (AC) | Grid export (inverter → grid) | ~4.46 MWh |
TotWhAbs |
M701 (AC) | Grid import (grid → inverter) | ~1.32 MWh |
DCWhInj |
M714 (DC) | Battery discharged | ~5.84 MWh |
DCWhAbs |
M714 (DC) | Battery charged | ~5.96 MWh |
Code Location: src/franklinwh_modbus/controller.py:read_grid_status() returns grid_export_wh and grid_import_wh
DERMode Bitfield — PV Curtailment (PV_CLIPPED)¶
Status: ✅ Supported per PICS conformance (M701, Address 78)
The DERMode register is a bitfield indicating the current DER operating mode:
| Bit | Name | Description |
|---|---|---|
| 0 | GRID_FOLLOWING |
Normal grid-connected operation (frequency/voltage follows grid) |
| 1 | GRID_FORMING |
Off-grid/island mode (aPower generates its own AC reference) |
| 2 | PV_CLIPPED |
PV curtailment active — solar output is being limited |
Important
PV_CLIPPED is a FranklinWH-specific operational state, most relevant in off-grid/backup mode. When the aPower switches to Grid Forming (bit 1), it can only handle a limited amount of solar input. If a solar inverter (e.g., SolarEdge SE 11400) produces more power than a single aPower can absorb (~6kW), the aPower signals PV curtailment through DERMode bit 2. FranklinWH recommends: - Single aPower: Derate solar inverter using SolarEdge PRI (Power Reduction Interface) to keep off-grid peak below 6kW - Two aPowers: Provides sufficient capacity for larger solar arrays without curtailment References: - SolarEdge De-rate in Off-Grid Mode - FranklinWH PV Curtailment White Paper (PDF)
Code: controller.py reads DERMode as grid_mode:
# Bit 0 = Grid Following, Bit 1 = Grid Forming, Bit 2 = PV Clipped
if der_mode_raw & (1 << 2):
grid_mode = 'PV Clipped'
elif der_mode_raw & (1 << 1):
grid_mode = 'Grid Forming'
elif der_mode_raw & (1 << 0):
grid_mode = 'Grid Following'
Note
We have not directly observed PV_CLIPPED in testing — our system has no solar at night and operates on-grid. This bit would only appear during daytime off-grid events with active PV curtailment.
Extension Registers¶
The FranklinWH extension registers (15000–15043, 15500–15513, 16000–16002), with access, units, library accessors and evidence, are listed in one place: FranklinWH Extension Registers.
Quirks covered there: - 15509 (TOU reserve) reads the same value as 15508 on V10R01B04D00 (confirmed 2026-10-18). This is fixed on V12R02B60D00, where 15509 holds the TOU reserve (2026-10-20/21; snapshot; #63). - The 15507 operating-mode values are under review (#75). - 16000 gives the home load at ~1 W resolution (15506 is in ~100 W steps).
Official SunSpec PICS Reference¶
FranklinWH's SunSpec Alliance certification document is the PICS spreadsheet UPDATED_FranklinWH_Modbus_PICS_SM-000028.xlsx. It is FranklinWH's proprietary document and is not distributed in this repository (removed before the public release, 2026-03-17); obtain it from FranklinWH.
This XLSX documents: - "Unimplemented" info points, listed by PDU address (owner-confirmed: e.g. ControllerHb 1092) - Extension register definitions (SPAN tab) - The SOC reserve defect
Warning
We do not fully trust this document. Our live testing has found discrepancies between what the PICS document claims and actual aGate behavior. Always verify against the live device. Use the PICS as a starting point, not ground truth.
Register-by-register PICS findings: PICS Conformance.
Extension Registers (15000–15043) — Undocumented¶
Mirrors of SunSpec values (e.g. 15020 = M713 WHRtg). Writes are accepted at protocol level but silently discarded (write probe, 2026-03-08). The aGate answers on every unit ID with the same device. See FranklinWH Extension Registers and the raw scans in the Extensions Manifest.
Model 704 - Battery Control¶
WSet vs WSetPct Sign Convention¶
Issue: Hardware uses inverted sign convention for WSetPct.
| Parameter | Software Convention | Hardware Convention |
|---|---|---|
WSet |
Positive=Charge | Positive=Charge |
WSetPct |
Positive=Charge | Negative=Charge |
Workaround: Always invert WSetPct value when writing:
⚠️ Write Access Asymmetry & Remote Control Handoff¶
This is the most significant implementation quirk affecting library design.
Control Architecture: Remote Control Clean Handoff¶
When WSetEna=1 is written to M704, the aGate automatically activates Remote Control (mobile app displays this as "VPP Mode"). This is a clean handoff, not a split-brain architecture:
WSetEna=1→ aGate activates Remote Control, native mode (Self-Consumption/TOU) is suspended- M704 commands control battery power exclusively while Remote Control is active
WSetEna=0→ Remote Control deactivates, native mode cleanly resumes
See VPP_MODE_REFERENCE.md for the Remote Control visual reference (mobile app screenshots show "VPP Mode").
Write Access Table¶
| Control Plane | Registers | Read | Write | What It Controls |
|---|---|---|---|---|
| SunSpec M704 | 40318-40354 | ✅ | ✅ | Battery power via Remote Control (WSet, WSetPct, WSetEna) |
| FranklinWH Extensions | 15507-15509 | ✅ | ❌ Read-Only* | Operating mode, SoC reserves |
| M702 Rate Settings | 40259-40262 | ✅ | ❌ (tested 2026-03-13) | Charge/discharge rate limits |
*Writes to the FranklinWH extension registers are undocumented and unconfirmed. FranklinWH has not documented these registers and has never documented any of them as writable. Whether FranklinWH must authorise a Modbus client to write them, and how, is unknown. On V12R02B60D00 (owner observation, 2026-10-21), writes to 15507–15509 did not take effect: the mode did not switch and the reserves did not change. Treat them as read-only.
What This Means in Practice¶
┌─────────────────────────────────────────────────────────────┐
│ We CAN do (SunSpec M704): WE CANNOT do: │
│ ✅ Charge battery at 3000W ❌ Change mode to TOU │
│ ✅ Discharge battery at 2000W ❌ Set reserve to 30% │
│ ✅ Set idle (stop charge/discharge) ❌ Switch to Backup │
│ ✅ Read all status + extensions ❌ Change any mode │
│ ✅ Release control (native resumes) ❌ Set PCS rate limits│
└─────────────────────────────────────────────────────────────┘
SunSpec2 Compliance Matrix¶
See
SUNSPEC_DER_SEQUENCING_REFERENCE.mdfor proper phased sequencing protocol.
| Feature | SunSpec2 Spec | FranklinWH Reality | Library Workaround | Vendor Fix? |
|---|---|---|---|---|
| LocRemCtl handoff | Remote (0) enables writes | Always Local (1), read-only; yet M704 writes work | None needed — power writes accepted despite Local | Report as spec deviation |
| Controller heartbeat | Client writes ControllerHb; DER monitors | ❌ Confirmed non-functional (write accepted, readback=0) | Not implemented — no alternative | Report as defect |
| Reversion timer (WSetRvrtTms) | DER counts down, auto-reverts power | V10 (2026-03-13): countdown runs (59→55→52) but power was not reverted at expiry (see "Hardware Reversion is Cosmetic" below). V12R02B60D00: the reverse of the spec — the reversion value applies during the countdown, the setpoint after; see M704 conformance results | Software threading.Timer via duration_s |
Report as defect |
| Reversion enable (WSetEnaRvrt) | Enables reversion behavior | Read back 1 after write (V10, undated). A read-back only: it doesn't show that reversion works; see the reversion timer row above | N/A | See the reversion timer row |
| Battery state (M713.Sta) | Sta is a status (0 OK, 1 WARNING, 2 ERROR), not a battery state | Read 0 (OK) while charging | Battery state derived from M714.DCW ±50W deadband | N/A — not a defect |
| DC Current (M714.DCA) | Reports battery DC current | 0, not the not-implemented value (V10, V12) | I = P/V needs port DCV, which reads 0 on V12, so no workaround on V12 (#129) | Report: PICS declares it supported |
| Battery temperature, port data (M714 port block) | Port type, voltage, temperature, status per battery | All 0 on V12 (PrtTyp = PV, DCSta = OFF, Tmp 0) | None | Report: PICS declares them supported (#129) |
| Ramp rate (WRmp) | Smooths power transitions | Returns None (unimplemented) | Software SoC ramp via --soc-ramp-window |
Report; software ramp is different concept |
| Extension register writes | N/A (vendor-specific) | Read-only; writes undocumented and not applied (V12R02B60D00, 2026-10-21) | Cloud API bypass (Tier 2) for mode changes | Unknown; FranklinWH has not documented any write mechanism |
| Remote Control activation | WSetEna=1 starts remote DER control | ✅ Works — activates Remote Control (exclusive) | None needed — works as intended | N/A — working correctly |
| Command persistence | WSetRvrtTms reverts after timeout | V10: countdown active, power not reverted at expiry. V12R02B60D00: inverted, see M704 conformance results. WSetEna stays 1 on both |
Software timer + reset_control_state() remains recommended |
Report as defect |
| Throttle % (ThrotPct) | Reports inverter power curtailment % | Not implemented on V10 (2026-05-14 scan) and V12 (2026-10-20). An earlier version of this row said "readable, always 0 %" with no raw read; see Alarms, Errors and Exceptions | None — read-only info point | N/A — may activate under thermal/grid stress |
| Throttle source (ThrotSrc) | Bitfield of throttle cause | 0xFFFFFFFF (unimplemented) | Not implemented — no alternative | Report; no workaround possible |
| Grid charge/discharge limits | WChaRteMax / WDisChaRteMax (RW per spec) |
❌ Confirmed: registers return 0xFFFF, writes silently discarded even with Remote Control + proper sequencing | Cloud API setPowerControl is only path |
Report as defect |
| VA charge/discharge limits | VAChaRteMax / VADisChaRteMax (RW per spec) |
❌ Confirmed: 0xFFFF, writes discarded | Cloud API only | Report as defect |
| Max power limit (WMaxLimPct) | Caps inverter output at % of rated | ❌ Confirmed non-functional. WMaxLimPctEna write silently discarded (readback=0). WMaxLimPct readable (1000) but enable never sticks | Not implemented | Report as defect |
| Reactive power enable (VarSetEna) | Enables reactive power control | ❌ Confirmed non-functional. Write accepted, readback=0 (silently discarded). VarSetMod/VarSetPri readable but VarMaxInj/Abs=0xFFFF | Not implemented | Report as defect |
Test methodology: All features re-tested 2026-03-13 using proper SunSpec 6-phase protocol (Pre-flight → Mode → Safety → Setpoint → Enable → Verify) with 200-500ms inter-phase settling. See
SUNSPEC_DER_SEQUENCING_REFERENCE.md.Test evidence:
tests/results/2026-03-13_pcs_charge_rate_write_probe.md,tests/results/2026-03-08_p1_control_tests.md
Crash-Orphan Risk¶
Caution
If the consumer application crashes while WSetEna=1, the aGate remains in Remote Control indefinitely (mobile app continues to show "VPP Mode"). There is no hardware timeout to auto-revert (WSetRvrtTms does not revert per spec on V10 or V12R02B60D00; see "Hardware Reversion is Cosmetic" below). The library provides reset_control_state() for graceful shutdown, but crash recovery is a consumer responsibility, not a library concern.
The LocRemCtl Paradox (Model 715) — TESTED 2026-03-08¶
Model 715 LocRemCtl (PDU address 1089) reports 1 = Local Control and is read-only.
Per SunSpec 2 spec:
- LocRemCtl = 1 (Local) → DER should reject ALL Modbus client writes
- LocRemCtl = 0 (Remote) → DER accepts write commands from Modbus clients
FranklinWH violates this fundamentally. The aGate: - ✅ Accepts M704 power writes (WSetEna, WSetPct, WSetMod) despite being in Local mode - ❌ Ignores M715 lifecycle writes (ControllerHb — confirmed non-functional even with proper sequencing) - ⚠️ WSetRvrtTms value accepted and the countdown runs (V10, 59→55→52). Power was not reverted at expiry on V10, and on V12R02B60D00 the behaviour is inverted (see "Hardware Reversion is Cosmetic" below)
This creates a selective-write hybrid that is non-standard:
| Feature | SunSpec 2 Expectation (Local) | FranklinWH Actual |
|---|---|---|
| Power writes (WSetPct) | ❌ Reject | ✅ Accepts |
| Power enable (WSetEna) | ❌ Reject | ✅ Accepts |
| Reversion config (WSetRvrtTms) | ❌ Reject | ✅ Accepts value |
| Reversion countdown (WSetRvrtRem) | N/A | Counts down (V10, 59→55→52); does not give a spec reversion (see below) |
| Controller heartbeat (ControllerHb) | ❌ Reject | ❌ Confirmed non-functional (write accepted, readback=0) |
| DER heartbeat (DERHb) | N/A | ❌ Always 0 |
| LocRemCtl write | Allow | ❌ Read-only |
Test evidence: See tests/results/2026-03-08_p1_control_tests.md
Design Implications¶
-
Remote Control provides clean control handoff: When
WSetEna=1, the aGate suspends native mode and grants exclusive Modbus control. This is cooperative, not conflicting. -
No usable hardware reversion timer: on V10 the WSetRvrtTms countdown ran but power was not reverted at expiry; on V12R02B60D00 the reversion value applies during the countdown and the setpoint after it (M704 conformance results). Neither is a fail-safe.
-
ControllerHb remains non-functional: Even with proper sequencing, heartbeat writes are silently discarded. Software watchdog (
duration_s/--revert) remains the primary safety mechanism. -
Virtual modes operate within Remote Control: Our virtual Self-Consumption/TOU/Peak-Shave modes work by calculating power targets and issuing M704 commands while Remote Control is active.
-
Library vs consumer boundary: The library exposes
send_command()andreset_control_state(). Crash recovery, watchdog timers, and session lifecycle are consumer responsibilities (e.g. FEM'sModbusControlService). -
Extension writes are undocumented: FranklinWH has never documented any extension register as writable, and whether it must authorise a Modbus client to write them is unknown. On V12R02B60D00 (2026-10-21) writes to 15507–15509 did not take effect. The library treats them as read-only and reports each write's read-back result.
Detection of Write Capability¶
# connect() never writes. test_extension_writability() is opt-in:
# it writes a test value, reads it back, and restores the original.
results = ctrl.test_extension_writability() # WRITES TO THE DEVICE
results['ongrid_mode']['writable'] # True only if the read-back matched
Related¶
SUNSPEC_DER_SEQUENCING_REFERENCE.md— Proper 6-phase SunSpec control protocolTODO_INTENT_BASED_CONFLICT_DETECTION.md— Re-scoped with Remote Control handoff model- VPP_MODE_REFERENCE.md — Remote Control visual reference (mobile app: "VPP Mode")
SunSpec2 Client — Address Remapping¶
Issue: The SunSpec2 Python library (sunspec2.modbus.client.ModbusClientTCP) remaps register addresses internally. The client.read() method adjusts addresses based on SunSpec model base offsets, causing "Modbus exception 2" (illegal address) when attempting to read FranklinWH proprietary extension registers (15000+ and 15500+).
The SunSpec2 client also does not expose read_holding_registers() — it has only read() and _read().
Workaround: Use raw Modbus TCP socket for all extension register reads:
import struct
client = self.dev.client
sock = client.socket
req = struct.pack('>HHHBBHH', 0, 0, 6, unit_id, 3, start_addr, count)
sock.settimeout(self.timeout) # Important for WiFi networks
sock.sendall(req)
resp = sock.recv(256)
Code Location: src/franklinwh_modbus/controller.py:_read_extension_solar(), read_native_mode()
Register Addressing — PDU Addresses (Modbus) and the SunSpec Map¶
Source of truth: Modbus terms¶
Addressing is a Modbus matter, not a SunSpec one: there is no "SunSpec address base". These docs use the Modbus Organization's terms, from the MODBUS Application Protocol Specification V1.1b3 (2012-04-26) and the MODBUS Messaging on TCP/IP Implementation Guide V1.0b (2006-10-24). Both are published at https://www.modbus.org/specifications (download requires accepting the Modbus EULA; titles and dates as listed there, PDF text not re-checked for this page).
| Term | Meaning | Example (ControllerHb) |
|---|---|---|
| PDU address | 0-based number sent in the request PDU, 0–65535. This is what goes on the wire. | 1092 |
| Register number | The same register counted from 1 in the data model (register N is PDU address N−1). | 1093 |
| Holding register | The data table read with function code 3 and written with 6 (single) or 16 (multiple). All aGate points used here are holding registers. | — |
| 4xxxx reference | Legacy Modicon convention, not an address: the leading 4 means "holding register", so 40001 = holding register 1 = PDU address 0. | 41093 |
In these docs, every register address is a PDU address unless it says otherwise. That includes the FranklinWH PICS addresses (owner-confirmed: the official PICS aligns with PDU addresses; e.g. ControllerHb 1092, matching SUNSPEC_DEVICE_SNAPSHOT.md) and the extension registers (15000–15043, 15500–15513, 16000–16002).
What SunSpec adds: the "SunS" map¶
SunSpec defines where its register map starts, not how Modbus addresses work. A SunSpec device map begins with the 32-bit marker "SunS" (0x53756E53) at one of the well-known starting PDU addresses, 0, 40000 or 50000, followed by Model 1 (Common). Models are chained blocks of ID, L (length) and L registers of points, and the chain ends with ID 0xFFFF.
On the aGate (firmware V10R01B04D00): the map starts at PDU address 0. Model 1's ID is at PDU 2. sunspec2 finds it by scanning with base_address=0.
What works on the aGate (tested 2026-03-15)¶
Standard SunSpec models (M1–M715), holding registers:
├── sunspec2 library: scans from PDU 0, then reads models → ✅ WORKS
├── pymodbus / raw TCP: PDU address 0 … 1125, e.g. 1092 → ✅ WORKS
└── map probed at 40000: PDU 40000+ (e.g. 41092) → V10: ❌ exception 2 | V12: ✅ mirror (see below)
FranklinWH extension registers (outside the SunSpec chain):
├── sunspec2 library: can't address them (not in the chain) → ❌
├── pymodbus / raw TCP: PDU address 15500, 15507 … → ✅ WORKS
└── offset by 40000: PDU 55500+ → V10: ❌ exception 2 | V12: not tested
Firmware difference: the 40000 mirror (2026-10-20)¶
On V12R02B60D00 the aGate also serves its whole SunSpec map at PDU 40000. A read-only check on 2026-10-20 found: - the "SunS" marker at both PDU 0 and PDU 40000; - PDU 40070–40071 equal to PDU 70–71 (701 ID and L); - PDU 41092–41093 readable; - PDU 50000 still returns exception 2.
On V10R01B04D00 (tested 2026-03-15), PDU 40000+ returned exception 2. Either the firmware added the mirror or the March test missed it; we can't tell which.
What this means:
- Keep using PDU 0 addresses. They work on both firmwares.
- pysunspec2's scan() tries 40000 first, so on V12 it finds the map at 40000 and records dev.base_addr = 40000. Any client that probes 40000 first binds to the mirror, including this library today: its base_address is ignored with pysunspec2 1.3.6 (#84). Model reads still work, because the mirror matched PDU 0. Writes to the mirror work (2026-10-23: M704 at 40319, 5000 W discharge applied), but the response echoes the base-0 address: a write to 40319 is answered with address 319, and one to 41092 with 1092. Modbus requires the echo to match the request. pysunspec2 doesn't check it; a strict client may reject the reply. is_connected() probes dev.base_addr (#71), so it works either way.
- Extension registers have not been tested at a 40000 offset on V12. Use their listed PDU addresses.
A tool configured to subtract 40001 (or add 40000) will miss: send the PDU address as listed.
Which code uses raw PDU addresses¶
The extension registers sit outside the SunSpec chain, so sunspec2 can't reach them. These functions send their PDU addresses in hand-built requests:
| Function | Registers (PDU) |
|---|---|
_read_extension_solar() |
15500–15513, 16000 |
read_native_mode() |
15507–15509 |
test_extension_writability() |
15507–15509 (writes) |
clear_alarms() |
1094 (M715 AlarmReset) |
Everything else (connect(), send_command(), the read_*_status() methods, Remote Control) goes through sunspec2 model access, which handles addressing after the scan:
# controller.py __init__
base_address: int = 0 # sunspec2 scans for "SunS" starting at PDU 0
# SunSpecModbusClientDeviceTCP.scan():
# 1. reads PDU 0 → finds "SunS"
# 2. walks the model chain from PDU 2 (Model 1 ID)
# 3. stores each model's address; later reads use them
UID aliasing (observed 2026-03-15)¶
The aGate ignores the Modbus unit identifier: every UID tried (1, 2, 3, 126, 247) returned the same 17 models from a scan at PDU 0. Scans at 50000 found nothing. Scans at 40000 were recorded as "varies" in the 2026-03-15 notes, while direct reads at PDU 40000+ return exception 2 (above). That entry is unexplained and not re-tested; treat it as unverified.
We use unit_id=2 (FranklinWH default), but any UID works.
Rules for new code¶
- Standard SunSpec reads and writes: use sunspec2 model access, never hand-built addresses.
- Extension registers (15000+, 15500+, 16000+): send the listed PDU address with function code 3 (read) or 6/16 (write).
- Use PDU 0 addresses; don't rely on a 40000 offset. The aGate's map starts at PDU 0. PDU 40000+ returned exception 2 on V10R01B04D00 and is a mirror of the SunSpec map on V12R02B60D00 (above). Neither has been tested for extension registers.
- UID doesn't matter, but use
unit_id=2for consistency with FranklinWH docs.
Register 16000 — High-Resolution Home Load (Discovered 2026-03-15)¶
16000 gives the home load at ~1 W resolution, while 15506 is in ~100 W steps. Measured 2026-03-15: 1004/1000, 929/900, 812/800 and 835/800 W (16000/15506). The library uses 16000 and falls back to 15506. It's undocumented, so firmware could change it. 16001 and 16002 are covered in FranklinWH Extension Registers.
Model 502 — Power Rounding (Scale Factor Quantization)¶
Discovered: 2026-03-12 · Severity: Low (cosmetic) · Reported to: FranklinWH Support
FranklinWH aGate SunSpec registers round power values to coarse resolution (~100W steps) due to integer registers with limited scale factors. Small power flows are quantized upward, making them appear much larger than actual.
Example: Enphase Envoy S Metered standby draw (~50-100W parasitic load on the PV circuit at night) appears as 500-600W of "solar generation" in both Modbus (M502.OutPw) and Cloud API readings. The aGate is the source of truth for both, so the coarse value propagates everywhere.
Impact:
- Solar power entities show non-zero values at night (confusing but not harmful)
- --status shows Solar: 500W Producing when actual solar generation is 0W
- Home load calculation ((calc)) is inflated by the phantom solar component
- Energy totals may include phantom solar contribution from parasitic loads
No software fix possible — the quantization happens in aGate firmware before the registers are read. The Cloud API mirrors the same coarse values since both originate from the aGate's internal metering.
Possible future mitigation: Time-based solar gating (zero solar output between sunset and sunrise) or a configurable dead-band threshold. Neither is implemented yet.
Serial Number Structure (Unconfirmed)¶
Warning
FranklinWH does not publicly document their serial number encoding scheme. The following structure is our best guess based on observed patterns across aGate and aPower devices. It should not be treated as authoritative.
FranklinWH serial numbers appear to encode device type, hardware revision, and unique ID:
XXXXXXXXXXXXXXXXXXXX
│ │ │ │
│ │ │ └── Unique serial (last 8 chars)
│ │ └─────────── Hardware revision (3 chars, e.g. "A02") — unconfirmed
│ └────────────── Device type prefix — unconfirmed
└────────────────────── Full serial (20 chars)
Why this matters (if correct):
- Hardware revision may determine capabilities — some revs may have more/fewer functions
- Extract rev from serial: serial[8:11] (e.g. "A02") — unverified assumption
- Example: aGate A02 vs A03 may differ in supported Modbus registers
- Available from M1.SN (Model 1 Common, address 40052)
Model 704 — Hardware Reversion is Cosmetic (PICS Issue 4)¶
V12R02B60D00 (2026-10-22): reversion fires, but inverted
On V12 the countdown starts when WSetRvrtTms is written, not on enable. During the countdown the reversion value applies (0 W with WSetPctRvrt=0, about 250 W with WSetPctRvrt=5); after expiry the setpoint applies. WSetEna stays 1. This is the reverse of the spec, 3 of 3 runs, raw frames. It is not a fail-safe. The text below records the earlier firmware. See M704 conformance results.
Heartbeat on V12R02B60D00 (2026-10-23)¶
ControllerHb (M715, PDU 1092–1093, mirror 41092) is still non-functional:
- 24 FC16 writes (1…24, every 5 s) at 41092, all acknowledged; ControllerHb read 0 every time, and DERHb stayed 0.
- Independent cross-check at base 0 with plain pymodbus: ControllerHb=7 acknowledged, read back 0 for 3 s. A positive control in the same run (WSetPctRvrt at 325 = 50) read back 50, so the tool's writes do land.
Logs: tests/results/heartbeat/ (local, gitignored).
Issue (V10R01B04D00, 2026-03): WSetRvrtTms (327) countdown works (30→0), but does NOT revert power at expiry. WSetEna and WSetPct are unchanged 186 seconds post-expiry. The SunSpec dead-man switch is non-functional.
Evidence: 186s extended observation, WSetRvrtTms=1 (1s edge case) also non-functional. Corroborated by FranklinWH app ("VPP Mode" persisted), MQTT, and Home Assistant.
Severity: CRITICAL — combined with non-functional ControllerHb (1092), there is zero hardware safety mechanism on this firmware.
Workaround: Software-only dead-man via send_command(duration_s=N) in controller.py:
# Software timeout is the ONLY safety mechanism
ctrl.send_command(BatteryCommand(-5000), duration_s=300) # 5min auto-release
Code Location: controller.py — send_command() docstring documents this explicitly.
Full Details: PICS_CONFORMANCE_CROSS_REFERENCE.md — Issue 4
Model 704 — No Input Validation on WSet/WSetPct (PICS Issue 5)¶
Issue: The device accepts WSet=15000W (150% of WMaxRtg=10000W) and WSetPct=±1500 (±150%) without Modbus exception, alarm, or clamping. Values read back exactly as written.
Severity: HIGH — downstream clamping status unknown. Software must enforce range limits.
Workaround: Two layers of clamping in the library:
1. BatteryCommand.__post_init__() — clamps to ±10000W at construction time
2. controller._validate_power() — clamps to device-reported WMaxRtg at write time
Code Location: types.py and controller.py
Full Details: PICS_CONFORMANCE_CROSS_REFERENCE.md — Issue 5
Model 704 — Reactive Power Not Controllable (All Paths Exhausted)¶
Issue: No Modbus-accessible reactive power or PF control path exists on this firmware.
Paths tested: | Path | Register | Result | |------|----------|--------| | VarSetEna (331) | M704 | Silently discards all writes — 0/160 tests | | PFWInjEna (298) | M704 | Writable but PF setpoints (267/268) are 0xFFFF | | CtrlModes FIXED_VAR | M702 | Firmware claims available but no Modbus path |
Conclusion: The device manages reactive power internally. This is final — no further investigation paths remain.
Full Details: PICS_CONFORMANCE_CROSS_REFERENCE.md — Issues 1, 3, 6
General Notes¶
- Scale Factors: Always read SF registers dynamically — they can change
- Model Discovery: aGate implements models 1, 502, 701, 702, 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, 715
- Write Sequencing: All SunSpec DER control groups require proper phased sequencing (Phase 0-5). See
SUNSPEC_DER_SEQUENCING_REFERENCE.md - Timing: Minimum 100-500ms inter-phase settling. aGate round-trip ~98ms average. Do not rapid-fire writes.
- Timeout: WiFi networks to the aGate can be slow; always use configurable timeout (default 10s)
- Addressing: read and write every register at its PDU address (see Register Addressing). An undated earlier note said M704 also answered at a 40000 offset, while M715 did not. That conflicts with the 2026-03-15 test (PDU 40000+ → exception 2) and is unverified.
Last Updated: 2026-03-22 (terminology: VPP Mode → Remote Control, PICS Issue 4 reversion cosmetic, Issue 5 no input validation, reactive power exhausted)
Device Tested: FranklinWH aGate X (SN: XXXXXXXXXXXXXXXXXXXX, FW: V10R01B04D00)