Skip to content

Rust libraries and tools for Aranet environmental sensors (CO₂, temperature, humidity, radon, radiation) via Bluetooth Low Energy

License

Notifications You must be signed in to change notification settings

cameronrye/aranet

Repository files navigation

Aranet

Rust implementation for Aranet environmental sensors.

Connect to your Aranet devices via Bluetooth LE to read measurements, download history, and monitor air quality.

CI codecov crates.io docs.rs License: MIT Rust

Features

  • aranet-core — Core BLE library supporting Aranet4, Aranet2, AranetRn+ (Radon), and Aranet Radiation sensors
    • Current readings (CO₂, temperature, pressure, humidity, radon, radiation)
    • Historical data download with timestamps
    • Device settings (measurement interval, Bluetooth range)
    • Auto-reconnection with configurable backoff
    • Real-time streaming and event system
  • aranet-cli — Command-line interface for quick readings and data export
    • Multi-device reading with parallel connections
    • Interactive device picker, device aliases
    • Passive reading from BLE advertisements
    • Progress bars for history download
    • --since/--until date filters, --inhg pressure unit
    • Local data caching with sync and cache commands
  • aranet-store — Local SQLite-based data persistence
    • Incremental history sync (download only new records)
    • Query cached data without device connection
    • Automatic deduplication of history records
  • aranet-tui — Terminal UI dashboard for real-time monitoring
    • Multi-device monitoring with auto-refresh
    • Sparkline charts with min/max labels
    • CO2/radon threshold alerts with audio bell
    • Light/dark theme, mouse support, vim keybindings
    • Export history to CSV, comparison view
    • Device filter, alias management, settings editing
  • aranet-gui — Desktop application built with egui
  • aranet-wasm — WebAssembly module for browser integration (planned)

Screenshots

CLI TUI GUI
CLI Demo TUI Demo GUI

Installation

Install the CLI from crates.io:

cargo install aranet-cli

Or build from source:

git clone https://github.com/cameronrye/aranet.git
cd aranet
cargo build --release

Using as a Library

Add aranet-core to your Cargo.toml:

[dependencies]
aranet-core = "0.1"

Quick Start

Scan for devices

aranet scan

Read current measurements

aranet read <DEVICE_ADDRESS>

Download measurement history

aranet history <DEVICE_ADDRESS> --output history.csv

View device information

aranet info <DEVICE_ADDRESS>

Read from multiple devices

aranet read -d device1 -d device2
aranet read -d living-room,bedroom  # using aliases

Manage device aliases

aranet alias set living-room AA:BB:CC:DD:EE:FF
aranet alias list
aranet read -d living-room

Diagnose BLE issues

aranet doctor

Project Structure

aranet/
├── crates/
│   ├── aranet-types/    # Platform-agnostic types (shared)
│   ├── aranet-core/     # Core BLE library
│   ├── aranet-store/    # Local SQLite data persistence
│   ├── aranet-cli/      # CLI tool
│   ├── aranet-tui/      # Terminal dashboard
│   ├── aranet-gui/      # Desktop GUI (egui)
│   └── aranet-wasm/     # WebAssembly module
└── docs/                # Protocol documentation

Supported Devices

Device Sensors Current History Status
Aranet4 CO₂, Temperature, Pressure, Humidity Yes Yes Fully tested
Aranet2 Temperature, Humidity Yes Yes Supported
AranetRn+ (Radon) Radon, Temperature, Pressure, Humidity Yes Yes Fully tested
Aranet Radiation Dose Rate, Total Dose Yes Partial Supported (history not yet implemented)

Requirements

  • Rust 1.90+
  • Bluetooth adapter with BLE support
  • Platform support:
    • macOS
    • Linux (with BlueZ)
    • Windows

Contributing

Contributions are welcome! Please check the open issues for areas where you can help.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Looking to Contribute?

Here are some features and improvements that would be great additions to the project:

Feature Description Difficulty
Aranet2 history download Implement history data retrieval for Aranet2 devices Medium
Aranet Radiation history Complete history download support for Aranet Radiation sensors Medium
Home Assistant integration Create a Home Assistant custom component using aranet-core Medium
Prometheus exporter Add metrics endpoint for Prometheus/Grafana monitoring Easy
MQTT publisher Publish readings to MQTT broker for IoT integration Easy
InfluxDB export Direct export to InfluxDB time-series database Easy
Web dashboard Complete the aranet-wasm module for browser-based monitoring Hard
Calibration support Add device calibration commands for CO2 sensors Medium
Notification system Desktop notifications when thresholds are exceeded Easy
Data visualization Enhanced charting and trend analysis in TUI/GUI Medium

If you're interested in tackling any of these, please open an issue to discuss your approach before starting work. We're happy to provide guidance and answer questions!

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

  • Aranet4-Python - Python implementation that inspired this project
  • btleplug - Cross-platform Bluetooth LE library for Rust

Made with ❤️ by Cameron Rye

This project is not affiliated with, endorsed by, or sponsored by Aranet or SAF Tehnika JSC. Aranet is a trademark of SAF Tehnika JSC.

About

Rust libraries and tools for Aranet environmental sensors (CO₂, temperature, humidity, radon, radiation) via Bluetooth Low Energy

Topics

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •