Skip to content

docs: add openHAB integration guide + Prometheus alternative#49

Merged
LarsLaskowski merged 2 commits into
mainfrom
claude/issue-7-nt2fmn
Jul 14, 2026
Merged

docs: add openHAB integration guide + Prometheus alternative#49
LarsLaskowski merged 2 commits into
mainfrom
claude/issue-7-nt2fmn

Conversation

@LarsLaskowski

@LarsLaskowski LarsLaskowski commented Jul 14, 2026

Copy link
Copy Markdown
Owner

Summary

Adds a concrete integration recipe for openHAB, which the README names as a
driving use case but previously shipped no wiring for.

  • New docs/integrations/openhab.md with copy-paste HTTP-binding
    .things and .items
    that poll /api/v1/metrics once per refresh and
    extract CPU usage, load, CPU/GPU temperature, memory/swap, root-FS usage,
    available updates, uptime, and system identity via JSONPath. All field
    paths map 1:1 onto docs/API.md.
  • Includes an API-key variant (X-Api-Key request header), a
    verify section (Thing goes ONLINE, live Items, example sitemap), and
    troubleshooting for the common OFFLINE / 401 / NULL cases.
  • Adds the requested Prometheus alternative: since PiMonitor has no
    native /metrics endpoint, the guide uses
    prometheus-community/json_exporter in front of /api/v1/metrics, with a
    ready json_exporter.yml (including a per-mountpoint disk object) and the
    matching Prometheus scrape_configs relabeling.
  • Links the new guide from README.md under a new Integrations heading.

Documentation only — no code, API, or config changes.

The example .things/.items were written against the documented
/api/v1/metrics response shape and JSONPath transformation semantics; they
have not been exercised against a live openHAB instance, so a follow-up
smoke test on real openHAB + Pi hardware is still worthwhile.

Related Issue

Closes #7

Checklist

  • Tests added/updated for the change (go test ./... passes locally) —
    N/A, documentation-only; no Go changes (go build ./... clean)
  • go vet ./... and golangci-lint run are clean — N/A, no code changes
  • Documentation updated (this PR is the documentation)
  • No breaking change to /api/v1/... response shapes — no API change

claude added 2 commits July 14, 2026 19:40
The README names openHAB as a driving use case but shipped no concrete
recipe. Add docs/integrations/openhab.md with copy-paste HTTP-binding
.things and .items wiring CPU/temperature/memory (and more) against
/api/v1/metrics, an API-key variant, a verify/troubleshooting section,
and a Prometheus alternative via prometheus-community/json_exporter
(PiMonitor has no native /metrics endpoint). Link it from README.

Closes #7
- Uptime Item used %d on uptime_seconds, which is a float (e.g. 372014.5)
  in the API; switch to %.0f to avoid an openHAB formatting error.
- Add GPU temperature, uptime, and per-interface network throughput to the
  json_exporter config so the Prometheus section covers the same metrics as
  the openHAB things/items.
@LarsLaskowski
LarsLaskowski merged commit 84fb849 into main Jul 14, 2026
3 checks passed
@LarsLaskowski
LarsLaskowski deleted the claude/issue-7-nt2fmn branch July 14, 2026 20:00
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.

B2: openHAB integration doc + example items/things

2 participants