Two false locks with the phone present: missing_after=30 sat below the realistic worst-case event gap (beacon counter rotation every 10s times 2-20% duty sampling, with frozen-RSSI dedupe collapsing catches inside one window), and the connect probe ran while our own discovery duty-cycling was active, where attempts stall or abort with le-connection-abort-by-local. Probe now stops discovery first and retries (2x6s); sample config and handoff document the sampling math. Local config additionally raises rssi_lock to -85, where nearby-phone readings were pinning.
56 lines
2.1 KiB
TOML
56 lines
2.1 KiB
TOML
# MAC address of the paired phone to watch.
|
|
# Run `btle-proximity list-paired` to see candidates.
|
|
device_mac = "AA:BB:CC:DD:EE:FF"
|
|
|
|
# Bluetooth adapter to use, e.g. "hci0". First available if unset.
|
|
#adapter = "hci0"
|
|
|
|
# Lock the session after this long without strong evidence of presence.
|
|
# Before locking, the daemon additionally probes the phone with a short
|
|
# connection attempt (2 tries, discovery paused), which cancels the lock
|
|
# if the phone answers. Keep in mind the sampling math: the beacon
|
|
# rotates its counter every 10 s, but the daemon only hears it a fraction
|
|
# of the time (2-20% duty), so event gaps of 25-60 s are routine when
|
|
# the RSSI is frozen — 30 s false-locked in practice. 60 s is a sane
|
|
# default with the companion app; third-party beacon apps that pause
|
|
# advertising warrant 120 s.
|
|
missing_after_secs = 60
|
|
|
|
# Advertisement updates newer than this count as "recently seen".
|
|
# Once updates stall past half of this, the radio steps up to the
|
|
# suspect duty cycle while the state stays Present.
|
|
presence_timeout_secs = 15
|
|
|
|
# Discovery only reports devices at or above this RSSI (dBm).
|
|
rssi_floor = -90
|
|
|
|
# At or below this RSSI the device counts as out of range (dBm).
|
|
# Watch your desk readings (sighting reports in the journal): if a
|
|
# nearby phone pins at the threshold, raise this — e.g. -85 when
|
|
# readings hover around -80.
|
|
rssi_lock = -80
|
|
|
|
# Scan duty cycle per state: radio on for window_ms, then rest until
|
|
# interval_ms has elapsed. window_ms/interval_ms is the radio duty cycle.
|
|
[duty.present]
|
|
window_ms = 100 # ~2% radio duty while the phone is around
|
|
interval_ms = 5000
|
|
|
|
[duty.suspect]
|
|
window_ms = 200 # aggressive probing while confirming absence
|
|
interval_ms = 1000
|
|
|
|
[duty.locked]
|
|
window_ms = 100 # rarely polling for the phone's return
|
|
interval_ms = 30000
|
|
|
|
# Optional: command to run instead of `loginctl lock-session`.
|
|
#lock_command = "swaylock -f"
|
|
|
|
# Optional: show a desktop notification after unlocking that explains the
|
|
# screen was locked because the phone left Bluetooth range.
|
|
#unlock_notice = true
|
|
|
|
# Optional: log lock actions instead of executing them (for testing).
|
|
#dry_run = false
|