Rust binaries and Home Assistant add-ons for controlling fans in Argon40 Raspberry Pi cases.
The binary uses a generic interface for controlling Argon40 case fans via I2C, with specific implementations for different case versions that handle their I2C command particularities. The case version/variant must be selected at compile time through a feature flag.
- Temperature-based fan curve control
- Configurable polling intervals and cooldown cycles
- Temperature filtering for smooth fan operation
- Support for both TOML and JSON configuration (feature gated)
- Systemd service integration
- Home Assistant add-on support
The fan control behavior is configured via TOML or JSON files (feature gated).
By default the /etc/argon-fan/config.toml file is used.
A different config file can be passed to the binaries as an argument:
argon-fan --config /path/to/configExample configuration:
# Polling interval in seconds
poll_interval_secs = 1
# Cooldown cycles to keep fan speed stable
cooldown_cycles = 5
# Temperature filtering factor (0.0 to 1.0)
filter_factor = 0.2
# Fan curve points (temperature -> speed percentage)
fan_curve = [
{ temp = 30, speed = 40 },
{ temp = 65, speed = 100 }
]Install the cross-compilation tools:
cargo install cross cargo-debBuild DEB packages for Raspberry Pi (ARM64):
# For Argon V2 cases
cross build --release --features v2 --target aarch64-unknown-linux-gnu
cargo deb --target aarch64-unknown-linux-gnu --no-build --variant=v2
# For Argon V3 cases
cross build --release --features v3 --target aarch64-unknown-linux-gnu
cargo deb --target aarch64-unknown-linux-gnu --no-build --variant=v3The .deb packages will be generated in target/aarch64-unknown-linux-gnu/debian/ and can be installed on your Raspberry Pi.
This repository also serves Home Assistant add-ons.
- Raspberry Pi with I2C enabled (see HassOSConfigurator)
MIT License - see LICENSE for details.
Contributions are welcome! Please feel free to submit pull requests or create issues for bugs and feature requests.