BLE
Run the companion service
git clone https://github.com/HammerHeads-Engineers/spx-ble-adapter.git
cd spx-ble-adapter
npm install # first time
npm start # sudo npm start on macOS when CoreBluetooth requires itConfiguration example
attributes:
temperature: 22.5
setpoint: 24.0
communication:
- ble:
adapter:
baseUrl: http://host.docker.internal:8085
timeout: 3.0
polling:
enabled: true
interval: 1.0
device:
name: SpX Temperature Sensor
codecs:
celsius:
format: utf8
bindings:
temperature:
attribute: $out(temperature)
codecRef: celsius
tolerance: 0.05
setpoint:
attribute: $in(setpoint)
stateKey: setpointC
codecRef: celsius
services:
- uuid: "181a"
name: Environmental Sensing
characteristics:
- uuid: "2a6e"
name: Temperature
binding: temperature
properties: [read, notify]
notify:
triggers: [state]
- uuid: "f0c09111-8b3a-4e69-bdd0-9f0f613d1a90"
name: Setpoint
binding: setpoint
properties: [read, write, notify]
onWrite:
- action: parse
type: float
target: state
key: setpointC
- action: log
template: "[BLE] Setpoint -> {{value}}"Key sections
Adapter settings reference
Field
Type
Default
Notes
Bindings, direction, and codecs
Defining services and characteristics
OnWrite actions
Lifecycle
Reference models
Testing tips
Last updated

