How maxherax/smart-home-thesis works
This repository is a smart-home thesis project that develops zone and activity prediction models and connects predictions to Home Assistant through MQTT. The live workflow accepts event sequences at the FastAPI service, prepares features, runs the relevant model, and publishes the prediction; Home Assistant automations can react to those messages. Separate paths support replaying test windows or manually sending demo predictions. Notebooks, datasets, model artifacts, and chart scripts support model development and evaluation. The README is minimal, and source evidence is limited, so uncertain preprocessing, training, and Home Assistant wiring is not expanded.
Main entry points: data Datasets · app.py Prediction API · mosquitto.conf MQTT Broker · lstm_model_v4.keras Zone LSTM
Components 23
Data and Models
- Data Preparation
maksim/preprocessing - Preprocessing Notebook
maksim/02_preprocessing.ipynb - Model Experiments
maksim/notebooks - Device Models
maksim/notebooks/11_devices_model.ipynb - Datasets
data - Zone LSTM
models/lstm_model_v4.keras - Activity Model
models/activity_model.keras
Prediction Runtime
- Prediction API
shared/api/app.py - Zone Features
shared/api/app.py - Activity Features
shared/api/app.py - Zone Encoder
shared/api/app.py - Live Simulator
simulator_live.py - Manual Publisher
send_prediction.py
MQTT Integration
- MQTT Broker
shared/api/mosquitto.conf
Home Assistant
- Home Assistant
andrey/home-assistant/configuration.yaml - Automations
andrey/home-assistant/automations.yaml - Dashboard
andrey/home-assistant/dashboard.yaml
Model Evaluation
- Model Evaluation
run_activity_v2.py - Zone Charts
final_charts.py - Activity Charts
activity_charts.py
Other components
- Researcher
- Event Client
- Demo Operator
Connections 29
- Researcher → Preprocessing Notebook: explores data
- Datasets → Preprocessing Notebook: reads events
- Preprocessing Notebook → Data Preparation: develops preparation
- Datasets → Model Experiments: provides data
- Model Experiments → Zone LSTM: develops model
- Device Models → Activity Model: develops model
- Event Client → Prediction API: sends events
- Prediction API → Zone Features: prepares zone input
- Prediction API → Activity Features: prepares activity input
- Prediction API → Zone Encoder: encodes sensors
- Zone Features → Zone LSTM: predicts zone
- Activity Features → Activity Model: predicts activity
- Prediction API → MQTT Broker: publishes predictions
- Live Simulator → Zone LSTM: predicts zone
- Live Simulator → MQTT Broker: publishes replay
- Demo Operator → Manual Publisher: chooses prediction
- Manual Publisher → MQTT Broker: publishes demo
- MQTT Broker → Home Assistant: delivers messages
- Home Assistant → Automations: dispatches automations
- Home Assistant → Dashboard: serves dashboard
- Researcher → Model Evaluation: checks activity model
- Datasets → Model Evaluation: supplies test data
- Model Evaluation → Activity Model: evaluates
- Researcher → Zone Charts: generates reports
- Datasets → Zone Charts: supplies test data
- Zone Charts → Zone LSTM: evaluates
- Researcher → Activity Charts: generates reports
- Datasets → Activity Charts: supplies test data
- Activity Charts → Activity Model: evaluates