← 返回 Skills 市场
lafoush

Home Assistant

作者 Philippe Lafoucrière · GitHub ↗ · v1.0.5 · MIT-0
cross-platform ✓ 安全检测通过
199
总下载
2
收藏
0
当前安装
6
版本数
在 OpenClaw 中安装
/install homeassistant-selora
功能描述
Connect Home Assistant to OpenClaw via OAuth 2.0 through Selora Connect. Authenticate and use Selora AI tools to inspect your home, create automations, and a...
使用说明 (SKILL.md)

Home Assistant MCP Setup

Connect your Home Assistant to OpenClaw. Authentication is handled via OAuth 2.0 through Selora Connect — no manual tokens needed.

Prerequisites

  1. Home Assistant 2025.1+ with the Selora AI integration installed.
  2. A Selora Connect account with your HA installation linked.
  3. OpenClaw installed.

1. Get Your MCP URL

Access URL
Local http://homeassistant.local:8123/api/selora_ai/mcp
Remote https://mcp-\x3Cid>.selorabox.com/api/selora_ai/mcp

Your remote MCP URL (including your mcp-\x3Cid>) is shown in Selora Connect once MCP remote access is enabled. Enable it to provision a SeloraBox tunnel URL.

Use your HA IP (e.g. 192.168.x.x) instead of homeassistant.local if mDNS is slow.

2. Add the MCP Server

Add the server via the CLI:

openclaw mcp set home-assistant '{"url":"https://mcp-\x3Cid>.selorabox.com/api/selora_ai/mcp"}'

Or edit ~/.openclaw/openclaw.json directly:

{
  "mcp": {
    "servers": {
      "home-assistant": {
        "url": "https://mcp-\x3Cid>.selorabox.com/api/selora_ai/mcp"
      }
    }
  }
}

For local access, use http://homeassistant.local:8123/api/selora_ai/mcp as the URL.

3. Authenticate

  1. Restart the OpenClaw gateway after editing the config.
  2. Use any tool from the server (e.g. ask "Get a snapshot of my home"). OpenClaw connects and receives a 401 Unauthorized.
  3. OpenClaw surfaces an authorization URL. Open it in a browser.
  4. Approve access on the Selora Connect consent screen.
  5. The browser redirects back to OpenClaw's callback to complete the exchange.
  6. Tokens are cached and refresh silently from then on.

The callback must reach OpenClaw's listener. If the browser and OpenClaw are on the same machine, the redirect completes automatically. If they are on different machines, see Cross-device callback mismatch below.

4. Verify

Ask your agent: "Get a snapshot of my home". You should see selora_get_home_snapshot return your entities grouped by area.

Available Tools

Read tools:

Tool Description
selora_get_home_snapshot Entity states grouped by area — call this first
selora_list_automations Selora automations with status and risk (filterable)
selora_get_automation Full detail: YAML, versions, risk
selora_validate_automation Validate and risk-assess YAML without creating
selora_list_sessions Recent chat sessions
selora_list_patterns Detected behavior patterns
selora_get_pattern Full pattern detail with linked suggestions
selora_list_suggestions Proactive suggestions with YAML previews

Mutating tools (🔒 require admin authorization):

Tool Description
selora_chat 🔒 Natural-language chat — proposes automations with YAML and risk
selora_create_automation 🔒 Create automation from YAML (disabled by default)
selora_accept_automation 🔒 Enable a pending automation
selora_delete_automation 🔒 Delete permanently
selora_accept_suggestion 🔒 Create automation from a suggestion
selora_dismiss_suggestion 🔒 Dismiss a suggestion
selora_trigger_scan 🔒 Trigger immediate suggestion scan (rate-limited 60s)

Workflows

Explore your home

  1. selora_get_home_snapshot — understand entities and areas.
  2. selora_list_automations / selora_get_automation for existing automations.

Create from YAML

  1. selora_validate_automation — check YAML and surface risk.
  2. Show normalized YAML + risk, ask user confirmation.
  3. selora_create_automation with enabled=false.
  4. selora_accept_automation after explicit approval.

Create from natural language

  1. selora_chat — describe what you want; Selora returns YAML + risk.
  2. Summarize risk, ask user confirmation.
  3. selora_create_automation or selora_accept_automation.

Act on suggestions

  1. selora_list_suggestions (optionally selora_trigger_scan first).
  2. Show suggestion details, ask user confirmation.
  3. selora_accept_suggestion or selora_dismiss_suggestion.

Safety Rules

  1. Never invent IDs — resolve from tool output only.
  2. Never mutate without explicit user confirmation.
  3. Always surface risk_assessment before mutating. High or missing risk requires a second confirmation.
  4. Create automations disabled by default.
  5. Do not skip validation for externally provided YAML.

How OAuth Works

  1. OpenClaw discovers Connect's OAuth server from the MCP endpoint's .well-known/oauth-authorization-server metadata.
  2. OpenClaw registers itself dynamically (POST /oauth/register).
  3. OpenClaw starts an authorization code flow with PKCE and surfaces an authorization URL.
  4. You open the URL and approve access on the Selora Connect consent screen.
  5. OpenClaw exchanges the code for access + refresh tokens.
  6. Tokens refresh automatically — no re-auth needed until you revoke access.

On 401 Unauthorized, OpenClaw reads the WWW-Authenticate header, attempts a token refresh, and falls back to a full OAuth flow if refresh fails. No manual re-configuration is needed.

