-
-
Notifications
You must be signed in to change notification settings - Fork 43
Expand file tree
/
Copy pathconfig.yaml.example
More file actions
211 lines (188 loc) · 9.57 KB
/
Copy pathconfig.yaml.example
File metadata and controls
211 lines (188 loc) · 9.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
# ============================================================
# BLE Scale Sync, Example Configuration
# ============================================================
# Copy this file to config.yaml and edit the values.
# Run "npm run validate" to check your config.
# Run "npm run setup" for an interactive wizard.
#
# Secrets: use ${ENV_VAR} references (resolved from .env or
# environment variables at load time).
# ============================================================
version: 1
# --- BLE Settings (optional, uncomment to pin to a specific scale) ---
# ble:
# scale_mac: "FF:03:00:13:A1:04" # Run "npm run scan" to find yours
# bind_key: "${XIAOMI_BIND_KEY}" # Xiaomi S800 / S400: 32-hex MiBeacon key from the Mi cloud
# noble_driver: abandonware # "abandonware" | "stoprocent"
# handler: auto # "auto" | "mqtt-proxy" | "esphome-proxy" | "ha-bluetooth"
# adapter: hci0 # Linux only: select BLE adapter (omit for default)
# force_scale_adapter: "Hutbit" # override protocol auto-detection (requires scale_mac)
# session_timeout_sec: 20 # seconds one GATT session waits for a reading (default 120)
# qn_protocol_byte: 0 # QN scales only: 0 to 255, see below
# qn_report_byte: 252 # QN scales only: 0 to 255, see below
#
# scale_mac: omit for auto-discovery. On macOS, use the CoreBluetooth UUID.
# noble_driver: default is node-ble (Linux), abandonware (Windows), stoprocent (macOS).
# handler: "auto" uses local Bluetooth. "mqtt-proxy" uses an ESP32 BLE-to-MQTT bridge.
# "esphome-proxy" uses an existing ESPHome BT proxy via Native API (port 6053).
# "ha-bluetooth" subscribes to Home Assistant's Bluetooth advertisement stream (broadcast scales only).
# adapter: Linux only, select which Bluetooth adapter to use (e.g., hci1 for a USB dongle).
# Run "hciconfig" or "btmgmt info" to list available adapters.
# Ignored on macOS/Windows. Omit to use the first adapter (hci0).
# force_scale_adapter: name of the scale protocol adapter to use, exactly as printed in the
# "Adapters:" line at startup. Only for when auto-detection picks the wrong one;
# it bypasses matching entirely, so scale_mac is required. Please also open an
# issue when you need this, so the matcher itself can be fixed.
# session_timeout_sec: 5 to 600, native BLE handlers only. Lower it for scales that refuse to
# run a standalone weigh-in while a host holds the session open (e.g. Beurer BF500,
# which displays "APP"). Shorter sessions mean more adapter resets and trip the
# runtime.watchdog_max_consecutive_failures limit sooner.
# qn_protocol_byte: QN-family scales only (Renpho, Arboleaf, FITINDEX, GE and rebadges). The
# protocol byte the handshake echoes back to the scale. Set it only when a QN scale
# connects, completes the whole handshake in the debug log and then never reports a
# weight. Try 0, or 255, or the value the "QN: scale info" log line reports.
# qn_report_byte: QN-family scales only, and only worth trying after qn_protocol_byte did not
# help. Payload byte of the history-response frame, default 254 (0xFE). Vendor-app
# captures of a GE CS 10 G and an Arboleaf QN-Scale both send 252 (0xFC) instead.
#
# --- ESP32 MQTT Proxy (when handler: mqtt-proxy) ---
# mqtt_proxy:
# broker_url: "mqtt://192.168.1.50:1883" # MQTT broker URL
# device_id: esp32-ble-proxy # must match ESP32 config.json
# topic_prefix: ble-proxy # must match ESP32 config.json
# username: myuser # optional
# password: "${MQTT_PASSWORD}" # optional
#
# --- Home Assistant Bluetooth (when handler: ha-bluetooth) ---
# ha_bluetooth:
# url: "http://homeassistant.local:8123" # HA base URL (http/https) or ws(s)://.../api/websocket
# token: "${HA_TOKEN}" # long-lived access token of an ADMIN user, from .env
# source: "9c:13:9e:34:82:08" # optional: only this HA scanner (source id)
# --- Scale Units ---
scale:
weight_unit: kg # kg | lbs (display only, calculations always use kg)
height_unit: cm # cm | in (for height input below)
# --- Multi-User Matching ---
# Strategy when weight falls outside all configured ranges:
# "nearest" = assign to closest range midpoint (with warning)
# "log" = log warning and skip the measurement
# "ignore" = silently skip the measurement
unknown_user: nearest
# What to do with a reading no user's weight_range covers.
# "warn" (default) = log it and export it anyway (the behaviour before
# this option existed)
# "skip" = log it and stop: no export, and last_known_weight is
# left alone so the next weigh-in still matches correctly
out_of_range: warn
# --- Users ---
# At least one user is required. For multi-user setups,
# define weight_range so the app can identify who stepped on the scale.
users:
- name: Alice
slug: alice # unique, lowercase, used in MQTT topics & InfluxDB tags
height: 168
birth_date: "1995-03-20"
gender: female
is_athlete: false
weight_range: { min: 50, max: 75 } # always in kg
last_known_weight: null # auto-updated after each measurement
# Beurer BF7xx / BF9xx only (consent-gated SIG scales):
# beurer_pin: 1234 # code the scale was paired with; 0 on a wiped scale
# beurer_user_index: 1 # scale user slot the code belongs to
# beurer_provision: false # write this profile into a scale that has none stored
# Per-user exporters (optional, override global_exporters for this user):
# exporters:
# - type: garmin
# email: alice@example.com
# password: "${GARMIN_PASSWORD_ALICE}"
# token_dir: ./garmin-tokens/alice
# - type: strava
# client_id: "${STRAVA_CLIENT_ID}"
# client_secret: "${STRAVA_CLIENT_SECRET}"
# token_dir: ./strava-tokens/alice # run "npm run setup-strava" after config
# - type: intervals
# athlete_id: i123456 # Intervals.icu Settings → Developer
# api_key: "${INTERVALS_API_KEY}"
- name: Bob
slug: bob
height: 183
birth_date: "1990-06-15"
gender: male
is_athlete: true
weight_range: { min: 75, max: 100 }
last_known_weight: 85.5
# --- Global Exporters ---
# Shared by all users (unless a user defines their own "exporters" list).
# All enabled exporters run in parallel.
global_exporters:
# -- Garmin Connect --
- type: garmin
email: "${GARMIN_EMAIL}"
password: "${GARMIN_PASSWORD}"
token_dir: ~/.garmin_tokens
# weight_only: true # upload the weight alone; BMI, body fat, water, bone,
# # muscle, visceral fat, physique rating and metabolic
# # age are left unset in Garmin Connect
# -- MQTT (Home Assistant auto-discovery) --
# - type: mqtt
# broker_url: "mqtt://localhost:1883" # use mqtts:// for TLS
# topic: scale/body-composition
# qos: 1 # 0, 1, or 2
# retain: true
# username: myuser
# password: "${MQTT_PASSWORD}"
# client_id: ble-scale-sync
# ha_discovery: true # Home Assistant auto-discovery
# ha_device_name: BLE Scale
# -- Webhook (generic HTTP) --
# - type: webhook
# url: "https://example.com/hook"
# method: POST
# headers:
# X-Api-Key: secret123
# timeout: 10000
# -- InfluxDB v2 --
# - type: influxdb
# url: "http://localhost:8086"
# token: "${INFLUXDB_TOKEN}"
# org: my-org
# bucket: my-bucket
# measurement: body_composition
# -- Ntfy (push notifications) --
# - type: ntfy
# url: "https://ntfy.sh"
# topic: my-scale
# title: Scale Measurement
# priority: 3
# token: "${NTFY_TOKEN}" # Bearer token auth
# # username: myuser # or Basic auth
# # password: "${NTFY_PASSWORD}"
# -- Telegram (bot notifications) --
# - type: telegram
# bot_token: "${TELEGRAM_BOT_TOKEN}" # token from @BotFather
# chat_id: "987654321" # numeric ID or @channelusername
# title: Scale Measurement
# silent: false # true = no notification sound
# -- File (CSV/JSONL) --
# - type: file
# file_path: "./measurements.csv" # path to output file
# format: csv # "csv" or "jsonl"
# -- Wger (self-hosted weight/workout manager) --
# - type: wger
# base_url: https://wger.de # your instance URL
# token: "${WGER_TOKEN}" # API key from <base_url>/en/user/api-key
# sync_measurements: true # also push body fat/water/muscle/bone
# --- Runtime Settings ---
runtime:
continuous_mode: false # true = keep scanning in a loop (ideal for Raspberry Pi)
scan_cooldown: 30 # seconds between scans in continuous mode (5–3600)
idle_rescan_delay: 5 # seconds before rescanning when no scale was found (0-3600)
retry_failed_exports: true # keep a reading whose export failed and retry it later
dry_run: false # true = read scale + compute body comp, skip all exports
debug: false # true = verbose BLE logging
# --- Update Check ---
# On each successful measurement (max once per 24h), the app sends a lightweight
# GET request to check for newer versions. Only the app version, OS, and architecture
# are sent via the User-Agent header. No personal data is collected.
# Disable with: update_check: false
update_check: true