Skip to content

EUR-UN/SmartHome_Server

 
 

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.

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/                   # Thesis documentation (LaTeX)

Quick Start

1. Clone and Setup

git clone https://github.com/IYUANWEIZE/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

Documentation

Directory Description
sensors/README.md Simulator usage and configuration
certs/README.md Certificate generation guide
homeassistant/README.md Home Assistant setup
docs/README.md Thesis LaTeX source
Declaration.pdf Academic thesis declaration

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},
    type    = {Bachelor's Thesis}
}

Acknowledgments

This project was developed under the supervision of Prof. Miroslav Husák 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

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Python 99.6%
  • Dockerfile 0.4%