返回顶部
m

mxchip-smart-control智能家居控制

Control smart home devices configured in Smart Plus APP. Use when you need to: (1) Query devices and scenes (lights, AC, switches), (2) Control device power (turn on/off), (3) Control air conditioner (temperature, mode), (4) Trigger smart scenes. Requires MXCHIP_OAUTH_TOKEN environment variable.

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.2
安全检测
已通过
134
下载量
免费
免费
1
收藏
概述
安装方式
版本历史

mxchip-smart-control

Mxchip 智能控制

通过 MXCHIP MCP 服务控制智家精灵 APP 中配置的智能家居设备。

开发者: 上海庆科信息技术有限公司
官方网站: https://www.mxchip.com/
GitHub: https://github.com/mxchip
支持: https://app.api.cloud.mxchip.com:2443/oauth2/mcp/oauth

概述

本技能为 AI 智能体提供对智家精灵 APP 中配置的智能家居设备的完整控制能力,基于 MCP(模型上下文协议)实现。支持设备管理、空调控制和场景自动化,通过 HTTP 协议使用 JSON-RPC 2.0 通信。

协议: MCP + JSON-RPC 2.0
传输方式: HTTP
目标应用: 智家精灵 APP

关于 MXCHIP

上海庆科信息技术有限公司是中国领先的物联网解决方案提供商,专注于:

  • - 智能家居设备连接
  • 物联网云平台服务
  • AI 驱动的家居自动化
  • MCP(模型上下文协议)集成

智家精灵是 MXCHIP 官方智能家居应用,支持用户:

  • - 配置和管理智能设备
  • 创建自动化场景
  • 远程控制设备
  • 与 AI 助手集成

环境配置

安装依赖:
bash
pip install requests

设置 OAuth 令牌:
bash
export MXCHIPOAUTHTOKEN=oauth2YOURTOKEN_HERE

获取令牌:

  1. 1. 访问:https://app.api.cloud.mxchip.com:2443/oauth2/mcp/oauth
  2. 输入您的智家精灵 APP 账户凭证
  3. 复制 OAuth2 访问令牌

快速开始

查询设备和场景

python from mxchipmcpclient import MxchipMCPClient

client = MxchipMCPClient()

列出所有设备和场景

result = client.listhomedevicesandscenes()

访问设备

for device in result.get(devices, []): print(f{device[name]}: {device[category]})

访问场景

for scene in result.get(scenes, []): print(f{scene[name]}: {scene[scene_id]})

控制设备

python

打开灯

client.controldevice(device001, TurnOnRequest)

关闭开关

client.controldevice(device002, TurnOffRequest)

控制空调

python

设置温度为 26°C

client.controlairconditioner( acdeviceid, SetTemperatureRequest, temperature=26 )

温度升高 2°C

client.controlairconditioner( acdeviceid, IncrementTemperatureRequest, delta=2 )

设置制冷模式

client.controlairconditioner( acdeviceid, SetModeRequest, mode=COOL )

触发场景

python

触发回家场景

client.triggerscene(sceneidcoming_home)

MCP 工具参考

1. listhomedevicesandscenes

描述: 获取家中所有智能设备和场景。

参数:

返回:

  • - devices:设备对象数组

- device_id:设备唯一标识符
- name:设备名称
- category:设备类型(LIGHT、AIR_CONDITION、SWITCH 等)
- status:当前设备状态
  • - scenes:场景对象数组

- sceneid:场景标识符(格式:sceneidxxx)
- name:场景名称(例如回家、睡眠模式)

示例:
python
result = client.listhomedevicesandscenes()
devices = result.get(devices, [])
scenes = result.get(scenes, [])



2. control_device

描述: 控制设备电源状态(开/关)。

参数:

  • - deviceid(字符串,必填):来自 listhomedevicesand_scenes 的设备标识符
  • action(字符串,必填):控制动作

- TurnOnRequest:打开设备
- TurnOffRequest:关闭设备

