docs: add openHAB integration guide + Prometheus alternative#49
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a concrete integration recipe for openHAB, which the README names as a
driving use case but previously shipped no wiring for.
docs/integrations/openhab.mdwith copy-paste HTTP-binding.thingsand.itemsthat poll/api/v1/metricsonce per refresh andextract 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.X-Api-Keyrequest header), averify section (Thing goes ONLINE, live Items, example sitemap), and
troubleshooting for the common OFFLINE / 401 /
NULLcases.native
/metricsendpoint, the guide usesprometheus-community/json_exporterin front of/api/v1/metrics, with aready
json_exporter.yml(including a per-mountpoint disk object) and thematching Prometheus
scrape_configsrelabeling.README.mdunder a new Integrations heading.Documentation only — no code, API, or config changes.
The example
.things/.itemswere written against the documented/api/v1/metricsresponse shape and JSONPath transformation semantics; theyhave 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
go test ./...passes locally) —N/A, documentation-only; no Go changes (
go build ./...clean)go vet ./...andgolangci-lint runare clean — N/A, no code changes/api/v1/...response shapes — no API change