Skip to content

feat(nibe_local): convert diagnostic kW/kWh to W/Wh at emit - #99

Merged
frahlg merged 1 commit into
mainfrom
si-hp-metrics-w-wh
Aug 20, 2026
Merged

feat(nibe_local): convert diagnostic kW/kWh to W/Wh at emit#99
frahlg merged 1 commit into
mainfrom
si-hp-metrics-w-wh

Conversation

@frahlg

@frahlg frahlg commented Aug 20, 2026

Copy link
Copy Markdown
Member

Summary

  • nibe_local 1.1.3 and myuplink 1.2.1 convert vendor kW/kWh to W/Wh at host.emit_metric. Vendor unit strings are trimmed and case-folded; unknown units keep their original string.
  • Headline names hp_energy_consumed_kwh / hp_energy_produced_kwh stay so existing series keys do not move. The unit field is Wh. myuplink has no those headlines; energy there is a sanitized bulk name.
  • First Lua edit of nibe_local off the FTW baseline: DRIVER.read_only = true so the signed artifact is not published as controlling, and api_get wraps HTTP/JSON in pcall.
  • Catalog HTTP tests accept https:// for a pinned local TLS device and uppercase poll-interval constants. A harness pins kW→W and kWh→Wh.

Test plan

  • make test-driver ID=nibe_local (39 passed)
  • make test-driver ID=myuplink (35 passed)
  • pytest drivers/tests tests (3978 passed, 1356 skipped)
  • Rebased onto origin/main (525583a)

nibe_local 1.1.3 and myuplink 1.2.1 scale vendor kilowatts/kilowatt-hours
to W/Wh at host.emit_metric. Headline names hp_energy_consumed_kwh and
hp_energy_produced_kwh stay so existing series keys do not move; the
unit field is Wh. Vendor unit strings are trimmed and case-folded.

This is the first Lua edit of nibe_local off the FTW baseline, so the
DRIVER table now declares read_only (otherwise the channel infers
control from driver_command) and api_get wraps HTTP/JSON in pcall.
Catalog HTTP tests accept https:// for a pinned local TLS device and
uppercase poll-interval constants. A harness pins the conversion.

Signed-off-by: Fredrik Ahlgren <fredrik@sourceful-labs.com>
@frahlg
frahlg merged commit 0ce2c55 into main Aug 20, 2026
6 checks passed
@frahlg
frahlg deleted the si-hp-metrics-w-wh branch August 20, 2026 16:23
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.

1 participant