Skip to content

spec: Blixt L1 headroom emit keys + inverter as reporting stream - #89

Merged
frahlg merged 4 commits into
mainfrom
spec/blixt-l1-emit-keys
Aug 19, 2026
Merged

spec: Blixt L1 headroom emit keys + inverter as reporting stream#89
frahlg merged 4 commits into
mainfrom
spec/blixt-l1-emit-keys

Conversation

@davmoz

@davmoz davmoz commented Aug 18, 2026

Copy link
Copy Markdown
Member

Spec prerequisite for the Blixt L1 driver migrations (#90#95).

Emit keys

  • spec/host-api-profile.json emit_keys.canonical: add battery.available_charge_W / available_discharge_W and inverter.available_import_W / available_export_W. Blixt L1 reads these by exact name (no lowercase fallback) and feeds them into its arbitrator's headroom clamp.
  • Document inverter as a reporting stream of a battery/hybrid driver (its AC stage), not a DER type. The device stays ders: [battery]. test_driver_structure.py / test_manifest_consistency.py accept the stream in host.emit() without requiring it in ders.

Write semantics (spec/host-api.md + profile)

  • Add host.write_fc06 (Blixt L1) to the modbus group.
  • host.write is FC16(count=1) on Blixt L1 (Deye ignores FC06 on some ranges) but FC06 on FTW — the spec previously said FC06 unconditionally.
  • The two hosts report a failed write differently: FTW returns an error string and never raises; Blixt returns true or raises. The test harness follows FTW, so a Blixt-only driver that trusts pcall's ok reads a mocked refusal as success. Documented with the portable check a dual-target driver must use.

Tests

  • test_signed_manifest_rejects_unsafe_runtime_fields mutated payload.drivers[0] and relied on it being read-only; select a read-only entry explicitly so a control driver whose id sorts first cannot change which check trips.

No driver changes. Full suite green.

David Mozart added 3 commits August 18, 2026 10:18
Blixt L1 battery/hybrid drivers report their AC stage on
host.emit("inverter", ...) and feed available_charge_W /
available_discharge_W (battery) and available_import_W /
available_export_W (inverter) into the arbitrator clamp. L1 reads
those keys by exact name with no lowercase fallback, and the profile
already names Blixt as the emit-key reference — but the four keys were
missing from emit_keys.canonical, and the emit-type tests rejected
"inverter" outright because it is not a DER type.

Add the keys to the profile, document that inverter is a stream (the
device is still declared as ders: [battery]), and let the structure /
manifest-consistency tests accept the stream without listing it in
ders. No driver changes; the emit-fields tests already derive their
allowed set from the profile.

Signed-off-by: David Mozart <david@sourceful-labs.com>
Blixt L1's host.write is FC16 with count=1 (Deye ignores FC06 on some
ranges) and exposes host.write_fc06 for true FC06; FTW's is FC06. The
two hosts also disagree on how a failed write is reported: FTW returns
an error string and never raises, Blixt returns true or raises. The
test harness follows FTW, so a Blixt-only driver that trusts pcall's ok
reads a mocked refusal as success. Document both, add write_fc06 to the
profile's modbus group, and give the portable check.

Signed-off-by: David Mozart <david@sourceful-labs.com>
test_signed_manifest_rejects_unsafe_runtime_fields mutated
payload.drivers[0] and relied on it being read-only. The catalog is
sorted by id, so the first control driver whose id sorts before
abb_meter (any id starting with a digit) made the mutations hit a
different, earlier check than the one under test. Select a read-only
modbus.read-only entry explicitly.

Signed-off-by: David Mozart <david@sourceful-labs.com>
konja-261-svk.lua + its manifest were staged by an over-broad git add;
they belong to #95, not here.

Signed-off-by: David Mozart <david@sourceful-labs.com>
@frahlg
frahlg merged commit a6c185e into main Aug 19, 2026
6 checks passed
@frahlg
frahlg deleted the spec/blixt-l1-emit-keys branch August 19, 2026 07:12
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.

2 participants