Module history

Source
Expand description

Historical data download.

This module provides functionality to download historical sensor readings stored on an Aranet device.

§Supported Devices

DeviceHistory SupportNotes
Aranet4FullCO₂, temperature, pressure, humidity
Aranet2FullTemperature, humidity
AranetRn+ (Radon)FullRadon, temperature, pressure, humidity
Aranet RadiationPartialHistory download not yet implemented

Note: Aranet Radiation devices do not currently support history download. The radiation_rate and radiation_total fields in HistoryRecord are reserved for future implementation but are currently always None.

§Index Convention

All history indices are 1-based, following the Aranet device protocol:

  • Index 1 = oldest reading
  • Index N = newest reading (where N = total_readings)

This matches the device’s internal indexing. When specifying ranges:

let options = HistoryOptions {
    start_index: Some(1),    // First reading
    end_index: Some(100),    // 100th reading
    ..Default::default()
};

§Protocols

Aranet devices support two history protocols:

  • V1: Notification-based (older devices) - uses characteristic notifications
  • V2: Read-based (newer devices, preferred) - direct read/write operations

Structs§

HistoryInfo
Information about the device’s stored history.
HistoryOptions
Options for downloading history.
HistoryProgress
Progress information for history download.

Enums§

HistoryParam
Parameter types for history requests.

Functions§

raw_to_pressure
Convert raw pressure value to hPa.
raw_to_temperature
Convert raw temperature value to Celsius.

Type Aliases§

ProgressCallback
Type alias for progress callback function.