Barebones Bleak-based client for the Aranet4 sensor
Project description
ClAranet4
Ultra-minimal (i.e. incomplete) Python & CLI client for collecting current readings from Aranet4 Bluetooth sensors. This client uses Bleak and should work across platforms, and has been tested on Intel and ARM64 Macs.
Install
Python >= 3.10
pip install claranet4
git clone https://github.com/bede/claranet4.git
pip install ./claranet4
CLI usage
% claranet4 --help
usage: claranet4 [-h] [--version] {scan,discover,read} ...
positional arguments:
{scan,discover,read}
scan Show nearby Bluetooth devices
discover Discover nearby Aranet4 devices
read Request latest measurements from a nearby Aranet4 device
options:
-h, --help show this help message and exit
--version show program's version number and exit
Enumerate nearby Aranet4 devices
% claranet4 discover
INFO: Found 9 device(s)
INFO: Found 1 Aranet4 device(s)
[
{
"address": "390F544C-F0FF-F8BE-3A3A-BB1219AA2145",
"name": "Aranet4 1D6BA",
"rssi": -71
}
]
Request measurements from an Aranet4 by address. If the device is unpaired, a prompt should appear for the pairing code.
% claranet4 read 390F544C-F0FF-F8BE-3A3A-BB1219AA2145
INFO: Selected Aranet4 1D6BA (-74dBm)
{
"name": "Aranet4 1D6BA",
"address": "390F544C-F0FF-F8BE-3A3A-BB1219AA2145",
"rssi": -74,
"co2": 946,
"temperature": 17.6,
"pressure": 1002.1,
"humidity": 73.4
}
Executing claranet4 read
without specifying an address will request measurements from the Aranet4 with the highest received signal strength (RSSI)
% claranet4 read
INFO: Found 9 device(s)
INFO: Found 1 Aranet4 device(s)
INFO: Selected Aranet4 1D6BA (-74dBm)
{
"name": "Aranet4 1D6BA",
"address": "390F544C-F0FF-F8BE-3A3A-BB1219AA2145",
"rssi": -74,
"co2": 946,
"temperature": 17.6,
"pressure": 1002.1,
"humidity": 73.4
}
API usage
>>> from claranet4.lib import discover_ara4s, read
>>> discover_ara4s()
INFO: Found 28 device(s)
INFO: Found 1 Aranet4 device(s)
[Device(address='390F544C-F0FF-F8BE-3A3A-BB1219AA2145', name='Aranet4 1D6BA', rssi=-70)]
>>> read("390F544C-F0FF-F8BE-3A3A-BB1219AA2145").__dict__
INFO: Selected Aranet4 1D6BA (-74dBm)
{'name': 'Aranet4 1D6BA', 'address': '390F544C-F0FF-F8BE-3A3A-BB1219AA2145', 'rssi': -74, 'co2': 715, 'temperature': 20.4, 'pressure': 991.4, 'humidity': 63.4}
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file claranet4-0.1.0.tar.gz
.
File metadata
- Download URL: claranet4-0.1.0.tar.gz
- Upload date:
- Size: 4.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9e28de4e0b5e3e86cc4919bfe3dda513ae29a059b37db72c346ef0b0d1563fc9 |
|
MD5 | ac5e75721139e0d8771e20614805d5d9 |
|
BLAKE2b-256 | aec70d7d795ce10bdc6b1dc76918db10960607b7daf6a6eeef6a6e668a7c085f |
File details
Details for the file claranet4-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: claranet4-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 25d4b7c612bc41a1cea63a5f035e19553d3544098f463184ca1d11bcb105744a |
|
MD5 | a5150572bf39b811036be26efdb9974a |
|
BLAKE2b-256 | 6b1a082a8ab0dae20799bd1543060fff9037d01d132dc09929ee7023fcb774da |