Contents

Xiaozhi Controls Mi Home Devices - ESP32 Smart Home Control System

ESP32-based smart home control system that allows AI models to directly control your Mi speakers and smart devices!

📖 Project Documentation

Complete Technical Documentation & Firmware Download: https://bxk64web49.feishu.cn/docx/XAVJdha5FoI5bjxKELqcz3rJnwg

🚀 Implementation Solution

Hello everyone! Today I bring you a super cool way to play! Let the AI model ‘Xiaozhi’ directly control your Mi speakers and smart devices!

🎯 Core Features

  • Deep Integration: Not just simple conversation, but deep integrated control
  • MCP Plugin: Encapsulates Mi speaker’s voice broadcast and device control as MCP server
  • Smart Interaction: AI model learns to directly call hardware interfaces

/mcp/image.png

🔧 Technical Implementation

MCP (Model Context Protocol) Simply put, it’s like installing a ’new skill card’ for the AI model ‘Xiaozhi’. I registered the two ‘skills’ of Mi speaker (voice broadcast, device control) as plugins. When Xiaozhi chats with you, once it determines that these skills are needed, it will automatically call the corresponding interfaces!

To implement this MCP, the main work completed includes:

  1. Deep Integration with Mi Home Platform: Enable the MCP server on ESP32 to stably control Mi Home devices and call Mi TTS
  2. Build MCP Plugin Interface: Define standard ways for Xiaozhi to understand and call
  3. ESP32 Firmware Development: Run all this on this cost-effective microcontroller

What does this mean? You have an AI-driven smart home control hub! Xiaozhi’s understanding and decision-making capabilities directly act on your physical world!

🎬 Demo Effects

Talk is cheap, let’s see the actual effects:

Device Query Demo

  • Command: “Hello Xiaozhi, what devices are online at home?”
    • Result: Xiaozhi’s chat interface displays query results, for example: ‘Detected living room lamp and bedroom air conditioner online.’

Device Control Demo

  • Command: “Help me turn on the living room lamp, brighter and warmer.”
    • Result: Living room lamp lights up, adjusted to brighter, warm light state

Voice Broadcast Demo

  • Command: “Let Mi speaker say: ‘Hello everyone, this is Yang Yang Programming channel, long time no see!’”
    • Result: Mi speaker clearly broadcasts: ‘Hello everyone, this is Yang Yang Programming channel, long time no see!’

See that? One sentence, Xiaozhi understands the intention, calls MCP plugin, ESP32 executes, device responds! This is true smart interaction!

📦 Firmware Download

📋 Supported Device List

Mi Speaker Models:

07G, 16B, L04M, L05B, L05C, L05G, L06A, L09A, L09B, L15A, L16A, L17A, L7A, LX01, LX04, LX05, LX06, LX5A, M03A, OH2, OH2P, S12, X08A, X08C, X08E, X10A, X4B, X6A, X8F, X8S

ESP32 Hardware Support:

  1. ESP32-S3-R16N8 (Verified)

    /mcp/image-1.png

  2. ESP32 Flash >4MB (Online upgrade function unavailable)

📱 Firmware Version

Current Version: v1.0.13
Update Time: June 8, 2025

/mcp/image-2.png

📱 Android Version Xiaozhi

If you don’t have an ESP32 Xiaozhi device, you can also use the Android version of Xiaozhi, which works well too.

Tap the screen a few times, and the settings page will pop up. Fill in the ws address and mac address. This address should be the same as the ESP32 device mac address found on Xiaozhi official website https://xiaoni.me.

/mcp/image-3.png

🔧 Firmware Flashing Tutorial

ESP32-S3 Flashing Tutorial: Please refer to related documentation for detailed flashing steps https://bxk64web49.feishu.cn/docx/GFktdztS8o5tztxsHpKcmjzrnAc

📱 WeChat Mini Program Client

Search “Feiyang Smart Control” on WeChat

Add Device

Create a “Feiyang Gateway” device in the “Feiyang Smart Control” mini program to get the device key for ESP32 network configuration.

/mcp/image-4.png

Bind Xiaozhi

Operation steps:

  1. Open “Smart Configuration”
  2. Bind Xiaozhi speaker
  3. Enter MCP endpoint key (https://ziaozhi.me)
  4. Submit binding

/mcp/image-5.png

How to Get Xiaozhi MCP Key

/mcp/image-6.png

/mcp/image-7.png

ESP32 Device Network Configuration

After flashing the firmware, a WiFi hotspot called “Yang Yang Programming” will appear. Normally, a WiFi configuration page will automatically pop up. You can enter the device key and WiFi password for network configuration.

Network Configuration Reference Video: https://www.bilibili.com/video/BV1xa411r7Yj?t=0.3

In addition to network configuration, you also need to log in to your Xiaomi account to complete Xiaomi platform device authorization, as follows:

Open http://homeassistant.local:8123 in a browser on your computer. If this URL cannot be opened, or if there are other Home Assistant devices at home, you can turn off other devices and try again. If it still doesn’t work, you need to manually configure the host in your operating system to point the domain homeassistant.local to the ESP32’s IP address, as shown below:

/mcp/image-8.png

If you haven’t logged in before, you’ll be asked to enter your account and password to log in; if you have logged in before, just click confirm authorization.

/mcp/image-9.png

/mcp/image-10.png

⚠️ Notes

Due to different devices requiring specific parameters for connecting to Mi speaker interfaces, the current test coverage may not include many device types. If you encounter situations where commands don’t execute, it might be that your device model is not yet supported. You can provide feedback on device types in the comments below, and I’ll quickly adapt and update!

FAQ

Issue Cause Solution
⚠️ Device Parameter Adaptation Currently supports limited models Wait for future version updates
Commands Not Responding? New models may not be covered yet Provide feedback on device types in comments
Solution Need to adapt new devices Will update support immediately!

📞 Technical Support

If you have questions, please contact us through the following methods:

Let AI truly control your smart home, starting with ESP32!