Troubleshooting

Symptom Fix
401 Unauthorized (auth URL shown) Open the authorization URL, approve access on Selora Connect, and the flow completes automatically. If refresh fails later, OpenClaw triggers a new flow.
401 Unauthorized loop (no auth URL shown) OpenClaw's native OAuth flow is not surfacing the authorization URL — check gateway logs for 401, auth URL emission, and MCP startup failures. See Debugging with mcp-remote below.
Connection refused Verify HA is running and URL is correct
Timeout Check firewall; for remote, ensure SeloraBox tunnel is active
Tools not listed Ensure Selora AI integration is installed and enabled
Admin tools rejected Selora Connect role must be owner or member (not viewer)

Cross-device callback mismatch

The OAuth redirect targets localhost on the machine running OpenClaw. If your browser is on a different machine (e.g. OpenClaw on a server, browser on a laptop), the callback cannot reach OpenClaw's listener and the flow fails silently.

As a fallback, ask the user to copy the full callback URL (including the code and state parameters) from their browser's address bar after approving, and paste it back so the agent can complete the token exchange.

Debugging with mcp-remote

If OpenClaw keeps returning 401 without surfacing an authorization URL, use mcp-remote (requires Node.js 18+) to isolate the problem. It is not part of the normal setup — only a debugging tool.

npx -y mcp-remote https://mcp-\x3Cid>.selorabox.com/api/selora_ai/mcp

This helps verify the endpoint supports OAuth correctly and that the token exchange works end-to-end. If mcp-remote completes the flow successfully, the endpoint is working — the issue is in OpenClaw's OAuth runtime, not your HA setup.

安全使用建议
This skill is internally consistent for connecting Home Assistant to OpenClaw via Selora Connect, but before installing you should: (1) confirm you trust Selora Connect and the selorabox remote tunnel (exposing a remote MCP URL exposes access paths to your HA instance); (2) verify HTTPS/TLS and the exact mcp-<id>.selorabox.com host shown by Selora Connect; (3) be aware OpenClaw will dynamically register an OAuth client and store access/refresh tokens — revoke access in Selora Connect if you want to disconnect; (4) ensure platform-level enforcement of the SKILL.md safety rules (explicit confirmations for mutating actions) because the instructions allow creating/enabling/deleting automations and triggering scans; and (5) test locally first (use local MCP URL) before enabling remote access. If you need higher assurance, ask for the origin/maintainer of this skill and confirmation that the platform enforces the documented admin confirmation checks.
功能分析
Type: OpenClaw Skill Name: homeassistant-selora Version: 1.0.5 The skill bundle contains metadata and documentation (SKILL.md) for integrating Home Assistant with OpenClaw via the Selora AI service. It outlines a standard OAuth 2.0 authentication flow and defines tools for managing home automations. The instructions include safety guidelines for the AI agent, such as requiring explicit user confirmation for mutations and validating YAML, with no evidence of malicious intent, data exfiltration, or unauthorized execution.
能力标签
requires-oauth-tokenrequires-sensitive-credentials
能力评估
Purpose & Capability
The SKILL.md describes connecting Home Assistant to OpenClaw through Selora Connect and the file edits/CLI commands, OAuth flow, and described read/write toolsets all align with that purpose. There are no unrelated binaries, env vars, or external services requested beyond the Selora endpoints and the OpenClaw config.
Instruction Scope
The instructions tell the operator to edit ~/.openclaw/openclaw.json, restart the gateway, and complete an OAuth flow in-browser — all expected for this integration. The skill documents mutating tools (create/accept/delete automations, trigger scans) and enforces user-confirmation safety rules; however, the actual enforcement of those rules depends on the platform. Verify that mutating actions require explicit admin authorization before use.
Install Mechanism
There is no install spec and no code files; this is instruction-only. That minimizes install risk because nothing is downloaded or written by the skill itself.
Credentials
No environment variables, credentials, or config paths are requested by the skill. OAuth is performed dynamically via the MCP endpoint and Selora Connect, which is an expected design for this integration.
Persistence & Privilege
The skill is not marked always:true. It allows autonomous model invocation by default (the platform default). Because the skill exposes mutating operations, ensure the platform or user enforces the documented safety confirmations before the agent performs changes on your Home Assistant.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install homeassistant-selora
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /homeassistant-selora 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.5
- Fix HA skill MCP config format
v1.0.4
- Scope HA skill to OpenClaw only (v1.0.4)
v1.0.3
- Improve HA skill OAuth docs and OpenClaw setup
v1.0.2
- Update HA skill to v1.1.0 with streamlined docs and new tools
v1.0.1
No changes
v1.0.0
Initial version
元数据
Slug homeassistant-selora
版本 1.0.5
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 6
常见问题

Home Assistant 是什么?

Connect Home Assistant to OpenClaw via OAuth 2.0 through Selora Connect. Authenticate and use Selora AI tools to inspect your home, create automations, and a... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 199 次。

如何安装 Home Assistant?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install homeassistant-selora」即可一键安装,无需额外配置。

Home Assistant 是免费的吗?

是的,Home Assistant 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Home Assistant 支持哪些平台?

Home Assistant 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Home Assistant?

由 Philippe Lafoucrière(@lafoush)开发并维护,当前版本 v1.0.5。

💬 留言讨论