Repository navigation
feat(load): add typed measurement properties for WHO 3 dimensions 1-4 from firmware register maps (#104) - #114
Conversation
1ed9f60 to
4e4a976
Compare
6648985 to
0e925f2
Compare
|
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Firmware Disassembly & Register Map Ground Truth (WHO 3 Dimensions 1–4)To unblock review and lock this implementation against future regressions, here is the firmware binary reverse-engineering analysis that resolves the historical discrepancy with the BTicino 2006 specification: 1. Resolution of the PDF Specification InversionThe legacy BTicino 2006 PDF document (WHO 3 Load Control v1.0.0) listed dimensions as Disassembly of the
This confirms that:
2. Gateway Daemon Architecture & TopologyDisassembly of the gateway process tree reveals:
3. Test Coverage & Verification Artifacts
4. Synthetic Trace Fixture & Replay Test in MyHOMETo lock this behavior permanently against future regressions and avoid relying on unverifiable claims:
|
984584d
into
OpenWebNet-HA:feat/who3-load-control
Problem
In PR #104, WHO 3 (Load Control) support was introduced, but measurement replies from the central unit (
WHERE=10,DIMENSION 0–4) were left as raw, unparsed string tuples inmeasurement_values. This created two issues:myhomeintegration) had no typed properties (power,voltage,current,power_factor) and had to guess units and data types.Solution
Hardware Register Ground Truth:
Firmware bytecode analysis and disassembly of the
bt_energiadaemon (available on MH202 and F459) definitively identified the central unit's hardware register addresses polled for each dimension:$03AA001613$03AA001612$03AA001610&$03AA001611$03AA001606through$03AA001609Typed Properties on
OWNLoadEvent:power:int | None(W)voltage:int | None(V)current:float | None(A)power_factor:float | None(cos φ)Subsystem Constants & Logging:
LOAD_DIMENSION_ALL = 0,LOAD_DIMENSION_POWER = 1,LOAD_DIMENSION_VOLTAGE = 2,LOAD_DIMENSION_CURRENT = 3,LOAD_DIMENSION_POWER_FACTOR = 4.measurement_values: list[str]for full backwards compatibility.Firmware Traces & Capture Provenance
The hardware register mapping was discovered and verified via the
own-firmware-oracletest harness:OpenWebNet-HA/own-firmware-oracleoracle/cases/energy-ts10.cases(SHA-256:ae576deb4f97c6af81e22c221f24dadb99f4813610e99e19ed96fc1d137896ad)findings/MyHomeServer1/energy-ts10.md(Sections 3.5 & 4)tests/golden/firmware_oracle.json(underenergy-ts10)How it was captured:
Gateway firmwares were executed in QEMU ARM user-mode inside isolated bubblewrap sandboxes, wired to a virtual PTY SCS bus monitored by a simulated PIC microcontroller responder across multiple hardware targets (MH202
010024, F459020105, MyHomeServer1028206, MH200N010108).When OpenWebNet dimension queries
*#3*10*D##were sent to the gateway command session, thebt_energiadaemon translated each dimension into specific SCS bus telegrams reading internal memory registers on the central unit:*#3*10*1##→$03AA001613\r*#3*10*2##→$03AA001612\r*#3*10*3##→$03AA001610\r+$03AA001611\r*#3*10*4##→$03AA001606\rthrough...1609\r*#3*10*0##→ emitted the 4 runs sequentially.Disassembly confirms that
bt_energiais the dedicated gateway daemon responsible for WHO 3 load management and F421 diagnostics. Gateways withoutbt_energia(such as MyHomeServer1) reject WHO 3 commands with silent NACK, while gateways shippingbt_energia(MH202, F459) perform identical register translations.Testing
tests/test_who3_load_control.py):*#3*10*0*230*12*2760*1520##) verifyingpower == 230,voltage == 12,current == 2760.0,power_factor == 1520.0._safe_int,_safe_float) tested withNone, non-numeric strings, empty values (*#3*10*1*##), and truncated dimension 0 frames (*#3*10*0*230##).*#3*10*9*1##) and other WHERE addresses (*#3*#1*1*5##) to verify measurement properties are only populated for central unit measurement replies.verify_coverage.py: 100.0% line coverage enforced and verified across all modules (4,884 / 4,884 statements).verify_library_standards.py: PyPI decoupling and library standards verified.sync_documentation.py --check: README and subsystem catalog tables synchronized.