Voice-Controlled Smart Light

Voice AI, MCP, IoT, ESP8266

Overview

An AI Voice Agent that controls physical smart lights through natural language — speak to the agent, it sends commands to an ESP8266, and the light responds in real-time.

The Challenge

Most voice-controlled lights require exact phrases like "Set brightness to 50%." I wanted something that understands intent: say "I'm about to sleep" and it dims to warm red.

How It Works

  1. Speak naturally — "Make it warm and cozy" or "Pulse blue slowly"
  2. AI interprets intent — Voice agent understands context
  3. MCP Tool execution — Commands flow through Model Context Protocol
  4. ESP8266 responds — Light changes color, brightness, or effects
  5. Real-time feedback — Sub-second response

Example Commands

What you sayWhat happens
"I'm about to sleep"Dims to warm red
"Party mode"Starts color cycling
"I'm reading"Bright, cool white
"Sunrise in 10 minutes"Gradual warm fade-in

Technical Stack

LayerTechnologies
FrameworkNext.js 15 · React 19 · TypeScript 5.8
StylingTailwindCSS 4 · Dark mode (class strategy)
StateZustand 5 · TanStack React Query
Agora SDKsagora-rtc-sdk-ng · agora-rtm-sdk v2
AIConversational AI · LLM (OpenAI/Anthropic/Gemini) · TTS · ASR — multimodal LLM required for camera verification
IoTESP8266 + Arduino firmware in arduino_code/ · Python MCP server (run separately)

Repo

View on GitHub

What I Learned

The magic is in the latency. Voice control at 2 seconds feels like giving orders. At 200ms it feels like thinking out loud.