“智能照明,简约而不简单”
智能辉光(IntelliGlow)是一个基于模型上下文协议(MCP)的服务器,它允许像 Claude 和 ChatGPT 这样的 AI 助手通过 UDP 网络通信来控制真正的智能灯泡。这个 Python 实现具备语音命令、AI 推理和直接硬件控制等功能。
安装智能辉光(IntelliGlow):
# 核心系统
pip install -e .
# 具备语音功能
pip install -e .[voice]
配置你的灯泡(可选):
export BULB_IP=192.168.1.45 # 你的灯泡 IP 地址
export BULB_PORT=4000 # 你的灯泡端口号
# 1. 仅启动 MCP 服务器(用于 AI 集成)
mcp-server-smartbulb
# 2. 仅启动语音界面
mcp-server-smartbulb-voice
# 3. 启动完整的智能辉光系统(语音 + AI + MCP)
python voice_enabled_server.py
# 测试与你真实灯泡的 UDP 通信
python test_network_bulbs.py
192.168.1.45:4000# 这里可以添加一些基本使用的代码示例,如果原文档有相关代码可以替换这里
# 例如初始化和简单控制
from mcp_server_smartbulb import network_server
# 初始化服务器等操作
# 高级场景说明:例如结合 AI 进行复杂的照明控制
# 这里可以根据实际情况补充代码
import asyncio
from mcp_server_smartbulb import network_server
async def advanced_control():
# 复杂的控制逻辑
pass
asyncio.run(advanced_control())
在你的 Claude 桌面版 claude_desktop_config.json 中添加以下内容:
{
"mcpServers": {
"intelliglow": {
"command": "python",
"args": ["-m", "mcp_server_smartbulb.network_server"],
"cwd": "/path/to/your/IntelliGlow",
"env": {
"BULB_IP": "192.168.1.45",
"BULB_PORT": "4000"
}
}
}
}
discover_bulbs() - 在网络中查找智能灯泡connect_to_bulb(ip, port) - 连接到特定的灯泡turn_on_bulb(ip, port) - 通过 UDP 打开灯泡turn_off_bulb(ip, port) - 通过 UDP 关闭灯泡set_bulb_brightness(brightness, ip, port) - 设置亮度(0 - 100)set_bulb_color(color, ip, port) - 使用十六进制代码设置颜色get_bulb_status(ip, port) - 获取当前灯泡状态ping_bulb(ip, port) - 测试与灯泡的连接性智能辉光(IntelliGlow)默认连接到 192.168.1.45:4000。你可以通过以下方式覆盖默认设置:
export BULB_IP=192.168.1.100
export BULB_PORT=4001
创建 bulb_config.json:
{
"default_bulb": {
"ip": "192.168.1.45",
"port": 4000,
"timeout": 5.0
},
"discovery": {
"enabled": true,
"timeout": 10.0,
"port_range": {
"start": 4000,
"end": 4010
}
}
}
| 属性 | Alexa/Google | 智能辉光(IntelliGlow) |
|---|---|---|
| 语音控制 | ✅ 基本命令 | ✅ 自然语言 + AI 推理 |
| AI 集成 | ❌ 有限的生态系统 | ✅ 可与任何 AI 模型(Claude、GPT 等)配合使用 |
| 硬件控制 | ❌ 依赖云服务 | ✅ 直接 UDP 网络连接 |
| 定制化 | ❌ 供应商限制 | ✅ 完全控制协议 |
| 上下文理解 | ❌ 简单关键词 | ✅ AI 理解上下文和工作流 |
| 隐私性 | ❌ 云处理 | ✅ 本地处理 |
| 开发者自由度 | ❌ 封闭生态系统 | ✅ 开放协议,可扩展 |
结论:智能辉光(IntelliGlow)= Alexa 的便捷性 + AI 的智能性 + 开源的自由度!🎉
# 测试与你的灯泡的真实 UDP 通信
python test_network_bulbs.py
这将:
python -c "import asyncio; from mcp_server_smartbulb.bulb_discovery import BulbDiscovery; asyncio.run(BulbDiscovery().discover_bulbs())"pip install -e .[voice]python -m mcp_server_smartbulb.voice_interfacebulb_config.json 中增加超时时间IntelliGlow/
├── mcp_server_smartbulb/
│ ├── __init__.py # 包初始化
│ ├── network_server.py # 主要的支持 UDP 的 MCP 服务器
│ ├── udp_client.py # UDP 网络客户端
│ ├── bulb_discovery.py # 网络发现
│ └── voice_interface.py # 语音命令处理
├── bulb_config.json # 网络配置
├── test_network_bulbs.py # UDP 测试脚本
├── voice_enabled_server.py # 完整的智能辉光系统
├── README.md # 本文件
└── pyproject.toml # 项目配置
简洁、专注且智能!🧠💡
智能辉光(IntelliGlow)不仅仅是另一个智能灯泡控制器 - 它是 AI 智能与物理硬件之间的桥梁。
用户:“我要工作到很晚,需要专注照明”
智能辉光(IntelliGlow):
→ AI 理解上下文
→ 设置冷白光(5000K)
→ 调整到最佳亮度(85%)
→ 直接 UDP 通信
→ 回复确认信息
这就是智能家居的未来 - 照明真正理解并适应你的需求! 🚀
怀着对下一代智能家庭自动化的热爱而打造 ❤️