Skip to content

Architecture

Stephan Zehrer edited this page May 26, 2026 · 2 revisions

Architecture

System Diagram

Internet / Nostr Relays
        │
        │  (Nostr protocol — mChatCore is the shared communication backbone)
        │
┌───────▼────────────────────────────────────────────┐
│                  Home Network  (local)              │
│                                                    │
│  ┌─────────────────────────────────────────────┐   │
│  │            HomeNode Server                  │   │
│  │                                             │   │
│  │  ┌───────────────────┐  ┌────────────────┐  │   │
│  │  │  Home Automation  │  │  HomeNode      │  │   │
│  │  │  IoT / Matter /   │◄─►  Agent         │  │   │
│  │  │  MQTT / Thread    │  │  (Local LLM)   │  │   │
│  │  └───────────────────┘  └───────┬────────┘  │   │
│  └──────────────────────────────── │ ───────────┘   │
│                                    │               │
└────────────────────────────────────│───────────────┘
                                     │  Nostr (mChatCore)
                         ┌───────────▼───────────────┐
                         │      mChat group chat      │
                         │                           │
                         │  👤  User A               │
                         │  👤  User B               │
                         │  🤖  HomeNode Agent bot   │
                         └──────────────┬────────────┘
                                        │
                         ┌──────────────▼────────────┐
                         │     mHomeNode  (iOS)       │
                         │  device control · dashboard│
                         └───────────────────────────┘

How the Components Interact

mChatCore as the Universal Message Bus

mChatCore is not just the engine for the chat app — it is the shared communication layer for the entire ecosystem. Every component that needs to exchange messages uses the Nostr protocol via mChatCore:

  • Users communicate through mChat (iOS) over Nostr relays
  • HomeNode Agent holds its own Nostr keypair and participates in group chats as a bot
  • Notifications from home automation events (doorbell, appliance done, alerts) are published by the Agent as Nostr DMs or group messages

Local-First Design

The HomeNode Server runs entirely on your local network. The LLM Agent processes all intelligence locally — no queries leave your home. Nostr relays are used only for message routing, and messages are end-to-end encrypted (NIP-04 / NIP-17).

Typical Event Flow

Doorbell rings →

  1. HomeNode Server detects doorbell event (via MQTT / Matter)
  2. HomeNode Agent receives the event
  3. Agent publishes a message to the mChat group as the bot identity
  4. All group members receive the notification on their iPhones via mChat

User asks the bot →

  1. User sends a message in the mChat group: "Turn off the living room lights"
  2. HomeNode Agent receives the message via its Nostr subscription
  3. Agent interprets the command (LLM) and triggers the action on HomeNode Server
  4. Agent confirms back in the group: "Done — living room lights off"

Matter Roles

The HomeNode ecosystem maps clearly onto the three Matter roles:

Role Who
Commissioner mHomeNode (iOS) — onboards new devices via QR / NFC
Controller HomeNode Server — always-on automations; co-exists with Apple Home / Google Home
Bridge HomeNode Server — exposes non-Matter devices (MQTT, Zigbee, Shelly…) to the fabric
mHomeNode (iOS)
    │  Commissioner — adds devices to the fabric
    ▼
Matter Fabric
    ├── HomeNode Server (Controller + Bridge)
    ├── Apple Home hub  (Controller, optional)
    └── Google Home     (Controller, optional)
         │
         └──► Matter Devices + Bridged non-Matter Devices

Repository Map

Repository Role
zehrer/HomeNode HomeNode Server + sub-projects
zehrer/mHomeNode iOS companion app
zehrer/mChat mChat iOS app + mChatCore library
zehrer/HomeNodeAI HomeNode Agent (local LLM integration)
zehrer/HomeNodeServer HomeNode Server runtime

Clone this wiki locally