Skip to content

Revise inverter service documentation#144

Open
BudzikM wants to merge 1 commit into
masterfrom
inverter_proposal
Open

Revise inverter service documentation#144
BudzikM wants to merge 1 commit into
masterfrom
inverter_proposal

Conversation

@BudzikM

@BudzikM BudzikM commented Apr 19, 2026

Copy link
Copy Markdown
Contributor

Updated inverter service documentation to improve clarity and organization.

Updated inverter service documentation to improve clarity and organization.
@BudzikM BudzikM self-assigned this Apr 19, 2026
@BudzikM BudzikM marked this pull request as ready for review April 20, 2026 10:23

@indivisus indivisus Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review completed in 5m.

Comment on lines +5 to +9
Field keys reuse the meter_elec convention documented under
[`meter_elec` → Electricity measurements](./meter.md#electricity-measurements):
`u` (voltage, V), `i` (current, A), `i_import` / `i_export` (directional
current, A), `p_import` / `p_export` (directional power, W), `freq`
(frequency, Hz), and the DC-side counterparts `dc_u`, `dc_i`, `dc_p`.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P2 - Medium] Bug: Reference to non-existent field key 'i_import'

The documentation claims field keys reuse the meter_elec convention and lists i_import / i_export for directional current. However, meter.md's Electricity measurements table (lines 187-191) documents only i for current (import direction) and i_export for current export. There is no i_import key in the meter_elec convention. This creates a protocol mismatch risk where adapters implement incompatible payloads.

Evidence:

`i` (current, A), `i_import` / `i_export` (directional current, A)

Suggested fix:

Replace i_import with i to match the meter_elec convention. The correct pairing is i (import current) and i_export (export current):

`u` (voltage, V), `i` / `i_export` (directional
current, A), `p_import` / `p_export` (directional power, W), `freq`

## Adapter guidelines

* `sup_pv_strings` MUST be set on the service specification so clients can discover how many PV reports to subscribe to.
* Quantities not supported by the underlying hardware (e.g. PV current on some PIP inverters) SHOULD be reported as `0` rather than omitted.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P2 - Medium] Logic Error: Guideline conflates unsupported metrics with valid zero values

Recommending unsupported quantities be reported as 0 makes it impossible for consumers to distinguish "not supported" from an actual measured zero. This can silently corrupt automations, alerting, and analytics that need to know whether a value is genuinely zero or simply unavailable.

Evidence:

* Quantities not supported by the underlying hardware ... SHOULD be reported as `0` rather than omitted.

Suggested fix:

Consider one of these alternatives:

  1. Omit unsupported keys entirely (preferred) - consumers can check for key presence
  2. Use null for unsupported values - explicit "not available" signal
  3. Document in service properties which fields are supported via a sup_fields array

Suggested revision:

* Quantities not supported by the underlying hardware (e.g. PV current on some PIP inverters) SHOULD be omitted from the report rather than set to `0`.

Comment on lines +37 to +67
```json
{
"serv": "inverter",
"type": "evt.grid.report",
"val_t": "float_map",
"val": {
"u": 230.1,
"freq": 49.9,
"p_import": 0
},
"src": "ess",
"ver": "1"
}
```

## Example — PV string #1 report

```json
{
"serv": "inverter",
"type": "evt.pv_1.report",
"val_t": "float_map",
"val": {
"dc_u": 137.2,
"dc_i": 1.57,
"dc_p": 215
},
"src": "ess",
"ver": "1"
}
```

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P3 - Low] Style: Example messages omit common FIMP fields

Both JSON examples are presented as full messages but omit fields consistently shown in peer documentation (battery.md, meter.md): props, tags, uid, and topic. While these may not be strictly required, their absence makes the examples inconsistent with other service docs and may mislead implementers.

Evidence:

Example objects include `serv`, `type`, `val_t`, `val`, `src`, `ver` only.

Comment on lines +35 to +52
## Example — grid report

```json
{
"serv": "inverter",
"type": "evt.grid.report",
"val_t": "float_map",
"val": {
"u": 230.1,
"freq": 49.9,
"p_import": 0
},
"src": "ess",
"ver": "1"
}
```

## Example — PV string #1 report

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P4 - Info] Style: Example section header format differs from repository convention

The documentation uses separate headers with em-dashes (## Example — grid report) instead of a single ## Examples section with bullet points as used in battery.md and meter.md.

Evidence:

## Example — grid report

Comment on lines +25 to +33
| Type | Interface | Value type | Description |
|------|----------------------------|-------------|--------------------------------------------------------------------|
| in | `cmd.grid.get_report` | `null` | Request the grid report. |
| out | `evt.grid.report` | `float_map` | Grid-side measurements. Fields: `u`, `freq`, `p_import`. |
| in | `cmd.pv_<n>.get_report` | `null` | Request the PV string #n report. `n` ∈ [1, `sup_pv_strings`]. |
| out | `evt.pv_<n>.report` | `float_map` | PV string #n DC-side measurements. Fields: `dc_u`, `dc_i`, `dc_p`. |
| in | `cmd.load.get_report` | `null` | Request the load report. |
| out | `evt.load.report` | `float_map` | Load-side (inverter output) measurements. Fields: `u`, `p_import`. |
| out | `evt.error.report` | `string` | Reports processing errors. |

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P4 - Info] Style: Backticks in interface table differ from other documentation

The Interfaces table uses backticks around interface names and value types (e.g., cmd.grid.get_report, null). Other service docs use plain text in interface tables.

Evidence:

| in   | `cmd.grid.get_report`      | `null`      |

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