Bluetooth sensors¶
On this page: what Bluetooth does in Lutra Lite, which sensor values map to which Lutra quantities, how to bind a sensor on site, the status of a sensor, what is not supported, and how the box protects itself when memory is short. Available from firmware 0.5.0, in the read build and in the switching build.
To be confirmed
Bluetooth has run on a development board (stack started, telemetry and a firmware update with Bluetooth active). It has not yet been tested with a real sensor. Everything about receiving, binding and reporting sensor values on this page is built and tested in software, but not yet confirmed with real hardware.
What it does¶
The box listens for wireless sensors that broadcast their readings in the open BTHome v2 format. For example a floating pool thermometer or a temperature and humidity sensor in the plant room.
- Passive only. The box only listens to advertisements. It never connects to a sensor, never advertises itself, never pairs, and does not even send scan requests.
- Read only. Bluetooth never switches anything, also not in the switching build.
- Not for phones. Bluetooth is not used to set up the box or to talk to a phone; setup stays on the setup page over the box's temporary Wi-Fi network.
- Unencrypted BTHome v2 only. Other Bluetooth protocols (for example those of some chlorinators and heat pumps) are not read. See What is not supported.
A sensor is bound by its MAC address to one Lutra quantity and gets a short
id b1 to b8. In the cloud its source is ble/<id>, for example ble/b1 (compare d1 for a device on the
bus). A sensor that measures two things, such as temperature and humidity, is bound twice, once per quantity.
| Limit | Value |
|---|---|
| Bound sensors (bindings) | at most 8 |
| "Heard nearby" list | the last 16 BTHome devices the box heard |
Quantities and BTHome objects¶
A BTHome message contains objects, each with an id. The box maps these objects to Lutra quantities:
| Quantity | Unit | BTHome objects (id, factor) |
|---|---|---|
water_temp, outdoor_temp, air_temp, heatpump_water_in, heatpump_water_out |
°C | temperature 0x02 (0.01), 0x45 (0.1), 0x57 (1), 0x58 (0.35) |
air_humidity |
% | humidity 0x03 (0.01), 0x2E (1) |
pump_power, heatpump_power |
W | power 0x0B (0.01), 0x5C (0.01, signed) |
pump_energy, heat_energy |
kWh | energy 0x0A (0.001), 0x4D (0.001) |
flow_rate |
m3/h | volume flow rate 0x49 (0.001) |
leak |
bool | moisture (binary) 0x20: 1 = wet = true |
plantroom_door |
open / closed |
door 0x1A, opening 0x11, window 0x2D (binary): 1 = open |
Rules:
- Per binding the first object of the matching kind in a message counts. Objects are ordered by id, so
0x02wins over0x45. - Battery (
0x01) and signal strength are sent along as diagnostics (bat,rssi), not as a quantity. - The box decodes all objects of the BTHome object table (for example pressure, voltage, CO2, illuminance), but only the objects above can be bound. Everything else still shows in "Heard nearby" and on the USB console.
- Events (button, dimmer), text and raw objects and device information objects are skipped.
- A message with a BTHome version other than 2 is ignored. An unknown object id ends reading of that message (values before it still count). A message with an object that runs past its end is dropped entirely.
Binding a sensor¶
Sensors are bound on site only, like the device list. Prepare the sensor first: set it to BTHome v2, unencrypted, with a fixed MAC address.
On the setup page¶
- Open the setup page and choose the Bluetooth tab.
- Under Heard nearby every BTHome device within reach appears with its address, signal and last values. The list refreshes every few seconds while the page is open.
- For the sensor you want, choose what it measures and press Add. It appears under Bluetooth sensors with its id and status.
- To bind a second value of the same sensor (for example humidity), add it again with the other quantity.
- To unbind, press Remove next to the sensor.
The page uses GET /api/ble, POST /api/ble/add (mac=<12 hex>&q=<quantity>) and POST /api/ble/remove
(id=b1) on the box's temporary network.
On the USB console¶
| Command | What it does |
|---|---|
ble |
Bluetooth state, bound sensors with status, and what is heard nearby |
ble add mac=A4:C1:38:0A:0B:0C&q=water_temp |
Bind the sensor with this MAC address to a quantity |
ble rm b1 |
Remove binding b1 |
Not from the cloud¶
Bindings cannot be changed remotely. The settings ble and ble_sensors in the shadow are refused with
"only on site", like devices and busplan. The box does report its bound sensors in reported.devices, as
{"id":"b1","type":"bthome","via":"ble","ok":true}.
Bindings are stored in the box's settings and survive restarts and updates. A factory reset removes them. If the stored list is damaged or unknown, the box starts with no sensors rather than guessing.
Status per sensor¶
| Status | Meaning |
|---|---|
ok |
A value of the bound kind was received within the stale time (default 10 minutes) |
stale |
There was a value, but nothing new for longer than the stale time. The old value is no longer sent. |
invalid |
The sensor is heard, but does not send this kind of value (wrong quantity chosen, or the sensor is encrypted) |
no_answer |
Nothing heard from this address since the box started |
In the cloud, stale is shown as no_answer.
Telemetry¶
Only when at least one sensor is bound, telemetry gets an extra member ble; otherwise the message is the same
as in 0.4.x:
"ble":[{"id":"b1","q":"water_temp","s":"ok","v":27.53,"bat":88,"rssi":-71},
{"id":"b2","q":"leak","s":"stale"}]
v is present only with "s":"ok". A change of status (for example ok to stale) or of a state (leak, door)
sends a message straight away, at most once every 30 seconds. A slowly changing temperature waits for the
normal interval, as with bus devices. See Device messages (MQTT).
What is not supported¶
| Not supported | What to do |
|---|---|
| Encrypted BTHome messages | Not decrypted in this version. The sensor shows in "Heard nearby" marked "encrypted"; a bound encrypted sensor has status invalid. Switch encryption off in the sensor. |
| Sensors with a changing (privacy) address | Binding is by fixed MAC address. Use a sensor with a fixed address. |
| Other Bluetooth protocols (chlorinators, heat pumps, apps) | Not read; these protocols are undocumented. |
| Connecting, pairing, phones | Never; the box only listens. |
| Setting up sensors remotely | On site only. |
Compatible sensors¶
Any sensor that sends unencrypted BTHome v2 advertisements from a fixed address should work.
To be confirmed
No sensor has been tested with Lutra yet. Planned first tests are a Xiaomi LYWSD03MMC with pvvx firmware in BTHome mode, and a Shelly BLU H&T. Until those tests are done, no sensor is listed as verified.
Radio, memory and safety¶
Bluetooth is designed so that it can never make the box unreachable or stop it from updating.
- Wi-Fi first. The box scans passively for 50 ms in every 200 ms (25 %), so Wi-Fi has the radio most of the time. A sensor that advertises every 10 seconds is heard on average about every 40 seconds.
- Scans only when needed: when sensors are bound or the setup page is open. Without sensors the radio stays with Wi-Fi.
- Starts only when needed (from 0.5.2). Without bound sensors Bluetooth does not start at all (status
standby), so the box keeps about 31 KB of internal RAM free. It starts as soon as the setup page opens or the first sensor is bound, and then stays on until the next restart. - Starts last, after the bus, the cloud connection and the update path.
- Not in safe mode. A box that keeps crashing in Bluetooth ends up in safe mode after 5 restarts, without Bluetooth, and stays reachable.
- Stops itself when memory is short. If less than 64 KB of internal RAM is free after Bluetooth starts, Bluetooth is stopped again, because a firmware update must always fit.
- The box keeps running. If Bluetooth cannot start, the log gets one line
Bluetooth: not started (<reason>), the LED shows no error, and the box works on without Bluetooth. Reasons:safe mode,no memory,controller error,low memory. The setup page shows the same reason on the Bluetooth tab. - On success the log shows
Bluetooth: started (internal RAM <n> KB used, <m> KB free). The same figure is shown bystatusandbleon the USB console.
Related pages¶
Last reviewed: 2026-11-24. Applies to Lutra Lite 0.5.0.