Skip to content

Catalog: move emit keys and DER types to data model v2 #171

Description

@davmoz

Problem

The catalog emits pre-v2 names. The data model is now v2 (srcful-data-models 2.3.0), and no catalog driver emits a v2 key yet. Counted over drivers/lua/*.lua on main (224c438), by number of drivers that assign the key:

Spelling Examples (drivers) v2 name
data-models 1.x W (42), Hz (23), L1_V (24), total_import_Wh (20), SoC_nom_fract (12) W_ac / W_dc, Hz, l1_V_ac, total_import_Wh_ac, soc_nom_fract
catalog short names w (52), l1_v (45), hz (37), import_wh (29), soc (21) as above
v2 W_ac, W_dc, soc_nom_fract, l1_V_ac, total_import_Wh_ac: 0

DER types emitted: meter 55, battery 33, pv 32, v2x_charger 16, ev 6, inverter 4, vehicle 4. In v2, pv is solar and v2x_charger is ev_charger_port. inverter is the inverter's AC output stage only: its DC side is the solar and battery DERs.

spec/host-api-profile.json already counts the lowercase names as debt against the 1.x spellings. That target has since moved to v2.

What the catalog needs

  1. One key set: the v2 names, with _ac / _dc on every W/V/A/VA/Wh field. A battery's own measurement is DC. Use the v2 DER types. The field lists per type are in the data model REFERENCE.
  2. Null, never 0: a value that was not read stays nil (44 drivers emit numbers they never read (null, never 0) #169, ratcheted by test_no_invented_numbers.py).
  3. make: the lowercase brand (^[a-z0-9]+(_[a-z0-9]+)*$, for example abb, sma, carlo_gavazzi), set by the driver itself.
  4. Order: FTW Core has to accept the v2 keys first (Publish data model v2 to NovaCore (json/v2) and accept v2 keys from drivers ftw#1527, telemetry_keys.go). Drivers can then move one at a time, each with a version bump and a BUNDLED_SOURCE.json pin move in FTW.
  5. Spec: update spec/host-api.md / spec/host-api-profile.json to v2 as the target. docs(spec): describe srcful-data-models v2 in the migration note #166 already rewrites the migration note.

Related: #169 (invented numbers), #170 (zap.lua and the Zap's v2 local API), srcfl/ftw#1527 (FTW's NovaCore publisher and host aliases).

Out of scope for the current data model rollout: tracked here so FTW does not fall behind.

🤖 Generated with Claude Code

No activity

Activity on this issue will appear here.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions