Strom is a free, open-source script that brings smart heating to your home. It uses weather forecasts and electricity price data to fine-tune energy use, finding a cost-effective heating schedule through convex optimization. With a smart plug, Strom quietly takes care of the details, automatically adjusting your heating to save energy. It’s a simple, clever way to make your home more efficient and eco-friendly.
Requires Python 3.12.8
-
Clone the repository:
git clone https://github.com/Bloodwing1/Strom.git cd Strom -
Create a virtual environment and activate it:
python -m venv venv source venv/bin/activate # On Windows use `venv\Scripts\activate`
-
Install the required packages:
pip install -r requirements.txt
-
Create a config folder in the root project directory. This folder is your personal api keys will be saved
-
Place your electricity price and weather API keys in a "price_api_key.txt" "weather_api_Key.txt" file that you create in the config folder.
-
Place your tapo account credentials in a "tapologin.env" file in the config folder. The content of this .env file should look like this:
EMAIL=myemail@hotmail.com PASSWORD=myPassword12
-
You can optionally add your custom house heating parameters to a "house_config.json" file in the config folder.
{
"C_air": 0.56,
"C_wall": 3.5,
"R_interior": 1.0,
"R_exterior": 6.06,
"Q_heater": 2.0,
"Q_cooling": 0.0,
"T_min": 18.0,
"T_max": 24.0,
"T_interior_init": 18.5,
"T_wall_init": 18.5,
"P_base": 0.01,
"freq": "1h"
}Otherwise the main script will generate and empty json file that will fill the house with the default values we used.
To run the main script manually:
python main.py # python3 main.py for Mac usersAlternatively create a cron job or similar, that activates the main script hourly.
- Cron job installer
- Standalone executable