Connect to the inverter via Modbus TCP (default port 502) or Modbus RTU over RS-485; confirm the SunSpec base register by reading two holding registers starting at 40001 — a valid device returns the ASCII string 'SunS' (0x53756e53).
Walk the model chain starting at register 40003: read the model ID (uint16) and length (uint16), parse the model block, then advance by length+2 to find the next model ID until you encounter model 65535 (end marker).
Parse Model 1 (Common) for manufacturer, model, serial number, and firmware version; parse the applicable inverter model (101 single-phase, 103 three-phase, or float variants 111/113) for AC power, voltage, current, frequency, and energy totals.
For storage systems, parse Model 802 (Battery Base Model) for state of charge, state of health, charge/discharge power, and available energy; for multiple MPPT strings, read Model 160.
Apply the scale factors (SF registers, which are signed integers) to each measurement field by multiplying the raw integer value by 10^SF before engineering unit conversion.
Poll at 1–5 second intervals per SunSpec guidance; faster polling can overwhelm low-power inverter communication processors and cause dropped connections.
Known gotchas
Scale factor registers may return 0x8000 (not-implemented) for unused fields; treat this as NaN rather than multiplying by the raw value, or you will produce wildly incorrect telemetry.
Some vendors implement proprietary models at IDs above 64000 or insert non-standard gaps in the model chain; your model walker must handle unknown model IDs gracefully by skipping based on the length field rather than crashing.
Modbus TCP connections are often limited to a small number of simultaneous clients on embedded inverter processors; implement connection pooling and retry with backoff rather than opening a new TCP connection per poll.
Give your agent this knowledge — and 200+ more routes
One MCP install gives any agent live access to the full route map, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp