Skip to main content

BLE scanner daemon that publishes findings to an MQTT topic

Project description

blester

BLE scanner daemon that publishes findings to an MQTT topic.

Installation

pip install g2labs-blester

Usage

blester --mqtt-host localhost --default-topic home/ble/findings

Options

Flag Default Description
--mqtt-host (required) MQTT broker hostname or IP
--mqtt-port 1883 MQTT broker port
--mqtt-username MQTT username
--mqtt-password MQTT password
--scan-duration 5.0 BLE scan window in seconds
--scan-interval 0.0 Pause between scans (0 = continuous)
--log-level INFO DEBUG / INFO / WARNING / ERROR

Filtering

By default, devices with no matching filter are discarded. Set --default-topic to publish unmatched devices to a catch-all topic.

Inline filters (--filter, repeatable)

blester --mqtt-host localhost \
  --filter AA:BB:CC:DD:EE:FF=home/ble/lamp \
  --filter 11:22:33:44:55:66=home/ble/sensor \
  --default-topic home/ble/unknown

Filter config file (--filter-config)

blester --mqtt-host localhost --filter-config filters.json

filters.json:

[
  {"mac": "AA:BB:CC:DD:EE:FF", "topic": "home/ble/lamp"},
  {"mac": "11:22:33:44:55:66", "topic": "home/ble/sensor"}
]

--filter and --filter-config are mutually exclusive.

MQTT payload

Each discovered device is published as a JSON object:

{
  "address": "AA:BB:CC:DD:EE:FF",
  "name": "MyDevice",
  "rssi": -72,
  "manufacturer_data": {"76": "0215..."},
  "service_uuids": ["0000180f-0000-1000-8000-00805f9b34fb"]
}

Requirements

  • Python 3.9+
  • Bluetooth adapter with BLE support
  • Linux: bluetoothd running; may need CAP_NET_ADMIN or run as root

License

MIT © Grzegorz Grzęda

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

g2labs_blester-0.1.0.tar.gz (6.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

g2labs_blester-0.1.0-py3-none-any.whl (8.6 kB view details)

Uploaded Python 3

File details

Details for the file g2labs_blester-0.1.0.tar.gz.

File metadata

  • Download URL: g2labs_blester-0.1.0.tar.gz
  • Upload date:
  • Size: 6.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for g2labs_blester-0.1.0.tar.gz
Algorithm Hash digest
SHA256 0210b3a7ffecb120f5286ed2655e2ceb83886798fae6bb2aea5cdf5f1658dabb
MD5 57497315fb9e6b5475e26eae09e2851a
BLAKE2b-256 8fd4eed8e42ca9f4bf534f8b6a1618e7667f71057fa41a5f5bd7c44132a684a8

See more details on using hashes here.

File details

Details for the file g2labs_blester-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: g2labs_blester-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 8.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for g2labs_blester-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9fb21b1492ef09ccbea0d872f6190cfb816fa6068bd7b492a92d0edea48bb196
MD5 8bde7a2c1a86a75655c314065418dfdc
BLAKE2b-256 747f5afec0171deb9427f830e6a760684f8df48ffc44f1573a0f8ca1f8fc7222

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page