Skip to Content

Open Source Home Automation & AI Infrastructure

March 10, 2026 by
Open Source Home Automation & AI Infrastructure
Federico Solutions, Myrko Federico

Open Source Home Automation & AI Infrastructure

Field: IT Infrastructure / Home Automation / Artificial Intelligence

Period: 2025 (current deployment)

Status: In production — daily personal use

Location: Playa del Carmen, Mexico

Background

In 2025, I designed and deployed a complete, 100% open source home automation and AI infrastructure for my home in Mexico. The goal: total autonomy, zero cloud dependency, absolute privacy, and intelligent control of the entire home environment.

This stack also serves as an R&D lab for my commercial developments (the professional home automation packs I offer to clients).

Problem

Technical challenges:

  • Build a local home automation infrastructure (no Google/Amazon/Apple cloud)
  • Integrate conversational AI for smart voice control
  • Manage 30+ IoT devices (lights, plugs, air conditioners, sensors, front door)
  • Electrical monitoring: current sensors in the electrical panel to analyze consumption
  • Network isolation: separate IoT, home LAN and servers
  • Performance: voice recognition <2s, real-time automations
  • Reliability: infrastructure running 24/7 with no intervention

Privacy challenges:

  • Zero personal data in the cloud (no Google/Amazon surveillance)
  • Local voice recognition (no external servers)
  • Home automation data stays at home

Solution

Infrastructure Architecture

Hardware:

  • Main server: 1 physical PC running Ubuntu 24.04 LTS (12-core AMD Ryzen)
  • Network: BPI-R4 OpenWrt router with VLANs (isolated IoT)
  • Electrical monitoring: current sensors in the electrical panel
  • Bluetooth Proxy: ESP32 (Squeezbox server for multi-room audio)
  • Storage: 1TB NVMe

Software stack (all open source):

1. Home Assistant OS (KVM VM)

  • Complete home automation orchestration
  • 30+ devices integrated (Tuya/Zigbee/Z-Wave)
  • Controlled equipment:

    • Air conditioners (4 units)
    • Lights (15+ points)
    • Front door (smart lock)
    • Smart plugs
  • Energy monitoring: current sensors in the electrical panel (real-time consumption analysis)
  • Complex automations (multi-level conditions, multiple triggers)
  • Unified web/mobile dashboard
  • Local voice recognition: Whisper (STT) + Piper (TTS)
  • Offline operation: automations keep running without internet

2. AdGuard Home (Docker)

  • DNS blocking: ads, trackers and malware blocked network-wide
  • Privacy: no external tracking
  • Performance: fast local DNS resolution
  • Automatic filtering of 100,000+ malicious domains

3. AnythingLLM (Docker)

  • Conversational AI interface
  • RAG (Retrieval-Augmented Generation) on local documents
  • OpenAI API integration for complex reasoning
  • Contextual memory: the assistant remembers our conversations

4. ESP32 Squeezbox Server (BT Proxy)

  • Multi-room audio server
  • Bluetooth proxy to integrate BT devices into Home Assistant
  • Synchronized audio streaming

5. Isolated network (OpenWrt BPI-R4)

  • 3 VLANs: home LAN (192.168.1.0/24), IoT (192.168.10.0/24), Servers
  • WireGuard VPN: secure remote access
  • QoS: traffic prioritization (streaming never stutters)
  • Smart firewall: IoT fully isolated from the rest of the network

Technical Workflow

Smart voice recognition

Example interaction:

Me: "It's hot"

Assistant:

  • Turns on the living room AC (24°C)
  • Closes the front door (if open)
  • Turns off unnecessary lights (energy saving)
  • Starts a "chill" playlist on Squeezbox

Tech stack:

  1. Whisper (local STT): captures my voice → text (~800ms)
  2. ChatGPT API (reasoning): analyzes intent + context (~1-2s)
  3. Home Assistant: runs the automations (AC, door, lights, audio)
  4. Piper (local TTS): replies by voice (~400ms)

Total: ~2-3 seconds from voice command to execution.

Advanced home automations

Real-world examples:

Scenario 1: Smart electrical monitoring

  • Current sensors in the electrical panel
  • IF consumption >80% of panel capacity THEN:

    • Mobile notification "High electrical load"
    • Automatically cuts non-priority devices
    • Historical consumption log per circuit