示例:
python

打开设备


client.controldevice(light001, TurnOnRequest)

关闭设备

client.controldevice(light001, TurnOffRequest)

3. controlairconditioner

描述: 控制空调温度和模式。

参数:

  • - deviceid(字符串,必填):空调设备 ID(AIRCONDITION 类别)
  • action(字符串,必填):控制动作类型

- IncrementTemperatureRequest:升高温度
- DecrementTemperatureRequest:降低温度
- SetTemperatureRequest:设置目标温度
- SetModeRequest:设置工作模式
  • - temperature(整数,可选):目标温度 16-32°C(用于 SetTemperatureRequest)
  • delta(字符串,可选):温度变化量,默认1(用于 Increment/Decrement)
  • mode(字符串,可选):工作模式(用于 SetModeRequest)

- COOL:制冷模式
- HEAT:制热模式
- AUTO:自动模式
- FAN:仅送风
- DEHUMIDIFICATION:除湿
- SLEEP:睡眠模式

示例:
python

设置温度为 26°C


client.controlairconditioner(ac_001, SetTemperatureRequest, temperature=26)

温度升高 2°C

client.controlairconditioner(ac_001, IncrementTemperatureRequest, delta=2)

设置制冷模式

client.controlairconditioner(ac_001, SetModeRequest, mode=COOL)

设置制热模式

client.controlairconditioner(ac_001, SetModeRequest, mode=HEAT)

4. trigger_scene

描述: 触发智能家居场景,一次控制多个设备。

参数:

  • - sceneid(字符串,必填):场景标识符(格式:sceneidxxx)

常见场景:

  • - 回家模式
  • 离家模式
  • 睡眠模式
  • 观影模式

示例:
python
client.triggerscene(sceneidcoming_home)



MCP 提示参考

MCP 服务提供三个专用提示:

1. device_control

用途: 设备控制助手,专注于控制灯光、开关、窗帘等。

使用时机: 当用户想要控制特定设备类型时(打开/关闭灯光、开关)

2. scene_trigger

用途: 场景控制助手,用于管理预设的自动化场景

使用时机: 当用户想要执行回家、睡眠模式等场景时

3. smarthomeassistant

用途: 全功能智能家居助手

使用时机: 当用户需要全面的家居自动化时(查询 + 控制 + 场景)

常见用例

示例 1:早晨例行

python client = MxchipMCPClient()

打开卧室灯

client.controldevice(bedroomlight, TurnOnRequest)

设置空调到舒适温度

client.controlairconditioner(bedroom_ac, SetTemperatureRequest, temperature=24)

打开窗帘(如果支持)

client.controldevice(curtain001, TurnOnRequest)

示例 2:离家

python

触发离家场景

client.triggerscene(sceneidleaving_home)

或手动关闭设备

client.controldevice(livingroom_light, TurnOffRequest) client.controldevice(bedroomac, TurnOffRequest)

示例 3:检查所有设备

python result = client.listhomedevicesandscenes()

for device in result.get(devices, []):
status = device.get(status, 未知)
print(f{device[name]}: {status})

设备类别

类别描述控制方法
LIGHT智能灯controldevice(开/关)
AIRCONDITION
空调 | controlairconditioner | | SWITCH | 智能开关 | control_device(开/关) | | CURTAIN | 智能窗帘 | control_device(开/关) | | SOCKET | 智能插座 | control

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 mxchip-smart-control-1776070322 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 mxchip-smart-control-1776070322 技能

通过命令行安装

skillhub install mxchip-smart-control-1776070322

下载

⬇ 下载 mxchip-smart-control v1.0.2(免费)

文件大小: 15.4 KB | 发布时间: 2026-4-14 13:28

v1.0.2 最新 2026-4-14 13:28
No user-facing changes detected in this release.

- Version 1.0.2 contains no file or documentation changes.
- Functionality and interface remain the same as the previous version.

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部