Skip to main content

Parallel inverters: mobile app changes

From: backend (cse_tcp_be) · Date: 28 Oct 2026 Context: a plant can have several inverters working in parallel — since 2026-11-23, only identical Nexus units (see Task 4). The app can now show them combined (the whole plant) or one at a time, live and in history.

The backend side is done. This page is what the app needs to change. Everything below is about the WebSocket API (watch, get_analytics, get_param_catalog, get_param_history, register, update_device).

:::caution Timing The combined features only work once the backend is deployed.

  • Live combined watch: an older server ignores it silently and sends no reply at all.
  • Combined charts: an older server refuses them with invalid_request.

Build the combined features behind a fallback (task 7), so the app works against both the old and the new server. :::

Full reference:


What changes for the user​

ScreenTodayAfter this change
Plant dashboard (live)One inverter at a timeWhole-plant live figures (all inverters added up correctly), plus each inverter's status
Analytics → "Entire Plant"Already combinedSame, now asked for explicitly; shows a note when paralleled inverters were counted once
Historical DataOne inverter onlyNew: whole-plant charts for totals (power, energy, battery level)
Add device / move deviceAlways allowedA plant that already has an inverter takes another only when the user confirms it is wired in parallel, and only identical Nexus units; a plant can also be full (50 inverters by default)
Everything per inverter—Unchanged. Every request you send today keeps working exactly as it does now

The one idea to get across in the UI​

The group is every inverter the user has in this plant. The server decides who is in it, from the database.

  • An inverter that goes offline stays in the group. It just shows as offline.
  • An inverter joins or leaves only when it is added, moved, or deleted.

So the app never builds the group itself. It shows what the server sends.


The scope field (applies to every task)​

Add an optional scope to the requests below:

scopeMeaningIdentify the target with
"combined"The whole plantuserId + plantId (no deviceKey)
"individual"One inverterdeviceKey (as today)
leave it outExactly today's behaviouras today

Rules:

  • scope is case-insensitive.
  • Never send a deviceKey with "combined". The server refuses it.
  • If you leave scope out, nothing changes. You only need it for the new combined features.

Task 1: Plant dashboard, live combined view​

Start and stop​

// send
{ "type": "watch", "scope": "combined", "userId": "<uuid>", "plantId": "<plantId>", "timezone": "Asia/Karachi" }
{ "type": "unwatch", "scope": "combined", "plantId": "<plantId>" }
  • timezone: send the user's saved IANA zone, the same value you send to Analytics. It decides what "today" means for the daily totals.
  • Send unwatch when the screen closes.
  • Closing the WebSocket ends every watch automatically.
  • On every reconnect, send the combined watch again, exactly as you already re-send per-inverter watches.
  • Sending the same combined watch twice is safe. The second replaces the first.
  • Limit: 8 plants per connection. A dashboard needs one.

First reply: watch_ack​

{ "type": "watch_ack", "scope": "combined", "plantId": "P1", "ok": true,
"members": [ { "deviceKey": "…", "model": "Yorker", "inverterSn": "…" } ],
"maxInverters": 50, "timezone": "Asia/Karachi" }
  • Tell it apart from a per-inverter watch_ack by scope == "combined"; a per-inverter one has deviceKey instead.
  • members is the inverter list. Use it to label rows: look up each inverter's display name from get_devices by deviceKey.
  • You can receive another watch_ack later, when an inverter is added to, moved out of, or deleted from the plant. Replace your member list each time.

When ok is false:

codeShow the user
GROUP_NOT_FOUND"No inverters in this plant." Don't retry.
GROUP_TOO_LARGE"This plant has too many inverters to combine." Offer the per-inverter view.
GROUP_UNAVAILABLE"Couldn't load the plant. Retrying…" Retry with backoff, for example 5 s, 10 s, 30 s.
INVALID_REQUESTA bug in the request: check userId and plantId. Also sent if this connection already has 8 combined watches.

Updates: group_telemetry​

