Small Go service that talks to a HomeWizard P1 Meter over the local v2 API and re-exposes selected values without authentication, so other consumers like Loxone can use them with very simple HTTP inputs.
This project was developed with AI-assisted tooling and reviewed manually.
- Pairs with the HomeWizard P1 Meter through the documented v2
POST /api/userflow. - Stores the returned bearer token locally in
.data/token.json. - Keeps HomeWizard-specific API details inside a small client layer.
- Supports both HomeWizard v1 and v2 behind the same bridge routes.
- Exposes explicit, stable electricity, gas, and water endpoints that return plain text values.
- Keeps a few raw/debug routes available as JSON or plain text.
System and debug:
GET /GET /docsGET /docs.jsonGET /uiGET /healthzGET /auth/statusPOST /pairGET /statusGET /api/deviceGET /api/measurementGET /api/telegram
Electricity:
GET /electricity/usageGET /electricity/import-usageGET /electricity/export-usageGET /electricity/total-usageGET /electricity/total-exportGET /electricity/daily-usageGET /electricity/weekly-usageGET /electricity/monthly-usageGET /electricity/daily-exportGET /electricity/weekly-exportGET /electricity/monthly-exportGET /electricity/tariffGET /electricity/usage-l1GET /electricity/usage-l2GET /electricity/usage-l3GET /electricity/current-totalGET /electricity/current-l1GET /electricity/current-l2GET /electricity/current-l3GET /electricity/voltageGET /electricity/voltage-l1GET /electricity/voltage-l2GET /electricity/voltage-l3GET /electricity/frequencyGET /electricity/average-demand-15mGET /electricity/monthly-peakGET /electricity/monthly-peak-timestamp
Gas:
GET /gas/total-usageGET /gas/current-usageGET /gas/daily-usageGET /gas/weekly-usageGET /gas/monthly-usageGET /gas/timestampGET /gas/unit
Water:
GET /water/total-usageGET /water/daily-usageGET /water/weekly-usageGET /water/monthly-usageGET /water/timestampGET /water/unit
export HOMEWIZARD_HOST=192.168.1.50
export HOMEWIZARD_USERNAME=local/loxone-bridge
export HOMEWIZARD_INSECURE_SKIP_VERIFY=true
export BIND_ADDR=:8080Optional:
export HOMEWIZARD_TOKEN=YOUR_EXISTING_TOKEN
export DATA_DIR=.dataVersion selection is based on the scheme in HOMEWIZARD_HOST:
HOMEWIZARD_HOST=http://192.168.0.88uses HomeWizard v1 and does not require pairingHOMEWIZARD_HOST=https://192.168.0.88uses HomeWizard v2 and requires pairing- if you provide only a host or IP, the bridge defaults to
http://
go run .Build the image locally:
docker build -t homewizard-api-bridge .Run it directly:
docker run -d \
--name homewizard-api-bridge \
-p 8080:8080 \
-e HOMEWIZARD_HOST=192.168.1.50 \
-e HOMEWIZARD_USERNAME=local/loxone-bridge \
-e HOMEWIZARD_INSECURE_SKIP_VERIFY=true \
-v $(pwd)/data:/data \
homewizard-api-bridgeOr use the included compose file:
docker compose pull
docker compose up -dImportant for Docker and Compose:
- Keep
/datamounted so the pairing token survives container recreation. - Update
HOMEWIZARD_HOSTindocker-compose.ymlto your P1 meter IP or hostname. - If you set only an IP or hostname, the bridge now defaults to
http://. - If your device requires TLS, set
HOMEWIZARD_HOST=https://...explicitly. - The included compose file publishes the bridge on port
8080.
This repo is set up to publish a Docker image to GitHub Container Registry only on version tags such as v1.0.0.
Published image:
ghcr.io/digitalrobin/homewizard-api-bridge:v1.0.0
Generated tags include:
ghcr.io/digitalrobin/homewizard-api-bridge:v1.0.0ghcr.io/digitalrobin/homewizard-api-bridge:latest
The publish workflow lives in .github/workflows/docker.yml.
Tagged releases also publish native binaries to GitHub Releases for these platforms:
- Linux
amd64 - Linux
arm64 - Linux
armv7 - macOS
amd64 - macOS
arm64 - Windows
amd64 - Windows
arm64
That release workflow lives in .github/workflows/release.yml and also attaches a checksums.txt file.
Release flow:
- Push your normal commits without publishing an image.
- When you want to release, create and push a Git tag such as
v1.0.0. - GitHub Actions publishes the container image for that tag.
- GitHub Actions also builds native archives and attaches them to the GitHub Release.
- Update your server or compose file to the version tag you want to run.
Example release commands:
git tag v1.0.0
git push origin v1.0.0Then on the server:
docker compose pull
docker compose up -dIf you want to upgrade later, change the image tag in docker-compose.yml to the next release, for example v1.1.0, and pull again.
If your GHCR package is private, log in on the server first:
echo YOUR_GITHUB_TOKEN | docker login ghcr.io -u digitalrobin --password-stdinThen deploy:
docker compose pull
docker compose up -dThe first time, pair it:
- Start the bridge.
- Open
http://localhost:8080/uiin a browser. - Check the displayed API mode:
- If the target uses
http://, the bridge is in v1 mode and no pairing is needed. - If the target uses
https://, the bridge is in v2 mode and you should pressStart / Retry Pairing. - If the page tells you pairing is not enabled yet, press the button on the P1 meter.
- Press
Start / Retry Pairingagain within 30 seconds.
In v2 mode, once pairing succeeds, the token is saved and reused on restart.
If you prefer scripts, POST http://localhost:8080/pair still works too.
Built-in pages:
http://localhost:8080/uifor pairing and auth monitoringhttp://localhost:8080/docsfor Swagger UI docshttp://localhost:8080/docs.jsonfor the OpenAPI document
Get values as plain text:
http://bridge-host:8080/electricity/usage
http://bridge-host:8080/electricity/total-usage
http://bridge-host:8080/electricity/daily-usage
http://bridge-host:8080/electricity/monthly-export
http://bridge-host:8080/gas/total-usage
http://bridge-host:8080/gas/current-usage
http://bridge-host:8080/gas/weekly-usage
http://bridge-host:8080/water/total-usage
http://bridge-host:8080/water/daily-usage
Get one combined JSON snapshot:
http://bridge-host:8080/status
- HomeWizard documents v2 as HTTPS with bearer token auth. This bridge intentionally removes auth on its own HTTP routes for local-network use with Loxone.
- The bridge supports both HomeWizard v1 and v2. The upstream mode is chosen by the configured scheme in
HOMEWIZARD_HOST. - The bridge defaults to
HOMEWIZARD_INSECURE_SKIP_VERIFY=truebecause HomeWizard uses device-local TLS certificates. If you want stricter validation later, we can extend the client with the HomeWizard CA certificate and expected certificate hostname. - HomeWizard measurement fields are optional. If your smart meter does not provide a field, the endpoint returns
404instead of inventing a value. - Daily, weekly, and monthly usage endpoints are derived from persisted totals stored in
/data/usage-history.json. They may return404until the bridge has recorded enough history for the requested period. /gas/current-usageis an estimated rolling rate inm3/h, derived from recent persisted gas totals rather than a native instantaneous flow reading.- Gas and water are taken from HomeWizard's
externalmeasurement array and only exist if your setup provides those meters.