Skip to content

BLE loggers

This documents the use of wireless SwitchBot Bluetooth temperature humidity sensors for logging inside the ASS and APS enclosures. The devices at SwitchBot Outdoor Meters. Powered by AA batteries?

aurora_logble.py

Detects and prints the bluetooth transmissions from the ble sensors. The main python packages utilised for this are bleak and asyncio.

blecollect.sh

Runs the python script in a linux screen called 'blecollect' and also logs the output data at: ~/data/blesensors/ble_temperatures_$(date +%Y%m%d).log

To run as system service? Restarts if dies for whatever reason?

The data outputs a temperature, humidity, pressure, and battery percentage status.

Note that there is no documentation about how to decode which is which, this was done by trial and error, and the format is different to the sensors used in the SLEIGH which may have been a different version - so beware that this may change if you're using new sensors. I used this link to help me get started: https://github.com/OpenWonderLabs/SwitchBotAPI-BLE/blob/latest/devicetypes/meter.md

Note that this script won't work on a Mac because I think Macs hides all the ble device info for security reasons.

BLE logger index

Mac address Location ID Description
D4:35:34:38:1D:6B ass ASS, underneath top shelf, just behind fan
D2:35:34:38:1F:88 aps APS, on face, cable entry side

To find/ add a new sensor

To add a new sensor, you must modify this script by adding the mac address of the sensor and giving it a location id (see index).

To find a new sensor, the device must first by turned on by holding the on button until it flashes.

Then open python and import all from the auora_logble.py script. Search for new devices by running the scan_devices() function and looking for the mac address that likely corresponds to the new device.