aranet-cli
Command-line interface for Aranet environmental sensors.
A fast, scriptable CLI for reading sensor data, downloading history, and configuring Aranet devices (Aranet4, Aranet2, AranetRn+, Aranet Radiation).
Installation
Or build from source:
Usage
Scan for devices
Read current measurements
Download measurement history
# Filter by date range
Read from multiple devices
# Specify multiple devices
# Or comma-separated
Passive read mode
# Read from BLE advertisements without connecting (requires Smart Home enabled)
Watch real-time data
View device information
Configure device settings
Manage device aliases
# Create an alias for a device
# List all aliases
# Use aliases instead of addresses
# Remove an alias
Diagnose BLE issues
Pressure units
# Display pressure in inches of mercury
# Explicitly use hPa (default)
Configuration
The CLI supports persistent configuration via a TOML file:
# Initialize config file
# Set a default device
# Set default output format
# Show current config
Configuration options:
device— Default device addressformat— Default output format (text,json,csv)timeout— Connection timeout in secondsno_color— Disable colored outputfahrenheit— Use Fahrenheit for temperature displayinhg— Use inHg for pressure displaybq— Use Bq/m3 for radon (instead of pCi/L)
Output Formats
| Format | Description |
|---|---|
text |
Human-readable colored output (default) |
json |
JSON for scripting and APIs |
csv |
CSV for spreadsheets and data analysis |
Visual Styling
The CLI uses rich styling by default with color-coded values, spinners, and table formatting.
Style Modes
| Mode | Description |
|---|---|
rich |
Full styling with tables, spinners, colored values (default) |
minimal |
Colors only, no tables or spinners |
plain |
No styling, suitable for scripting |
# Use minimal styling
# Plain output for scripts
# Set via environment variable
Color-Coded Values
Sensor readings are color-coded based on thresholds:
| Metric | Green | Yellow | Red |
|---|---|---|---|
| CO2 | < 800 ppm | 800-1000 ppm | > 1000 ppm |
| Radon | < 100 Bq/m3 | 100-150 Bq/m3 | > 150 Bq/m3 |
| Battery | > 50% | 20-50% | < 20% |
| Humidity | 30-60% | Outside range | - |
Brief Mode
Get a compact one-line status:
# Output: Aranet4 17C3C: 800 ppm [GREEN] | 22.5C | 45% | 85%
Shell Completions
Generate shell completions for your preferred shell:
Related Crates
This CLI is part of the aranet workspace:
| Crate | crates.io | Description |
|---|---|---|
| aranet-core | Core BLE library for device communication | |
| aranet-types | Shared types for sensor data | |
| aranet-tui | Terminal UI dashboard | |
| aranet-gui | Desktop application (egui) |
License
MIT
Made with love by Cameron Rye