A Rust application for controlling Hottoh stoves (CMG, Edilkamin and more) via an HTTP API interface.
Hottoh API is a bridge application that connects to pellet stoves via Hottoh proprietary TCP protocol and exposes their functionality through a RESTful HTTP API. This allows for remote control and monitoring of compatible stoves from any device that can make HTTP requests.
This project is based on the work done by benlbrm on the hottohpy project. Special thanks to him for his work.
- TCP communication with stoves
- RESTful HTTP API with Swagger documentation
- Real-time monitoring of stove status
- Control of stove functions (power, temperature, fan speed, etc.)
- Configurable logging system
- Robust error handling and recovery
- Very low CPU and memory usage
- Rust (edition 2021)
- Compatible Hottoh stove (default TCP port is 5001)
-
Clone the repository:
git clone https://github.com/jer-nz/hottoh_api.git cd hottoh_api -
Build the project:
cargo build --release -
Configure the application by editing
config.ini:[stove] ip = 192.168.1.100 # Replace with your stove's IP address port = 5001 # Replace with your stove's port [http_api] ip = 0.0.0.0 # Listen on all interfaces port = 3000 # Port for the HTTP API [log] level = info # Log level (trace, debug, info, warn, error) directory = logs # Directory for log files max_log_files = 10 # Maximum number of log files to keep
-
Run the application:
./target/release/hottoh_api config.inior
./target/release/hottoh_apiIf the config.ini is in the same folder.
Once the application is running, you can access the Swagger UI documentation at:
http://localhost:3000/swagger-ui/
This provides interactive documentation for all available API endpoints.
GET /api/inf- Get general information about the stoveGET /api/dat/0- Get detailed stove data (page 0)GET /api/dat/1- Get detailed stove data (page 1)GET /api/dat/2- Get detailed stove data (page 2)
POST /api/dat/set_on_off- Turn the stove on or offPOST /api/dat/set_eco_mode- Activate or deactivate eco modePOST /api/dat/set_power_level- Set the power level (0-10)POST /api/dat/set_ambiance_temp- Set the ambient temperaturePOST /api/dat/set_chrono_mode- Activate or deactivate chrono modePOST /api/dat/set_chrono_temp- Set the chrono temperaturePOST /api/dat/set_fan_speed- Set the fan speed (0-5)
src/main.rs- Application entry pointsrc/hottoh/- Main module directoryconfig.rs- Configuration handlinghttp_api.rs- HTTP API implementationlogger.rs- Logging systemtcp_client.rs- TCP communication with the stovetcp_client_structs.rs- Data structures for TCP communicationhottoh_const.rs- Constants and enumerationshottoh_structs.rs- Data structures for stove datashared_struct.rs- Shared state between components
Contributions are welcome!