{ "type": "group_telemetry", "plantId": "P1", "asOf": "2026-10-28T10:15:03Z",
"combined": {
"pv_power_w": 9120, "load_power_w": 4310, "grid_power_w": -250, "battery_power_w": -800,
"inverter_power_w": 250,
"battery_soc_pct": 71.5, "battery_soc_min_pct": 64, "battery_soc_max_pct": 80,
"pv_energy_today_kwh": 31.2, "load_energy_today_kwh": 18.4,
"pv_energy_total_kwh": 18234.5, "rated_power": 18
},
"coverage": { "grid_power_w": { "reporting": 1, "of": 3 } },
"members": [
{ "deviceKey": "…", "model": "…", "state": "fresh", "receivedAt": "…", "parallel": true, "valid": true },
{ "deviceKey": "…", "model": "…", "state": "offline", "receivedAt": null, "parallel": false, "valid": true }
],
"counts": { "fresh": 2, "stale": 0, "offline": 1 },
"faults": [ { "deviceKey": "…", "code": "F01" } ],
"warnings": [ { "deviceKey": "…", "code": "W07" } ],
"displayCodes": [ { "deviceKey": "…", "code": "56" } ],
"valid": true }

How often it arrives:

  • at most once a second;
  • at least every 30 s while the screen is watched.

Always render the latest one.

What to show:

UI elementFieldUnitNotes
Solar nowcombined.pv_power_wWSum of the inverters reporting now
Home load nowcombined.load_power_wW
Grid nowcombined.grid_power_wWSigned: + = buying from the grid, − = selling
Battery nowcombined.battery_power_wWSigned: + = charging, − = discharging
Inverter nowcombined.inverter_power_wW−grid_power_w on every model (owner rule, since 2026-11-24): 0 at Balance, minus the grid import while buying, the grid export while selling. Present exactly when grid power is. Never compute it in the app (e.g. grid + battery): show "—" when absent
Battery levelcombined.battery_soc_pct%Average across batteries. Show battery_soc_min_pct–battery_soc_max_pct as a range if they differ
Today's energycombined.*_energy_today_kwhkWhpv, load, grid_import, grid_export, battery_charge, battery_discharge
Lifetime energycombined.*_energy_total_kwhkWh
Installed capacitycombined.rated_powerkW (not W)Includes offline inverters. Missing, or short, when a member reports no rated_power: Yorker 5, 6 and 6.5 kW units (model code 6KU) don't until their rating is set with update_device (ratedPowerKw). Treat a missing key as "unknown", never as 0 kW
Online statuscounts—For example "2 of 3 inverters online"
Per-inverter listmembers[]—Name (from get_devices), state badge
Alertsfaults, warnings, displayCodes—Show which inverter each code is from

Rules the UI must follow​

  1. A missing field is "no data", never 0. If combined has no grid_power_w, show "—", not "0 W". For example, no inverter in the plant may have a grid meter.

  2. Show partial figures as partial. If coverage["grid_power_w"] is { "reporting": 1, "of": 3 }, the number covers 1 of 3 inverters. Show a small hint, for example "1 of 3 inverters".

  3. Don't add anything up yourself. The server already applies the right rule per field; for example, paralleled IP20 units are not double-counted. Never sum the per-inverter telemetry messages to make a plant total.

  4. Voltage, frequency and temperature are per inverter only. They are not in combined. To show them, open that inverter's own view (a normal per-inverter watch).

  5. state values:

    stateMeaningBadge
    freshReported within 90 sgreen
    staleConnected, but no reading for over 90 samber
    offlineOffline, or never reportedgrey

    Only fresh inverters count in the "now" power figures. Today's energy still includes inverters that reported earlier today.

  6. valid: false: one inverter's last reading was incomplete. Keep showing the numbers, with a subtle "some data missing" hint.

A combined watch does not also send per-inverter telemetry. If one screen shows the plant total and one inverter's live detail, send both watches.

Server ended the watch: group_watch_ended​

{ "type": "group_watch_ended", "plantId": "P1", "code": "GROUP_NOT_FOUND", "error": "…" }

The server stopped the watch: the plant became empty, or grew past the limit, while the user was looking. Nothing more comes for it. Handle it like the same code in the watch_ack table above.

Dart sketch​

