Commit 2304152
examples: add utility-meter publisher
Reference implementation of an eBus utility-meter publisher
(`energy.ebus.device.utility-meter`, per the Electrification Bus
specification's `data-models/utility-meter.md`). Single-file script
following the same `*Device` / `*DeviceAdapter` shape as `simple-device`:
- `UtilityMeter` — pure-Python model holding values for the four
standard capabilities (`info`, `meter`, `status`, `doe`).
- `UtilityMeterAdapter` — translates the model to a Homie 5 device
with capability-typed nodes and property datatype/unit hints.
- DOE HTTP endpoint — `POST /doe/import-limit` accepting
`{watts, source, validUntil}` to set the dynamic operating envelope
at runtime.
- Periodic `tick()` stub for synthetic measurement updates.
Includes `utility-meter-cfg.example.json` with a generic nameplate
and an example `meter` sample. Broker config is supplied separately
in the same format as the other examples.
Suitable for a Raspberry Pi or any Linux host as a stand-in utility
meter on a test bench.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 527986e commit 2304152
3 files changed
Lines changed: 643 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
23 | 39 | | |
24 | 40 | | |
25 | 41 | | |
| |||
0 commit comments