Scenario 2: Adaptive thermal comfort

  • IF indoor temperature >28°C AND nobody home THEN:

    • Turns on AC in eco mode (26°C)
    • Turns off lights automatically
  • IF return home detected (front door opened) THEN:

    • AC switches to comfort mode (24°C)
    • Turns on entrance lights

Scenario 3: Security & savings

  • IF front door open >5 min AND person detected outside THEN:

    • Mobile notification "Door open unusually long"
    • Turns off AC (avoids waste)
  • IF door closed THEN:

    • Restores AC to its last mode

PCIe Passthrough — Dedicated VM NIC

Technical challenge: Home Assistant needs direct access to the IoT network (VLAN 10) without going through the Ubuntu host.

Solution: PCIe passthrough of a physical network card (NIC2) directly into the Home Assistant VM.

Implementation:

  • Enabling IOMMU (kernel)
  • Binding NIC2 to the VFIO-PCI driver
  • KVM VM with NIC2 in direct passthrough
  • Result: the VM has direct hardware access = minimal network latency + perfect isolation

Results

Deployed infrastructure:

  • Ubuntu 24.04 LTS server (12-core AMD)
  • Home Assistant OS in a KVM VM (4GB RAM, 4 vCPUs)
  • AdGuard Home + AnythingLLM in Docker
  • ESP32 Squeezbox Server (BT Proxy + Audio)
  • OpenWrt router with VLANs + VPN
  • 30+ IoT devices controlled
  • Real-time electrical monitoring (current sensors in the panel)

Active features:

  • Local voice recognition <2s
  • Air conditioning control (4 units)
  • Lighting control (15+ points)
  • Front door control (smart lock)
  • Electrical consumption monitoring per circuit
  • Multi-room audio (Squeezbox)
  • Complex multi-condition automations
  • Network-wide ad/tracker blocking
  • Secure remote access (WireGuard VPN)
  • Unified home automation dashboard
  • Conversational artificial intelligence

Personal impact:

  • Total autonomy: zero dependency on Google/Amazon/Apple
  • Absolute privacy: my data stays at home
  • Everyday comfort: a home that anticipates my needs
  • Savings: energy optimization (consumption monitoring + smart automations)
  • Reliability: works offline, never a cloud outage

R&D benefit:

  • Living lab: I test before offering it to clients
  • Field validation: the stack runs 24/7 with no intervention
  • Commercial foundation: reusable architecture for client packs (Pack 1, 2A, 2B)

What this project demonstrates

  • Ability to design a complete IT infrastructure (network, servers, virtualization, security)
  • Mastery of advanced open source technologies (KVM, PCIe passthrough, Docker, OpenWrt)
  • Systems approach: integrated network + home automation + AI + energy monitoring + security
  • Privacy-first: everything local, no cloud dependency
  • Applied R&D: a personal lab that becomes a commercial offering

Complete Tech Stack

OS & Virtualization:

  • Ubuntu Server 24.04 LTS (host)
  • KVM/QEMU (hypervisor)
  • Home Assistant OS (VM)

Home automation:

  • Home Assistant Core 2024+
  • Integrations: Tuya, Zigbee, Z-Wave
  • Controls: air conditioners, lights, front door, plugs
  • Monitoring: electrical current sensors (panel)
  • Automations: advanced conditional logic

AI & Voice:

  • Whisper (local STT, OpenAI model)
  • Piper (local TTS)
  • ChatGPT API (external reasoning)
  • AnythingLLM (local RAG)

Audio & Bluetooth:

  • ESP32 Squeezbox Server
  • Bluetooth Proxy (BT device integration)
  • Multi-room audio

Network & Security:

  • OpenWrt (BPI-R4 router)
  • VLANs (3 isolated zones)
  • AdGuard Home (DNS blocking)
  • WireGuard VPN
  • Firewall + QoS

Containers:

  • Docker Engine + Docker Compose
  • AdGuard Home container
  • AnythingLLM container

Hardware:

  • 12-core AMD Ryzen
  • 64GB RAM
  • 1TB NVMe
  • 2x Gigabit NICs (1 host, 1 passthrough)
  • Current sensors (electrical panel)
  • ESP32 (BT Proxy + Squeezbox)

Photos/Visuals


Planning a home automation project?

Home, rental or office: I design and install reliable home automation systems, controlled locally, with no cloud subscription.

Free discovery callContact me

Tags: lab, home automation, home assistant, open source, privacy, AI, infrastructure, KVM, docker, OpenWrt, ESP32, energy monitoring, Mexico, 2025

Complete renovation and home automation of a mobile home