class GroupMember {
final String deviceKey, model, state; // state: fresh | stale | offline
final DateTime? receivedAt;
final bool parallel, valid;
GroupMember.fromJson(Map<String, dynamic> j)
: deviceKey = j['deviceKey'],
model = j['model'] ?? '',
state = j['state'],
receivedAt = j['receivedAt'] == null ? null : DateTime.parse(j['receivedAt']),
parallel = j['parallel'] ?? false,
valid = j['valid'] ?? true;
}

class GroupTelemetry {
final String plantId;
final DateTime? asOf;
final Map<String, double> combined; // missing key = no data, never 0
final Map<String, ({int reporting, int of})> coverage;
final List<GroupMember> members;
final bool valid;

GroupTelemetry.fromJson(Map<String, dynamic> j)
: plantId = j['plantId'],
asOf = j['asOf'] == null ? null : DateTime.parse(j['asOf']),
combined = (j['combined'] as Map<String, dynamic>? ?? {})
.map((k, v) => MapEntry(k, (v as num).toDouble())),
coverage = (j['coverage'] as Map<String, dynamic>? ?? {}).map((k, v) =>
MapEntry(k, (reporting: v['reporting'] as int, of: v['of'] as int))),
members = (j['members'] as List? ?? [])
.map((m) => GroupMember.fromJson(m as Map<String, dynamic>))
.toList(),
valid = j['valid'] ?? false;

double? value(String field) => combined[field]; // null => show "—"

bool isPartial(String field) {
final c = coverage[field];
return c != null && c.reporting < c.of;
}
}

// In your message router:
void onMessage(Map<String, dynamic> m) {
switch (m['type']) {
case 'watch_ack' when m['scope'] == 'combined':
m['ok'] == true ? plant.setMembers(m['members']) : plant.showError(m['code']);
case 'group_telemetry':
plant.update(GroupTelemetry.fromJson(m));
case 'group_watch_ended':
plant.showError(m['code']);
// existing cases ('watch_ack', 'telemetry', 'presence', …) unchanged
}
}

Task 2: Analytics, "Entire Plant"​

The app already sends get_analytics with plantId and no deviceKey for the whole plant. That keeps working unchanged. Recommended: add "scope": "combined" so the request states its intent.

{ "type": "get_analytics", "scope": "combined", "userId": "…", "plantId": "P1",
"period": "month", "month": "2026-10", "timezone": "Asia/Karachi", "requestId": "…" }

New fields in the reply's scope object:

FieldUse
scope.kind"combined" or "individual"
scope.membersThe inverters the figures cover
scope.parallelSetsPresent only when the plant has paralleled IP20 inverters: lists of deviceKeys that were counted as one system

When parallelSets is present:

  • notices contains { "code": "PARALLEL_SET_COMBINED" }. Show a small info note, for example "Inverters running in parallel are counted as one system."
  • completeness counts each paralleled set as one inverter. Don't compare completeness.devicesExpected with the number of devices in the plant.

Inverters whose logger was moved to another inverter (status deactivated) are no longer counted in the plant view. They no longer show up as "missing". Opening one on its own (deviceKey) still shows its history.

The per-inverter Analytics view is unchanged: keep sending deviceKey (with or without plantId). Optionally add "scope": "individual". Don't send "combined" with a deviceKey; that's refused with invalid_request.


Task 3: Historical Data, whole-plant charts (new)​

Add a "whole plant" option to the Historical Data screen's device picker. In that mode, send scope: "combined" with plantId instead of deviceKey.

Parameter picker​

{ "type": "get_param_catalog", "scope": "combined", "userId": "…", "plantId": "P1", "requestId": "…" }
  • The reply only lists parameters that make sense combined: total power of each kind, energy counters, rated power, and SOC (averaged). Empty groups are left out.
  • Build the whole-plant picker only from this reply. Don't reuse the per-inverter picker: it offers voltages, currents and the like, which can't be combined.
  • The reply has scope, plantId and members instead of deviceKey, model and variant.

Chart​

{ "type": "get_param_history", "scope": "combined", "userId": "…", "plantId": "P1",
"period": "day", "date": "2026-10-28", "timezone": "Asia/Karachi",
"params": ["pv_power_w", "pv_energy_today_kwh"], "requestId": "…" }

