A self-hosted IoT home automation platform built around ESP32 devices, MQTT, Kubernetes microservices, a React dashboard, and an Android app.
The fastest way to understand or run home-anthill is through the documentation repository:
| Need | Start with |
|---|---|
| Run the platform locally | Local development setup |
| Flash and wire ESP32 devices | Firmware install guide |
| Download the main project workspace | download-full-project.sh |
| Seed a local development database | fill-local-db.sh |
| Understand service flows visually | Architecture diagrams |
| Try the HTTP APIs | Bruno API collections |
Use the full-project helper when you want the main service, app, firmware, and infrastructure repositories in one local workspace:
curl -fsSLO https://raw.githubusercontent.com/home-anthill/docs/master/download-full-project.sh
sh download-full-project.sh
cd home-anthillThen follow Local development setup to start MongoDB, Redis, RabbitMQ, Mosquitto, and the services you need.
After api-server and admission are running, seed sample homes, rooms, devices, and assignments with:
curl -fsSLO https://raw.githubusercontent.com/home-anthill/docs/master/fill-local-db.sh
chmod +x fill-local-db.sh
./fill-local-db.sh "<JWT_VALUE>" "oauth_session=<COOKIE_VALUE>"fill-local-db.sh defaults to API_SERVER=http://localhost:8082 and ADMISSION_SERVER=http://localhost:8099; override those environment variables if your local services use different addresses.
home-anthill is a full-stack home automation project for collecting sensor data, controlling devices, tracking device presence, and sending mobile notifications.
The system starts at the edge: ESP32 microcontrollers run environmental sensor nodes, infrared air-conditioner controllers, or an offline-first thermostat. They communicate over MQTT with a backend that validates, routes, stores, and exposes device state through APIs. Users interact with the platform through a web dashboard and an Android app backed by GitHub OAuth2 authentication.
The project is intentionally split into focused repositories. Each service owns a small part of the system, while the docs and deployer repositories explain how to run everything together locally or on Kubernetes.
- Register homes, rooms, devices, profiles, and sensors.
- Collect temperature, humidity, motion, light, air pressure, and air quality readings from ESP32 devices.
- Control supported devices, including infrared air conditioners and thermostat-style controllers.
- Run an offline-first heating or cooling thermostat with persisted setpoint and tolerance settings, hysteresis control, and dedicated heat, cold, fan, and pump outputs.
- Bench-test the thermostat without a physical thermocouple by using a second ESP32-S3 as an MCP9600 I2C simulator.
- Track whether devices are online by consuming signed MQTT presence messages.
- Store sensor history in MongoDB and online state in Redis.
- Send Firebase Cloud Messaging notifications when monitored devices go offline.
- Provide REST and gRPC APIs for web, mobile, and service-to-service workflows.
- Run locally with Docker-based infrastructure or in production on a K3s Kubernetes cluster.
Device and service messages are designed around signed payloads rather than trusted plaintext messages:
- MQTT sensor and presence messages include signed payloads with timestamp, nonce, and HMAC validation.
producerforwards MQTT messages into RabbitMQ, andconsumerverifies RabbitMQ message HMACs before applying side effects.consumerandalarm-receiveruse RedisSET NX EXreplay keys to reject reused signed nonces.- Public user-facing APIs use GitHub OAuth2 and JWT-backed sessions.
- Profile device API tokens are stored hashed and encrypted in MongoDB, not as plaintext token fields.
Production deployments terminate public TLS at the Kubernetes ingress layer. Internal service traffic is expected to run inside the cluster network.
The firmwares repository contains independently buildable ESP32 projects:
| Project | Purpose |
|---|---|
dht-light |
Publish DHT22 temperature and humidity readings plus Grove digital light measurements. |
airquality-pir |
Publish Grove air-quality readings and PIR motion events. |
barometer |
Publish atmospheric-pressure readings from a XENSIV sensor. |
ac-beko |
Receive signed MQTT commands and control a Beko air conditioner over COOLIX infrared. |
ac-lg |
Receive signed MQTT commands and control an LG air conditioner over LG infrared. |
thermostat |
Run offline-first heating or cooling control from an MCP9600 thermocouple, with hysteresis, persisted configuration, safe output initialization, and MQTT integration. |
thermostat-mcp9600-simulator |
Emulate an MCP9600 over I2C on a second ESP32-S3 for thermostat bench testing. |
Supported controller work includes Beko RG52A9/BGEF and LG AKB74955603 style IR remotes, with firmware integration built on crankyoldgit/IRremoteESP8266.
The device projects use Arduino CLI and include host-side CMake/GoogleTest suites. The MCP9600 simulator is a standalone ESP-IDF project.
| Repository | Language | Role |
|---|---|---|
| api-server | Go | Central REST API for homes, rooms, devices, profiles, auth, and web/mobile workflows. |
| api-devices | Go | gRPC service for device registration and MQTT value publishing. |
| admission | Go | REST and gRPC gateway for admitting/registering devices and sensors. |
| register | Rust | Sensor registration and sensor data retrieval backed by MongoDB. |
| producer | Rust | MQTT-to-RabbitMQ bridge for sensor/event ingestion. |
| consumer | Rust | RabbitMQ consumer that verifies and persists sensor messages into MongoDB. |
| alarm-api | Rust | REST API for device online state, Redis-backed presence, and FCM token management. |
| alarm-receiver | Rust | MQTT-to-Redis service that records signed device presence updates. |
| alarm-notifier | Rust | Offline-device monitor that sends Firebase Cloud Messaging notifications. |
| gui | TypeScript / React | Web dashboard for homes, rooms, devices, sensors, and account workflows. |
| app | Kotlin / Android | Android app with GitHub OAuth2, device management, and push notifications. |
| firmwares | C++ / Arduino / ESP-IDF | ESP32 sensor nodes, infrared AC controllers, an offline-first thermostat, and an MCP9600 simulator. |
| Repository | Purpose |
|---|---|
| docs | Architecture diagrams, local setup guides, deployment docs, firmware install docs, and API collections. |
| deployer | Helm chart for deploying the full platform to Kubernetes. |
| mosquitto | Mosquitto MQTT broker image with a dynamic auth entrypoint. |
| sharded-mongodb-compose | Docker Compose setup for the local sharded MongoDB cluster used by development and tests. |
| k8s-config-reloader | Kubernetes sidecar that watches mounted ConfigMaps/Secrets and signals another process on change. |
| esp32-configurator | Python CLI that generates ESP32 C header configuration from YAML. |
| mqtt-communication-checker | Local end-to-end CLI that preflights the stack, publishes signed sensor, presence, and controller messages, and verifies MongoDB/Redis effects. |
- An ESP32 publishes signed MQTT sensor or presence data to Mosquitto.
producerreceives sensor messages and writes them to RabbitMQ.consumerverifies message integrity and replay state, then stores sensor values in MongoDB.alarm-receiverreceives presence messages, verifies them, and updates Redis.onlineexposes online state and FCM token APIs.alarm-notifierchecks Redis for offline devices and sends mobile notifications.api-server,api-devices, andadmissionmanage user-facing device, home, room, profile, and registration workflows.guiandappgive users web and mobile access to the same backend.
The thermostat keeps its heating or cooling control loop on the ESP32, so local temperature control continues without backend connectivity; MQTT connects it to registration, telemetry, and remote configuration workflows.
| Guide | Description |
|---|---|
| Local development setup | Run the supporting infrastructure and services on a development machine. |
| Architecture diagrams | Visual diagrams for registration, control, sensor ingestion, notifications, and the overall platform. |
| Firmware install | Wire hardware, configure Arduino tooling, and flash ESP32 firmware. |
| Hetzner / K8s deployment | Deploy the platform to a K3s cluster with ingress, TLS, and supporting infrastructure. |
| Bruno API collections | Ready-to-run API requests for local and deployed environments. |
For a full local checkout, see docs/download-full-project.sh, which clones the main service, app, firmware, and infrastructure repositories into one workspace.
| Layer | Technologies |
|---|---|
| Edge devices | ESP32, Arduino C++, ESP-IDF, MQTT, infrared control, I2C |
| Backend services | Go, Rust, REST, gRPC, Protobuf |
| Web and mobile | React, Mantine, Redux Toolkit, Android, Kotlin, Jetpack Compose |
| Messaging | Mosquitto MQTT, RabbitMQ |
| Data stores | MongoDB, Redis |
| Infrastructure | Docker, Helm, Kubernetes/K3s, NGINX Gateway Fabric, Cilium, cert-manager |
Most repositories include their own README and service-specific development guidance. In general:
- Go and Rust services use
make buildandmake testwhere available. - The React dashboard uses npm, Vite, Nx, Vitest, React Testing Library, and MSW.
- Android builds use Gradle and Jetpack Compose.
- Firmware device builds use
arduino-cliand generated configuration headers; host tests use CMake/GoogleTest, and the MCP9600 simulator uses ESP-IDF. - Local integration testing depends on MongoDB, Redis, RabbitMQ, and Mosquitto running with the documented local settings.
The current roadmap is tracked in the public home-anthill project board. Use the board as the source of truth for planned work, active items, completed work, and priority changes across repositories.
| Item | Repository |
|---|---|
| add gas CH4 sensor | home-anthill/firmwares |
| Item | Repository |
|---|---|
| support real time notifications also from 'motion' sensors | Draft item |
| add sharing home options to invite other users to use your home | Draft item |
| find better names for all repos/services | Draft item |
| improve accessibility of web app and android app | Draft item |