Skip to content

Repository files navigation

SmartHome Server

Language: English | 简体中文

A thesis-grade smart home IoT platform for simulating and benchmarking sensor/actuator traffic over MQTT with mTLS support. Designed for Home Assistant integration, security research, and scalability testing.

Academic Project: This repository accompanies the bachelor thesis "Application of Servers and Unix-like Systems for Sensor Control in Smart Homes" at Czech Technical University in Prague, Faculty of Electrical Engineering.

SmartHome IoT Platform Architecture

SmartHome Server Architecture — Mutual-TLS MQTT transport, dual broker topology, simulated device fleets, and Home Assistant control plane

Thesis

Resource Link
Read Online Read PDF
Download Release Latest Release
Supervisor Report supervisor_report.pdf
Opponent Report opponent_report_Koller.pdf
Defense Record Prubeh-obhajoby.pdf
Official Archive CTU Digital Library (DSpace)

Repository Structure

SmartHome_Server/
├── sensors/                # Python MQTT simulator package
│   └── smarthome_sim/      # Core library
├── broker/                 # MQTT broker configurations
│   ├── emqx/               # EMQX Docker with mTLS
│   └── mosquitto/          # Mosquitto Docker alternative
├── homeassistant/          # Home Assistant reference
├── esphome/                # ESP32/ESP32-S3 firmware configurations
├── certs/                  # TLS/mTLS certificate generation scripts
├── docs/                   # Documentation & Thesis
│   ├── BT/                 # Bachelor Thesis (LaTeX source, reviews, figures)
│   ├── pdf2md/             # Datasheet to Markdown converter tools
│   ├── thesis_doc/         # Thesis drafts and notes (Legacy)
└── ...

Quick Start

1. Clone and Setup

git clone https://github.com/yuanweize/SmartHome_Server.git
cd SmartHome_Server
python3 -m venv .venv && source .venv/bin/activate
pip install -r sensors/requirements.txt

2. Configure and Run Simulator

cp sensors/brokers.example.yml sensors/brokers.yml
# Edit brokers.yml with your MQTT broker details

# Dry-run (no broker required)
python sensors/sensor_simulator.py --dry-run

# With Home Assistant discovery
python sensors/sensor_simulator.py --ha-discovery

3. Deploy MQTT Broker (Optional)

cd broker/emqx && docker compose up -d

Features

Component Description
smarthome_sim Multi-broker MQTT simulator with entity models (drift, sine, motion)
mTLS Security ECDSA P-256 certificates for mutual authentication
HA Integration Auto-discovery of sensors, switches, and lights
Benchmarking TLS handshake latency measurement with statistical analysis
Scalability Multi-process workers for thousands of simulated devices
Home Assistant Live Sensor Dashboard

Home Assistant unified dashboard visualizing real-time simulated & edge telemetry (temperature, humidity, radar fall detection, switches)

Edge Computing Real-Time Fall Detection

End-to-end fall detection validation — ESP32-S3 sensor fusion (IMU + gyroscope threshold), Node-RED automation pipeline, and iOS critical alert push notification

ESP32 Sensor Interface Circuit

ESP32 environment node — TCS34725 color sensor (I2C), MQ-2 gas detector (ADC), SR602 PIR motion, and RGB LED actuation wiring

ESP32-S3 Edge Computing Node Wiring

ESP32-S3 edge computing node — MPU-6050 6-axis IMU and BMP280 (shared I2C bus GPIO 4/5), KY-037 acoustic ADC (GPIO 6) wiring

Documentation

Directory Description
sensors/README.md Simulator usage and configuration
certs/README.md Certificate generation guide
homeassistant/README.md Home Assistant setup
docs/BT/CTU_FEL_THESIS/README.md Thesis LaTeX source

Requirements

  • Python 3.8+
  • Docker & Docker Compose (for broker/HA deployment)
  • OpenSSL (for certificate generation)

License

This project is licensed under the MIT License.

Citation

If you use this project in academic work, please cite:

@thesis{yuan2026smarthome,
    author  = {Yuan, Weize},
    title   = {Application of Servers and Unix-like Systems for Sensor Control in Smart Homes},
    school  = {Czech Technical University in Prague, Faculty of Electrical Engineering},
    year    = {2026},
    url     = {https://hdl.handle.net/10467/178631}
}

Permanent Link: https://hdl.handle.net/10467/178631

Acknowledgments

This project was developed under the supervision of prof. Ing. Miroslav Husák, CSc. at the Department of Microelectronics, CTU FEL.

Author

Weize Yuan
Electrical Engineering and Computer Science (EECS)
Czech Technical University in Prague, Faculty of Electrical Engineering

GitHub

About

Smart Home Sensor Control and Automation using MQTT, Home Assistant, and Unix-like Servers (such as Debian). Includes Mosquitto and EMQX broker setup files, and prototype automation scripts.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Sponsor this project

Packages

Used by

Contributors

Languages