| Crates.io | klafs-api |
| lib.rs | klafs-api |
| version | 0.1.7 |
| created_at | 2026-01-12 19:44:59.652217+00 |
| updated_at | 2026-01-12 21:16:26.695762+00 |
| description | Rust client library for the Klafs sauna control API |
| homepage | |
| repository | https://github.com/dobermai/sauna |
| max_upload_size | |
| id | 2038708 |
| size | 193,629 |
A Rust library and CLI for controlling Klafs saunas via their cloud API.
⚠️ Unofficial project — not affiliated with KLAFS GmbH & Co. KG
This project provides:
# Login to your Klafs account (use your USERNAME, not email!)
sauna login
# Find your sauna ID and set it as default (auto-selects if only one sauna)
sauna saunas
sauna config --sauna-id "your-sauna-uuid" --pin "1234"
# Check status
sauna status
# Start your sauna
sauna power-on
# Or schedule it for later
sauna power-on --at 18:30
# Adjust settings
sauna set-temp 85
sauna set-mode sanarium
# Turn off
sauna power-off
Important: Use your KLAFS username, not your email address, when logging in. This is the same username you use on the KLAFS web portal.
brew install dobermai/tap/sauna
cargo install sauna
Pre-built binaries are available for Linux, macOS, and Windows on the Releases page.
git clone https://github.com/dobermai/sauna.git
cd sauna
cargo install --path sauna
This project has been developed and tested on macOS. It should work on Linux and Windows as well, but these platforms have not been tested yet. If you encounter any issues on these platforms, please open an issue or submit a pull request.
# Enable verbose logging
sauna --verbose <command>
# Enable HTTP debug logging (writes to file)
sauna --debug <command>
# Save debug output to a file (used with --debug)
sauna --debug-file debug.log <command>
Authenticate with your Klafs account. Credentials are stored securely in your system keyring.
sauna login
# Username and password will be prompted securely
# Provide credentials via flags
sauna login --username your_username --password your_password
Important: Use your KLAFS username, not your email address. This is the same username you use on the KLAFS web portal.
Warning: Klafs locks accounts after 3 failed login attempts!
List all saunas registered to your account:
# Human-readable output
sauna saunas
# JSON output
sauna saunas --json
Example output:
Registered Saunas
* My Home Sauna
ID: 364cc9db-86f1-49d1-86cd-f6ef9b20a490
(default)
Guest House Sauna
ID: a1b2c3d4-e5f6-7890-abcd-ef1234567890
Use 'sauna config --sauna-id <ID>' to set a default.
Set your default sauna ID to avoid specifying it with every command:
sauna config --sauna-id "your-sauna-uuid"
# Store PIN for power control (stored in system keyring)
sauna config --pin "1234"
# Auto-select is enabled by default and will pick the sauna automatically
# when exactly one sauna is registered.
# Disable auto-select behavior
sauna config --auto-select false
# View current configuration
sauna config --show
# Human-readable output
sauna status
# JSON output
sauna status --json
# Specify a different sauna
sauna status --sauna-id "another-sauna-uuid"
Example output:
Sauna Status
Connection: Connected
Status: Off
Mode: Sanarium
Current Temp: N/A
Target Temp: 70°C
Scheduled: Not scheduled
When the sauna is heating:
Sauna Status
Connection: Connected
Status: Heating (45°C -> 85°C)
Mode: Sauna
Current Temp: 45°C
Target Temp: 85°C
Remaining Time: 1h 30m
Scheduled: Not scheduled
# Power on immediately (requires PIN; uses stored PIN if not provided)
sauna power-on
# Schedule power on for a specific time
sauna power-on --at 18:30
# Provide PIN explicitly
sauna power-on --pin 1234
# Power off
sauna power-off
# Set temperature (10-100°C for Sauna, 40-75°C for Sanarium)
sauna set-temp 85
# Set mode: sauna or sanarium
sauna set-mode sauna
# Set humidity level (1-10, Sanarium mode only)
sauna set-humidity 7
# Set scheduled start time (without starting)
sauna schedule 18:30
# Clear the schedule
sauna schedule --clear
# You can also clear by omitting the time
sauna schedule
Save and reuse sauna configurations locally:
# Create a profile
sauna profile create hot --mode sauna --temp 90
sauna profile create relaxed --mode sanarium --temp 60 --humidity 7
# List all profiles
sauna profile list
# Show profile details
sauna profile show hot
# Apply a profile (sets mode, temperature, humidity)
sauna profile apply hot
# Apply and start the sauna
sauna profile apply hot --start
# Delete a profile
sauna profile delete hot
Profiles are stored locally in ~/.config/klafs/profiles.toml.
Set multiple parameters in one command:
# Set temperature and humidity (current mode)
sauna configure --temp 85 --humidity 5
# Set temperature and schedule
sauna configure --temp 85 --time 18:30
# Set all at once
sauna configure --temp 85 --humidity 5 --time 18:30
Control the cabin lights:
# Main light
sauna light on
sauna light on --brightness 8
sauna light off
# Sunset light
sauna sunset on
sauna sunset on --brightness 10
sauna sunset off
Add to your Cargo.toml:
[dependencies]
klafs-api = "0.1"
tokio = { version = "1", features = ["rt-multi-thread", "macros"] }
Example:
use klafs_api::KlafsClient;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = KlafsClient::new()?;
// Login (use your KLAFS username, not email!)
client.login("your_username", "password").await?;
// Get sauna status
let status = client.get_status("your-sauna-uuid").await?;
println!("Connected: {}", status.is_connected);
println!("Powered On: {}", status.is_powered_on);
println!("Current Temperature: {}°C", status.current_temperature);
println!("Target Temperature: {}°C", status.target_temperature());
if let Some(mode) = status.current_mode() {
println!("Mode: {}", mode);
}
Ok(())
}
Base URL: https://sauna-app-19.klafs.com
| Endpoint | Method | Description |
|---|---|---|
/Account/Login |
POST | Authenticate (form-encoded) |
/SaunaApp/ChangeSettings |
GET | List registered saunas (HTML) |
/SaunaApp/GetData?id={id} |
GET | Get sauna status (JSON) |
/SaunaApp/StartCabin |
POST | Power on sauna (supports scheduling) |
/SaunaApp/StopCabin |
POST | Power off sauna |
/SaunaApp/ChangeTemperature |
POST | Set target temperature |
/SaunaApp/ChangeHumLevel |
POST | Set humidity level |
/SaunaApp/SetMode |
POST | Set operating mode |
/SaunaApp/SetSelectedTime |
POST | Set scheduled start time |
/SaunaApp/LightChange |
POST | Control lights (main, color, sunset) |
/SaunaApp/SetBathingTime |
POST | Set session duration (broken - see below) |
| Mode | Value | Temperature Range |
|---|---|---|
| Sauna | 1 | 10-100°C |
| Sanarium | 2 | 40-75°C |
| Code | Meaning |
|---|---|
| 0 | Off |
| 1 | Scheduled (waiting for start time) |
| 2 | Heating |
| 3 | Ready |
sauna/
├── Cargo.toml # Workspace manifest
├── klafs-api/ # API client library
│ ├── src/
│ │ ├── lib.rs # Public API
│ │ ├── client.rs # HTTP client
│ │ ├── debug.rs # HTTP traffic debugging
│ │ ├── error.rs # Error types
│ │ └── models.rs # Data models
│ └── tests/
│ ├── fixtures/ # Test fixtures (HTML, JSON)
│ └── integration_tests.rs
└── sauna/ # CLI application
└── src/
├── main.rs # CLI commands
├── config.rs # Configuration & keyring
└── profiles.rs # Profile storage
The following Klafs features are not currently supported:
SetBathingTime API endpoint exists and accepts requests, but the sauna ignores the setting. This appears to be a server-side bug.Contributions are welcome! If you'd like to help:
Inspired by other community projects:
"KLAFS" is a registered trademark of KLAFS GmbH & Co. KG. This project is not affiliated with, endorsed by, sponsored by, or otherwise connected to KLAFS GmbH & Co. KG. All product and company names are trademarks or registered trademarks of their respective holders. Use of them does not imply any affiliation or endorsement.
THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
This software is intended for personal, non-commercial use by owners of Klafs saunas who wish to integrate their sauna with home automation systems or control it via command line. It is provided for educational and interoperability purposes.
Licensed under either of:
at your option.