Skip to content

Configuration

The fastest way to configure BLE Scale Sync is with the interactive setup wizard. It walks you through scale discovery, user profiles, exporter selection, and connectivity tests:

bash
# Docker (Linux)
docker run --rm -it --network host --cap-add NET_ADMIN --cap-add NET_RAW \
  -v ./config.yaml:/app/config.yaml ghcr.io/kristianp26/ble-scale-sync:latest setup

# Native (Linux, macOS, Windows)
npm run setup

The wizard generates a complete config.yaml. If a config already exists, it offers edit mode — pick any section to reconfigure without starting over.

TIP

You don't need to edit config.yaml manually. The wizard handles everything, including BLE scale auto-discovery, Garmin authentication, and exporter connectivity tests.

Validation

bash
# Docker
docker run --rm -v ./config.yaml:/app/config.yaml:ro \
  ghcr.io/kristianp26/ble-scale-sync:latest validate

# Native
npm run validate

config.yaml Reference

If you prefer manual configuration, here's the full reference. See config.yaml.example for an annotated template.

BLE

yaml
ble:
  scale_mac: 'FF:03:00:13:A1:04'
  # noble_driver: abandonware
FieldRequiredDefaultDescription
scale_macRecommendedAuto-discoveryMAC address or CoreBluetooth UUID (macOS). Prevents connecting to a neighbor's scale.
noble_driverNoOS defaultabandonware or stoprocent — override the default BLE driver

Scale

yaml
scale:
  weight_unit: kg
  height_unit: cm
FieldRequiredDefaultDescription
weight_unitNokgkg or lbs — display only, calculations always use kg
height_unitNocmcm or in — for height input in user profiles

Users

At least one user is required. For multi-user setups, see Multi-User Support.

yaml
users:
  - name: Alice
    slug: alice
    height: 168
    birth_date: '1995-03-20'
    gender: female
    is_athlete: false
    weight_range: { min: 50, max: 75 }
FieldRequiredDefaultDescription
nameYesDisplay name
slugNoAuto-generatedUnique ID (lowercase, hyphens) for MQTT topics, InfluxDB tags
heightYesHeight in configured unit
birth_dateYesISO date (YYYY-MM-DD)
genderYesmale or female
is_athleteNofalseAdjusts body composition formulas
weight_rangeNo{ min, max } in kg — required for multi-user
last_known_weightNonullAuto-updated after each measurement
exportersNoPer-user exporter overrides

Exporters

yaml
global_exporters:
  - type: garmin
    email: '${GARMIN_EMAIL}'
    password: '${GARMIN_PASSWORD}'

Shared by all users unless a user defines their own exporters list. See Exporters for all 5 targets and their configuration fields.

Runtime

yaml
runtime:
  continuous_mode: false
  scan_cooldown: 30
  dry_run: false
  debug: false
FieldRequiredDefaultDescription
continuous_modeNofalseKeep scanning in a loop (for always-on deployments)
scan_cooldownNo30Seconds between scans (5–3600)
dry_runNofalseRead scale + compute body comp, skip exports
debugNofalseVerbose BLE logging

Environment Variables

Secret references

YAML values support ${ENV_VAR} syntax for passwords and tokens. The variable must be defined in the environment or in a .env file — loading fails if a reference is undefined.

yaml
global_exporters:
  - type: garmin
    email: '${GARMIN_EMAIL}'
    password: '${GARMIN_PASSWORD}'

Runtime overrides

These environment variables always override config.yaml values, useful for Docker -e flags:

VariableOverrides
CONTINUOUS_MODEruntime.continuous_mode
DRY_RUNruntime.dry_run
DEBUGruntime.debug
SCAN_COOLDOWNruntime.scan_cooldown
SCALE_MACble.scale_mac
NOBLE_DRIVERble.noble_driver
Legacy .env support

If config.yaml doesn't exist, the app falls back to .env configuration. See .env.example in the repository. When both files exist, config.yaml takes priority.

Released under the GPL-3.0 License.