Skip to content

Model 122: correct WAval units from var to W - #278

Open
dersecure wants to merge 1 commit into
sunspec:masterfrom
dersecure:fix/model-122-waval-units
Open

Model 122: correct WAval units from var to W#278
dersecure wants to merge 1 commit into
sunspec:masterfrom
dersecure:fix/model-122-waval-units

Conversation

@dersecure

Copy link
Copy Markdown
Collaborator

WAval in model 122 declares reactive-power units while describing itself as real power.

{
  "desc": "Amount of Watts available.",
  "name": "WAval",
  "sf": "WAval_SF",
  "type": "uint16",
  "units": "var"
}

Its scale factor is likewise described as "Scale factor for available Watts.", so the point's own metadata is internally inconsistent.

The value appears to have been carried over from VArAval, which immediately precedes it in the model and is correctly var:

point desc units
VArAval Amount of VARs available without impacting watts output. var
WAval Amount of Watts available. var

W is the units string already used for watt-valued points elsewhere in the model set — WRtg, MaxChaRte and MaxDisChaRte in model 120, among others.

Change

Both representations carry the same value, so both are corrected:

  • json/model_122.json
  • smdx/smdx_00122.xml

Two lines total. json/model_122.json validates against json/schema.json, and the SMDX file still parses.

models_workbook.xlsx is left untouched, since utils/json_to_xslx.py suggests it is generated from json/ — worth regenerating if that is part of the release process.

Why it matters

Tooling that derives register maps from these definitions propagates the units verbatim, so any consumer reading WAval sees real power labelled as reactive. It is a metadata-only defect — no register address, type, size or scale factor changes — so the correction is safe for existing implementations.

WAval is defined as 'Amount of Watts available' and its scale factor as
'Scale factor for available Watts', but the point declares units of var.

The value looks carried over from VArAval, which immediately precedes it
and is correctly var. Both the JSON and SMDX representations carry the
same value, so both are corrected.

W is the units string already used for watt-valued points elsewhere in the
model set, for example WRtg, MaxChaRte and MaxDisChaRte in model 120.
@cla-bot cla-bot Bot added the cla-signed label Aug 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant