A modern desktop application built with PyQt6 to control and monitor a TP-Link Tapo smart plug asynchronously using Python.
- Turn smart plug ON/OFF
- Modern PyQt6 GUI
- Async device communication using
asyncio - Persistent smart plug connection
- External QSS styling support
- Responsive UI using
qasync - Environment variable configuration with
.env
- Python 3.12
- PyQt6
- qasync
- python-kasa
- asyncio
- Qt Style Sheets (QSS)
WattGuard/
│
├── app.py
├── controllers.py
├── style/
│ └── main.qss
│
├── .env
├── requirements.txt
└── README.md
git clone https://github.com/rajdeep-das-2007/WattGuard.git
cd WattGuardpython3 -m venv .venvActivate the environment:
source .venv/bin/activate.venv\Scripts\activatepip install -r requirements.txtOr manually:
pip install pyqt6 qasync python-kasa python-dotenvCreate a .env file in the project root.
Example:
TAPO_IP=192.168.0.78
TAPO_EMAIL=your_email@example.com
TAPO_PASSWORD=your_password
TAPO_PORT=80python3 app.pyAdd screenshots here later.
This project explores:
- Async programming with
asyncio - Event-driven GUI architecture
- PyQt6 layouts and styling
- Smart device communication
- Persistent async connections
- Separation of UI and controller logic
- Real-time power monitoring
- Energy usage graphs
- Device auto-discovery
- Multiple plug support
- Scheduling and automation
- System tray integration
- Dark/light theme switching
- Packaging as executable app
This project is for educational and personal use.