How this differs from a per-inverter chart:

Per inverterWhole plant
Identify bydeviceKeyplantId
Day grain"native" (every reading)"5m" (5-minute buckets)
Week grain"15m""15m"
Reply identitydeviceKey, modelscope, plantId, members
Per pointvalues[key][i]values[key][i], plus reporting[i] of of inverters had data
A parameter that can't combine—not charted; listed in unavailable as { "block": "<key>", "reason": "PER_INVERTER_ONLY" }

UI rules:

  • Partial points: if reporting[i] < of, draw that point as partial, for example a hollow marker, or a footnote like "2 of 3 inverters". Don't treat it as a real dip.
  • Gaps: values are never null; the server sends 0 where nothing was stored, as it does for one inverter. Break the line where consecutive t values are more than ~10 min apart on Day, or ~30 min on Week.
  • Month / Year / Total tabs are get_analytics with scope: "combined" (task 2), not get_param_history.

Task 4: Adding or moving a device: parallel confirmation and "plant full"​

One inverter per plant, unless wired in parallel (2026-11-23)​

A plant with no inverter takes any inverter. A plant that already has one takes another only when the request carries "parallel": true (top-level, on register and on an update_device plant move), and only when both are Nexus inverters with the same model code and rated kW. A Yorker plant holds exactly one inverter. Full rules: Which inverters can share a plant.

The flow:

  1. Send register (or the plant move) without parallel.
  2. If the reply is PARALLEL_CONFIRMATION_REQUIRED, ask: "This plant already has an inverter. Is this one wired in parallel with it, or is it a separate plant?"
  3. "Parallel" → resend the same request with "parallel": true. "Separate plant" → let the user pick or create another plant.
code (register / update_device)Show the user
PARALLEL_CONFIRMATION_REQUIREDThe question above.
PARALLEL_NOT_SUPPORTED"Only Nexus inverters can be wired in parallel in one plant. Add this inverter to a separate plant."
PARALLEL_SPEC_UNKNOWN"We don't know this inverter's exact model yet. Power it on with the logger plugged in, wait until it is online, then try again."
PARALLEL_SPEC_MISMATCH"Parallel inverters must be exactly the same model. Add this inverter to a separate plant."

