Skip to content

Configuration

Using the Home Assistant Add-on?

The add-on is configured through the HA UI, not config.yaml. See the Home Assistant Add-on guide for the full option reference.

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 \
  --group-add 112 -v /var/run/dbus:/var/run/dbus:ro \
  -v ./config.yaml:/app/config.yaml ghcr.io/kristianp26/ble-scale-sync:latest setup

# Standalone (Node.js, 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

# Standalone (Node.js)
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'
  # handler: auto
  # noble_driver: abandonware
  # adapter: hci1
FieldRequiredDefaultDescription
scale_macRecommendedAuto-discoveryMAC address or CoreBluetooth UUID (macOS). Prevents connecting to a neighbor's scale.
handlerNoautoTransport: auto (local radio), mqtt-proxy (ESP32 over MQTT), esphome-proxy (ESPHome Native API). See below.
noble_driverNoOS defaultabandonware or stoprocent. Overrides the default BLE driver. Only applies when handler: auto.
adapterNoSystem defaultLinux only. Select a specific Bluetooth adapter (e.g., hci0, hci1). See below.
mqtt_proxyIf handler: mqtt-proxy(none)MQTT proxy connection (broker_url, device_id, topic_prefix, username, password, embedded_broker_*). See ESP32 BLE Proxy.
esphome_proxyIf handler: esphome-proxy(none)ESPHome Native API connection (host, port, encryption_key or password, client_info). See ESPHome Bluetooth Proxy.

BLE adapter selection (Linux only)

If your device has multiple Bluetooth adapters, you can choose which one BLE Scale Sync uses. By default, the first adapter (hci0) is used.

List your adapters:

bash
hciconfig
# or
btmgmt info

For example, a Raspberry Pi with a built-in adapter (hci0) and a USB dongle (hci1):

yaml
ble:
  adapter: hci1 # use the USB dongle for scale scanning

This lets you dedicate one adapter to BLE Scale Sync while keeping the other free for other tasks (e.g., Home Assistant Bluetooth proxy). This option is ignored on macOS and Windows, where the OS manages adapter selection.

Scale

yaml
scale:
  weight_unit: kg
  height_unit: cm
FieldRequiredDefaultDescription
weight_unitNokgkg or lbs. Display only; calculations always use kg.
height_unitNocmcm or in. Used 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
nameYes(none)Display name
slugNoAuto-generatedUnique ID (lowercase, hyphens) for MQTT topics, InfluxDB tags
heightYes(none)Height in configured unit
birth_dateYes(none)ISO date (YYYY-MM-DD)
genderYes(none)male or female
is_athleteNofalseAdjusts body composition formulas
weight_rangeNo(none){ min, max } in kg. Required for multi-user deployments
last_known_weightNonullAuto-updated after each measurement
exportersNo(none)Per-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 7 targets and their configuration fields.

Runtime

yaml
runtime:
  continuous_mode: false
  scan_cooldown: 30
  dry_run: false
  debug: false
  watchdog_max_consecutive_failures: 10
  watch_config: true
FieldRequiredDefaultDescription
continuous_modeNofalseKeep scanning in a loop (for always-on deployments)
scan_cooldownNo30Seconds between scans (5-3600). On the native BLE handler in continuous mode, after a successful read the app sleeps at least 25 s regardless of this setting so it does not reconnect while the scale is still advertising (post-disconnect grace, #143).
dry_runNofalseRead scale + compute body comp, skip exports
debugNofalseVerbose BLE logging
watchdog_max_consecutive_failuresNo10In continuous mode on Linux: exit after this many consecutive scan failures so Docker restart: unless-stopped can recover from a stuck BlueZ controller (0 = disabled). See Troubleshooting.
watch_configNotrueAuto-reload config.yaml on edit (continuous mode only). Set to false to disable and rely on SIGHUP only. See Live Config Reload.

Update Check

yaml
update_check: true
FieldRequiredDefaultDescription
update_checkNotrueCheck for newer versions after each measurement (max once per 24h)

After each successful measurement, the app sends a single GET request to api.blescalesync.dev/version. Only the app version, OS, and architecture are sent via the User-Agent header. No personal data is collected. Automatically disabled when CI=true.

Anonymous aggregated statistics are visible at stats.blescalesync.dev.

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
BLE_WATCHDOG_MAX_FAILURESruntime.watchdog_max_consecutive_failures
SCALE_MACble.scale_mac
NOBLE_DRIVERble.noble_driver
BLE_ADAPTERble.adapter
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.