Skip to content

Support Dreeve self-host weight - #421

Open
sanglt wants to merge 1 commit into
KristianP26:mainfrom
sanglt:dreeve
Open

sanglt wants to merge 1 commit into
KristianP26:mainfrom
sanglt:dreeve

Conversation

@sanglt

@sanglt sanglt commented Sep 14, 2026

Copy link
Copy Markdown

Summary

Adds a direct Dreeve exporter for BLE Scale Sync.

Dreeve now exposes a bearer-authenticated athlete-weight API. This exporter sends BLE Scale Sync readings directly to a self-hosted Dreeve instance, without requiring an Android/openScale-sync intermediary.

The exporter is deliberately weight-only because Dreeve currently accepts only weight measurements.

This exporter targets the athlete-weight API introduced in
dreeveapp/dreeve#2653.

Changes

  • Added a dreeve exporter with:
    • POST /api/v1/athlete/weights delivery.
    • Bearer-token authentication using a Dreeve drv_... API key.
    • GET /api/v1/status health check.
    • Historical-reading support using the original local calendar date.
    • Existing shared HTTP retry behavior: retries transient failures and fails fast for non-retryable 4xx responses.
  • Added required Dreeve exporter configuration:
    • base_url
    • token
    • unit_system
  • Added explicit unit_system: metric | imperial handling:
    • BLE Scale Sync measurements remain internally normalized to kilograms.
    • metric sends kilograms.
    • imperial converts kilograms to pounds before sending.
    • The setting is required so an Imperial Dreeve instance cannot silently store kilogram readings as pounds.
  • Registered Dreeve in the exporter registry, factory, setup wizard, and legacy .env configuration path.
  • Added Dreeve examples and documentation to config.yaml.example, .env.example, exporter docs, README, site landing page, FAQ, and exporter-count metadata.
  • Updated exporter count from 11 to 12.

Test Plan

  • Tests pass (npm test)
  • Lint clean (npm run lint)
  • TypeScript compiles (npx tsc --noEmit)
  • Tested manually (describe below)

Focused verification also passed:

  • Dreeve exporter/configuration/registry tests: 158 tests passed.
  • Dreeve exporter coverage: 100% statements, branches, functions, and lines.
  • Prettier check passed.
  • VitePress documentation build passed.
  • Exporter-count check passed.
  • git diff --check passed.

Manual verification was not performed against a live Dreeve instance. HTTP contract tests cover the documented status and weight endpoints, bearer authorization, metric and Imperial payloads, retry behavior, date handling, and error handling.

Notes

  • This is an export-only, weight-only integration. Dreeve does not currently expose endpoints for body fat, water, muscle mass, bone mass, or other body-composition values.
  • Dreeve stores one weight measurement per calendar date. A later reading for the same date replaces the earlier value.
  • unit_system must match the Dreeve instance Appearance setting exactly:
    • metric for kilograms.
    • imperial for pounds.
  • The Dreeve API must be enabled with DREEVE_API_KEY, and the same generated drv_... key must be configured as the exporter token.

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