These replies also carry inverter (the one being added) and plantInverters (the plant's), each with optional model, modelCode and ratedPowerKw — use them to say, for example, "This is an 8 kW Nexus; the plant has a 6 kW Nexus." There is never a deviceKey in them.

Ownership and conflict codes (NOT_AUTHORIZED, DEVICE_IN_ANOTHER_PLANT, LOGGER_ALREADY_BOUND, …) always come first, so the "parallel?" question is never asked about a device the user could not add anyway.

A logger that has never connected cannot be added to a plant that already has an inverter: the server does not know its model yet. Have the installer power the inverter with the logger plugged in and wait until it connects, then scan. An empty plant is unaffected.

Plant full​

A plant can hold at most 50 inverters (server setting):

RequestNew codeShow the user
registerPLANT_FULL"This plant already has the maximum number of inverters. Add this device to another plant."
update_device (plant move)PLANT_FULL"The destination plant is full. Choose another plant."

Re-registering a device that is already in the plant is never refused this way.


Task 5: Per-inverter views, nothing to change​

Each inverter's own live view, settings, writes, alerts, Activity Trail and charts work exactly as today. No change is needed. In the plant view, tapping an inverter in members should open the existing per-inverter screen with that deviceKey.


Task 5b: Show which Nexus is the master​

A Nexus now reports where it sits in its parallel set. Show it as a small badge on each inverter in the plant's list and on the inverter's own screen.

WhereFieldValues
get_devices, each "device" itemparallelRole, parallelAddress, parallelCount"master", "slave", "standalone", "misconfigured"; address and count are numbers
Live telemetry and lastReadingsparallel_role, parallel_address_setting, total_number_in_parallel_settingthe same values
parallelRoleShow
master"Master"
slave"Slave" (optionally "Slave 2 of 3", from address and count)
standalonenothing
misconfigureda warning: "Parallel settings incomplete": the set's addresses are not 1 to N
absentnothing (not read yet, or a model that does not report it: Yorker never does)

Prefer the live parallel_role while the inverter is being watched: the stored parallelRole is updated with lastReadings, so it can trail a settings change by up to a minute. The role is per inverter; the combined group_telemetry does not carry it.

enum ParallelRole { master, slave, standalone, misconfigured }

ParallelRole? parseParallelRole(Object? v) => switch (v) {
'master' => ParallelRole.master,
'slave' => ParallelRole.slave,
'standalone' => ParallelRole.standalone,
'misconfigured' => ParallelRole.misconfigured,
_ => null, // absent or a value this app version does not know
};

// From a get_devices "device" item:
// parallelRole = parseParallelRole(j['parallelRole']);
// parallelAddress = j['parallelAddress'] as int?;
// parallelCount = j['parallelCount'] as int?;
// From a telemetry record's readings:
// parallelRole = parseParallelRole(readings['parallel_role']);

Task 6: Reconnects and screen lifecycle​

EventDo
Plant screen openswatch (combined)
Plant screen closes / app backgroundedunwatch (combined)
WebSocket reconnectsRe-send every active watch: per-inverter and combined
User switches plantunwatch the old plantId, watch the new one
watch_ack with new members arrivesReplace the member list; keep showing the latest group_telemetry

Task 7: Working against an older server​

Until the backend is deployed:

RequestOld server doesApp should
Combined watchNothing: no reply at allIf no combined watch_ack arrives within ~5 s, fall back to watching each inverter separately and show them as a list, not a total (don't add them up in the app)
get_analytics with scopeIgnores scope; plant view works as beforeNothing
Combined get_param_catalog / get_param_historyinvalid_request ("deviceKey is required")Hide the "whole plant" option in Historical Data
register / update_deviceNever sends PLANT_FULL; ignores parallel and never sends a PARALLEL_* codeNothing

Treat every new field as optional: scope.kind, scope.members, scope.parallelSets, reporting, of, parallelRole, parallelAddress, parallelCount, parallel_role.


Test checklist​

Use a plant with at least two inverters, and a plant with one.

  • Plant dashboard shows combined solar, load, grid and battery. The numbers update about every 30 s.
  • Turn one inverter off. When its connection closes it shows offline, usually within seconds. If the connection hangs instead of closing, it shows stale after 90 s and offline after 15 min. Its solar drops out of "now", but stays in today's energy. It is still listed.
  • A plant with one inverter: the combined view shows the same numbers as that inverter's own view.
  • A field nobody reports (for example grid on a plant without a meter) shows "—", not 0.
  • A fault on one inverter shows in the plant view with that inverter's name.
  • Move an inverter to another plant from a second phone. The plant view's member list updates within a minute, without reopening the screen.
  • Kill the network for ~30 s and restore it. The plant view resumes without user action.
  • Analytics "Entire Plant": Day, Month, Year and Total work. A per-inverter selection still works.
  • Historical Data "whole plant": the picker shows only totals. The Day chart is in 5-minute steps, and points with missing inverters are marked partial.
  • Per-inverter Historical Data is unchanged.
  • A paralleled Nexus pair: one shows "Master", the other "Slave". A single Nexus and every Yorker show no badge.
  • Change a Nexus's Parallel Address in Settings: its badge follows within one reading while watched.
  • Register into a full plant (ask backend to lower the limit on a test server) and check the PLANT_FULL message.
  • Register a second inverter into a plant that has one: the "parallel, or a separate plant?" question appears; "parallel" resends with parallel: true.
  • A Yorker into a plant that has an inverter, or a 6 kW Nexus into a plant with an 8 kW Nexus: the refusal message names both models.
  • Against the current (not yet updated) server: the app falls back without errors.

Open questions (not app work)​

  • Paralleled IP20 units (only in plants that held a Yorker set before 2026-11-23; a Yorker can no longer be added to a plant that has an inverter) report some figures for the whole system rather than per unit. The backend counts them once per paralleled set. That every unit reports the same system totals is still being confirmed on hardware. If it turns out wrong, the fix is server-side only; the app needs no change.
  • Plant names come from the HTTP server, as today. The TCP server only sends plantId and deviceKeys.