Smart Home App PFE 2026
# Smart Home – Energy Management Application with AI
## Project Overview
This is a full-stack smart home energy management system developed as a final year project (PFE) at USTHB. It combines a Deep Q-Network (DQN) reinforcement learning agent with user clustering to provide real-time energy saving recommendations and device control.
The system consists of:
- A Flask backend exposing a REST API, managing the DQN agent, clustering, and MQTT communication.
- A React Native frontend (Expo) for mobile control and visualisation.
- Optional integration with Home Assistant via MQTT discovery.
---
## Key Features
| Feature | Description |
|---------|-------------|
| User authentication | Registration, login, password reset |
| Dashboard | Overview of rooms, devices, weather, active devices, and savings |
| Room control | Turn devices on/off, adjust intensity (brightness, temperature) |
| AI recommendations | DQN agent suggests actions (turn off, reduce) based on state and user preferences |
| Energy analytics | Compare Normal vs Eco consumption, view history per day/week/month |
| User preferences | Set preferred temperature and brightness per room; parent preferences override child preferences |
| Multilingual | French and English (i18n) |
| MQTT bridge | Bidirectional communication with Home Assistant |
| User clustering | Classifies users as Economical, Normal, or Energy-intensive based on behaviour |
---
## Technology Stack
### Backend
- Python 3.9+
- Flask + Flask-CORS
- SQLite
- PyTorch (DQN)
- Scikit-learn (K-Means clustering)
- Paho-MQTT
- Requests (OpenWeatherMap API)
### Frontend
- React Native + Expo
- React Navigation (Stack + Bottom Tabs)
- i18n-js
- Expo Vector Icons
### IoT Integration
- Home Assistant (via MQTT auto-discovery)
- Mosquitto MQTT broker
---
## Project Structure
```
smart-home-app/
├── backend/
│ ├── app.py # Main Flask application
│ ├── dqn_agent.py # DQN agent implementation
│ ├── clustering.py …