mcp-hass
@aahl · 收录于 3 周前
The skill for control Home Assistant smart home devices and query states using MCP protocol.
适合你,如果你有 Home Assistant 并想通过 MCP 协议控制设备
/ 下载安装
用别的 agent?下载 .zip 解压,把文件夹放进它的技能目录
Claude Code
~/.claude/skills/(项目级 .claude/skills/)Codex CLI
~/.codex/skills/Cursor自动读取上面两处目录
其他工具见其文档的「skills」目录;两个下载是同一份文件,只是名字不同
/ 通过 npx 安装 校验哈希
npx oh-my-skill add aahl/skills/mcp-hass/ 通过 bash 安装
curl -fsSL https://oh-my-skill.com/install.sh | bash -s -- aahl/skills/mcp-hass/ 已经装过?验证本机副本,不用重装
npx oh-my-skill verify aahl/skills/mcp-hass安装目标可用 --agent / --scope 或 --to 明确指定;省略时只会在唯一已存在的 agent 目录上自动选择,零命中或多命中会停止并提示。content_hash 缺失或不一致均拒装。
144GitHub stars
~488上下文体积 · 单文件
镜像托管
怎么用
商店整理自技能原文 · 版本 34218aa · 表述以原文为准它做什么
装上后,Claude 可以控制你的 Home Assistant 智能家居设备(如开关灯、调亮度、调风扇速度),也能查询设备状态。
什么时候触发
当你要求控制智能家居设备(如开灯、关风扇)或查询设备状态时触发。
装好后可以这样说
Claude 会调用 HassTurnOn 打开指定灯。
技能原文 SKILL.md
Home Assistant
Control Home Assistant smart home and query states using MCP protocol.
Prerequisites
Enable MCP server in Home Assistant:
- Browse to your Home Assistant instance.
- Go to Settings > Devices & services.
- In the bottom right corner, select the + Add Integration button.
- From the list, select Model Context Protocol.
- Follow the instructions on screen to complete the setup.
Config
When prompted that the MCP server does not exist, remind the user to configure the HASS_BASE_URL and HASS_ACCESS_TOKEN environment variables by executing the following command to add the configuration:
npx -y mcporter config add home-assistant \
--transport http \
--url "${HASS_BASE_URL:-http://homeassistant.local:8123}/api/mcp" \
--header "Authorization=Bearer \${HASS_ACCESS_TOKEN}"
Usage
# Get states npx -y mcporter call home-assistant.GetLiveContext # Turn on the device npx -y mcporter call home-assistant.HassTurnOn(name: "Bedroom Light") npx -y mcporter call home-assistant.HassTurnOn(name: "Light", area: "Bedroom") # Turn off the device npx -y mcporter call home-assistant.HassTurnOff(name: "Bedroom Light") npx -y mcporter call home-assistant.HassTurnOff(area: "Bedroom", domain: ["light"]) # Control light # brightness: The percentage of the light, where 0 is off and 100 is fully lit. # color: Name of color npx -y mcporter call home-assistant.HassLightSet(name: "Bedroom Light", brightness: 50) # Control fan # percentage: The percentage of the fan, where 0 is off and 100 is full speed. npx -y mcporter call home-assistant.HassFanSetSpeed(name: "Fan", area: "Bedroom", percentage: 80)
Execute the following command to learn about specific usage methods:
npx -y mcporter list home-assistant --schema --all-parameters
About mcporter
- To improve compatibility, use
npx -y mcporterinstead ofmcporterwhen executing commands. - https://github.com/steipete/mcporter/raw/refs/heads/main/docs/call-syntax.md
- https://github.com/steipete/mcporter/raw/refs/heads/main/docs/cli-reference.md
按 MIT 许可原样转载,未经改动 · 在 GitHub 查看 →
评论
登录即可评论;带「已验证安装」的,是发布者名下有本店的安装或持有记录。
…