Skip to content

test(trace): add WHO 18 Dimension 1200 energy stream lifecycle trace and replay test (#466) - #660

Closed
GreenGrassBlueOcean wants to merge 1 commit into
OpenWebNet-HA:v2-phase1-architecturefrom
GreenGrassBlueOcean:test/who18-dimension1200-energy-trace
Closed

GreenGrassBlueOcean wants to merge 1 commit into
OpenWebNet-HA:v2-phase1-architecturefrom
GreenGrassBlueOcean:test/who18-dimension1200-energy-trace

Conversation

@GreenGrassBlueOcean

@GreenGrassBlueOcean GreenGrassBlueOcean commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Note

Trace Provenance & Architecture: This PR provides the end-to-end replay test and fixture for the WHO 18 Dimension 1200 energy streaming lifecycle. The active power telemetry frames and gateway profile are sourced verbatim from authentic customer on-wire captures (issue_466), while the Dimension 1200 handshake sequence is modeled from Legrand specification WHO_18.pdf and gateway binary execution (bt_supervisione).

test(trace): add WHO 18 Dimension 1200 energy stream lifecycle trace and replay test (#466)

Summary

Adds an end-to-end trace fixture and deterministic replay test suite for the complete WHO 18 Dimension 1200 automatic instant power stream lifecycle (*#18*WHERE*#1200#Type*Time## start/stop command write and *#18*WHERE*1200#Type*Time## status reply).

Companion to:

  • OWNd PR OpenWebNet-HA/OWNd#92 (fix(energy): parse the WHO 18 dimension 1200 automatic-update reply)
  • Downstream companion PR OpenWebNet-HA/MyHOME#661 (fix(energy): align active power queries and dimension 1200 stream lifecycle)

Detailed Provenance & Sources

The fixture myhome_trace_energy_dimension1200_stream.json is constructed from the following specific sources:

1. Authentic On-Wire Customer Bus Telemetry (issue_466)

  • Source Capture: tests/fixtures/traces/issue_466/myhome_trace_MyHomeServer1_all_2026-10-01T07-59-11.json
  • Hardware Profile: Physical BTicino MyHomeServer1 (firmware 2.87.13, MAC prefix 00:03:50) on a live installation with F520 energy meters at addresses 51, 52, and 53.
  • Frames extracted verbatim:
    • *#18*51*113*377## (377 W instantaneous active power, timestamp 1790841036.878588)
    • *#18*51*113*424## (424 W instantaneous active power, timestamp 1790841038.883864)
    • *#18*51*113*500## (500 W instantaneous active power, timestamp 1790841040.873745)

2. Specification Grounding (Legrand Public Protocol)

  • Official Document: Open Web Net Language, WHO = 18 ENERGY MANAGEMENT (WHO_18.pdf), Section 3.2.1:
    • Start auto-update: *#18*WHERE*#1200#Type*Time## (Type 1 = active power, Time = 1..255 minutes).
    • Stop auto-update: *#18*WHERE*#1200#Type*0## (Time = 0 stops streaming).
    • Auto-update status reply / event: *#18*WHERE*1200#Type*Time## (Time > 0 confirms active lease, Time = 0 confirms stream halted).
    • On-demand active power status query: *#18*WHERE*113##.
  • Encyclopedia Machine KB: functional/who-18-energy-management/dimensions.md (ownkb:chunk:r000421).

3. Firmware Binary Translation & Oracle Evidence (bt_supervisione)

Replay across the gateway supervisor daemon bt_supervisione (identical binaries on MyHomeServer1, F454, F459, F461):

  • *#18*51*#1200#1*125## $\rightarrow$ ACK (*#*1##) $\rightarrow$ SCS bus telegram D1 A1 02 32 00 02 1D 7D (1D = active power, 7D = 125 min).
  • *#18*51*#1200#1*0## $\rightarrow$ ACK (*#*1##) $\rightarrow$ SCS bus telegram D1 A1 02 32 00 02 1D 00 (Stream stop).
  • *#18*51*1200## $\rightarrow$ NACK (*#*0##, dropped at gateway router boundary; never reaches SCS bus).

4. Corpus Context from Existing Issues

  • issue_629 (tests/fixtures/traces/issue_629/): Captures authentic production failures where Home Assistant sent the invalid read request *#18*WHERE*1200## and physical F454 gateways dropped it with NACK (Could not send message *#18*74#0*1200##. No more retries.).
  • issue_649 (tests/fixtures/traces/issue_649/README.md): Live plant test table confirming *#18*51*#1200#1*255## ACKs while *#18*51*1200## NACKs on physical MyHomeServer1.

Changes

  • tests/fixtures/traces/issue_466/myhome_trace_energy_dimension1200_stream.json:
    • 11-frame fixture modeling the start $\rightarrow$ ACK $\rightarrow$ confirmation $\rightarrow$ telemetry $\rightarrow$ stop $\rightarrow$ stop confirmation $\rightarrow$ on-demand query lifecycle.
  • tests/fixtures/traces/issue_466/README.md:
    • Documents hardware profile, detailed provenance, frame-by-frame protocol semantics, and the architectural distinction between Dimension 1200 (stream lease control) and Dimension 113 (active power telemetry).
  • tests/golden/frames/who18_energy.yaml & tests/golden/corpus.json:
    • Added golden frame definitions for Dimension 1200 start (#1200#1*255), confirmation (1200#1*125), stop (#1200#1*0), and stop confirmation (1200#1*0).
  • tests/test_golden_conformance.py:
    • Registered OWNEnergyCommand in builder parity map for golden testing.
  • tests/test_energy_dimension1200_trace.py:
    • Replay test asserting production capture replay and full lifecycle transitions.

Downstream Consumer (MyHOME)

Provides the verification baseline for downstream PR #661, ensuring that:

  1. Dead polling *#18*{where}*1200## is permanently eliminated.
  2. MESSAGE_TYPE_AUTO_UPDATE_INTERVAL is parsed to maintain stream lease timers.
  3. Stream cancellation cleanly issues duration 0 write frames.

Verification

  • pytest tests/test_energy_dimension1200_trace.py: Passed (11/11 frames verified).
  • Golden corpus tests: pytest tests/test_golden_conformance.py passed with 0 regressions.
  • Full test suite: 16/16 CI check runs completed successfully.

@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@GreenGrassBlueOcean GreenGrassBlueOcean changed the title test(trace): add authentic WHO 18 Dimension 1200 energy stream trace and replay test (#466) test(trace): add WHO 18 Dimension 1200 energy stream lifecycle trace and replay test (#466) Oct 8, 2026
@GreenGrassBlueOcean

Copy link
Copy Markdown
Contributor Author

Withdrawing this PR.

In accordance with the repository's strict trace integrity standard ("They are facts: never edit a frame"), fixtures in tests/fixtures/traces/ must exclusively contain authentic, untouched customer on-wire bus captures.

Because the Dimension 1200 handshake frames in myhome_trace_energy_dimension1200_stream.json were synthesized from specification and firmware models rather than captured verbatim from a physical installation emitting *#18*WHERE*1200#Type*Time##, this fixture cannot be accepted into the trace corpus.

Closing and withdrawing this PR. OWNd PR #92 remains blocked until an authentic bus capture is contributed from a physical plant.

@GreenGrassBlueOcean
GreenGrassBlueOcean deleted the test/who18-dimension1200-energy-trace branch October 8, 2026 15:03
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