Welcome Home Pipeline

Last updated: April 11, 2026

Welcome Home Pipeline

The "Welcome Home" pipeline is a premier example of the dLANDiscord end-to-end integration, linking physical network events to proactive AI-driven hospitality.

End-to-End Workflow

  1. Network Detection: The unifi package polls the local Ubiquiti controller every 60 seconds. It detects an authorized MAC address (e.g., Dan's iPhone) joining the Wi-Fi.
  2. State Transition: The unifi module identifies a transition from "Away" to "Home" and triggers a 4-minute debounce to prevent flapping.
  3. Wakeup Signal: The system sends a POST request to the local Wakeup API (:7142/api/wakeup).
  4. Agent Activation: The wakeup.go router identifies the user and "wakes up" their preferred agent (e.g., Nikki).
  5. Contextual Briefing: Nikki performs a "While You Were Away" audit:
    • Checks for missed NOC alerts.
    • Summarizes new emails from aiemail.
    • Reviews upcoming calendar events from gcal.
  6. Physical Action: Part of Nikki's routine may involve invoking the dgovee tool to turn on the office or hallway lights.
  7. Notification: The final welcome message and briefing are delivered via the user's preferred channel (WhatsApp or Smart Speaker).

Sequence Diagram: Welcome Home Flow

sequenceDiagram
    participant U as UniFi Controller
    participant UP as unifi.go (Poller)
    participant W as wakeup.go (API)
    participant N as Nikki (Agent)
    participant G as dgovee (IoT)
    participant WA as WhatsApp (User)

    UP->>U: Poll active clients
    U-->>UP: MAC: AA:BB:CC detected
    Note over UP: State Transition: Away -> Home
    UP->>W: POST /api/wakeup {user: "dan"}
    W->>N: Wakeup Session
    N->>N: Audit NOC & gcal
    N->>G: turn_on_lights("office")
    G-->>N: Success
    N->>WA: "Welcome home, Master Dan. You missed 2 alerts..."

Historical Context

Introduced in Git commit 4da7e9ab, this pipeline was enhanced with "Arrival Enrichment," allowing agents to provide much deeper summaries than a simple "Hello" by looking back at the system logs generated during the user's absence.

Guidance for AI Agents

  • Prioritize Urgent News: If a critical server went down while the user was away, put that at the top of your welcome briefing.
  • IoT Feedback: If you turned on the lights as part of the routine, mention it briefly (e.g., "I've lit the hallway for you").

Cross-References