Token导航 LogoToken导航

Agent Skill · 研究检索

home-assistant-api(home 助手 API)

用于辅助 API 设计、接口文档、请求响应结构和服务集成说明。它适合让 Agent 梳理 endpoint、生成 OpenAPI 草稿、检查字段命名、整理错误码或辅助前后端联调。使用时需要确认真实业务语义、鉴权方式、分页和错误处理规则;涉及生成接口文档时,应避免凭空补字段,最好从现有代码、schema 或接口样例中提取事实。

home-assistant-api 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为需要联网;许可证为 MIT,第三方扫描已通过,按安装量在研究检索类的 73,675 个 Skill 里排第 46,660。

总安装 768周安装 33GitHub Stars 15下载 269核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
MIT

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:home-assistant-api(home 助手 API)
来源仓库:https://github.com/markpitt/claude-skills
仓库路径:skills/home-assistant-api
安装命令:
npx skills add https://github.com/markpitt/claude-skills --skill home-assistant-api
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/markpitt/claude-skills --skill home-assistant-api

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

home-assistant-api 用于辅助 API 设计、接口文档和请求响应结构说明。适合梳理 endpoint、生成 OpenAPI 草稿或检查字段命名等开发场景。通过 npx skills add 命令从 GitHub 仓库安装并使用。使用时需确认真实业务语义、鉴权方式及错误处理规则,避免凭空补字段。

适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

来源仓库内路径:skills/home-assistant-api

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/markpitt/claude-skills --skill home-assistant-…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要需要联网,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

home-assistant-api 怎么安装?

在终端执行 npx skills add https://github.com/markpitt/claude-skills --skill home-assistant-api。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

home-assistant-api 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

home-assistant-api 需要什么权限?

权限级别是需要联网。该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

home-assistant-api 是免费的吗?

来源标注的许可证是 MIT。本站不代收任何费用,也不托管安装包;能否商用、要不要署名,以许可证原文为准。

home-assistant-api 用的人多吗?

公开数据是累计安装 768 次,近一周安装 33 次,下载 269 次,GitHub 15 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

home-assistant-api 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 3 个目录同时收录,说明这个 Skill 流传比较广。
  • 许可证明确为 MIT,商用和分发边界好判断。
  • 第三方扫描已通过,常见的高风险行为没有命中。

先想清楚的地方

  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。
  • 需要许可证清楚、并且有第三方扫描结果的团队项目。

不太适合

  • 需要厂商级技术支持和 SLA 的生产系统。

研究检索类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
find-skills

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
home-assistant-api

home 助手 API · 本页

76815需要联网MIT通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Home Assistant REST API Orchestration Skill

This skill provides access to the Home Assistant REST API for building integrations, automating smart home devices, and managing Home Assistant instances programmatically.

Quick Reference: When to Load Which Resource

TaskLoad Resource
Setting up authentication, understanding API basics, HTTP methodsresources/core-concepts.md
Querying entity states, updating states, monitoring changesresources/state-management.md
Controlling lights, climate, locks, and other devicesresources/service-reference.md
Understanding light, switch, sensor, climate entity typesresources/entity-types.md
Server-side template queries, complex filters, aggregationsresources/templates.md
System configuration, component discovery, error logsresources/system-config.md
Complete code examples, client libraries, patternsresources/examples.md

Orchestration Protocol

Phase 1: Task Analysis

Identify what the user needs to accomplish:

Authentication & Setup?

  • Getting started with Home Assistant API
  • Creating or managing tokens
  • Configuring HTTP clients → Load resources/core-concepts.md

Query or Monitor State?

  • "What is the temperature in the kitchen?"
  • "Is the front door locked?"
  • "Get all lights that are on"
  • "Monitor entity changes" → Load resources/state-management.md

Control a Device?

  • "Turn on the kitchen light"
  • "Set thermostat to 22°C"
  • "Lock the front door"
  • "Play music on speaker" → Load resources/service-reference.md (then find entity type in resources/entity-types.md)

Understand Entity Types?

  • "What attributes does a climate entity have?"
  • "What services are available for locks?"
  • "How do I control a media player?" → Load resources/entity-types.md

Complex Query or Data Aggregation?

  • "Count all lights that are on"
  • "Get devices with low battery"
  • "Average temperature from all sensors"
  • "Conditional logic based on time of day" → Load resources/templates.md

System Management or Discovery?

  • "What components are loaded?"
  • "What services are available?"
  • "Check configuration validity"
  • "View error logs" → Load resources/system-config.md

Practical Working Example?

  • Code in Python, Node.js, Bash, curl
  • Integration patterns
  • Error handling
  • Multi-entity operations → Load resources/examples.md

Phase 2: Endpoint Selection

Use this decision tree to select the right API endpoint:

Do you need to...
│
├─ GET INFORMATION?
│  ├─ Get one entity's state?        → GET /api/states/{entity_id}
│  ├─ Get all entity states?         → GET /api/states (then filter)
│  ├─ Get configuration?             → GET /api/config
│  ├─ List available services?       → GET /api/services
│  ├─ Discover event types?          → GET /api/events
│  ├─ Query historical data?         → GET /api/history/period/{timestamp}
│  ├─ Get error log?                 → GET /api/error_log
│  ├─ Complex query/computation?     → POST /api/template
│  └─ Check system status?           → GET /api/
│
├─ CONTROL A DEVICE?
│  ├─ Light (on/off/brightness)?     → POST /api/services/light/{service}
│  ├─ Switch?                        → POST /api/services/switch/{service}
│  ├─ Climate/thermostat?            → POST /api/services/climate/{service}
│  ├─ Lock?                          → POST /api/services/lock/{service}
│  ├─ Cover/blinds?                  → POST /api/services/cover/{service}
│  ├─ Media player?                  → POST /api/services/media_player/{service}
│  ├─ Fan?                           → POST /api/services/fan/{service}
│  ├─ Camera?                        → POST /api/services/camera/{service}
│  └─ Any service?                   → POST /api/services/{domain}/{service}
│
├─ MODIFY STATE (NOT FOR DEVICE CONTROL)?
│  ├─ Create/update state?           → POST /api/states/{entity_id}
│  ├─ Delete state?                  → DELETE /api/states/{entity_id}
│  └─ Fire custom event?             → POST /api/events/{event_type}
│
└─ MANAGE SYSTEM?
   ├─ Validate config?               → POST /api/config/core/check_config
   ├─ Reload config?                 → POST /api/services/homeassistant/reload_core_config
   ├─ Restart Home Assistant?        → POST /api/services/homeassistant/restart
   ├─ Get components list?           → GET /api/components
   ├─ Update entity metadata?        → POST /api/services/homeassistant/update_entity
   └─ Check error log?               → GET /api/error_log

Phase 3: Execution & Validation

Before Calling API:

  1. Do you have correct entity_id? (domain.name format)
  2. Are you using the right HTTP method? (GET vs POST vs DELETE)
  3. Is your authentication token valid?
  4. For service calls, do you have the right parameters?

During Execution:

  • Handle error responses appropriately (401, 404, 500, etc.)
  • Retry on network errors with exponential backoff
  • Monitor performance for polling operations

After Execution:

  • Verify response matches expectation
  • Check for error codes in response
  • Cache results if applicable

Common Task Patterns

Query Current State

# Get one light's state
GET /api/states/light.kitchen

# Get temperature reading
GET /api/states/sensor.temperature

# Get all lights
GET /api/states
# Then filter: .[] | select(.entity_id | startswith("light."))

Load: resources/state-management.md then resources/core-concepts.md for HTTP details

Turn on/off Devices

# Turn on light with brightness
POST /api/services/light/turn_on
{"entity_id": "light.kitchen", "brightness": 200}

# Turn off all lights
POST /api/services/light/turn_off
{"entity_id": "all"}

# Toggle switch
POST /api/services/switch/toggle
{"entity_id": "switch.coffee_maker"}

Load: resources/service-reference.md + resources/entity-types.md for specific parameters

Query Multiple Entities

Option 1: Multiple API calls (simple, high bandwidth)

GET /api/states/light.kitchen
GET /api/states/light.living_room
GET /api/states/light.bedroom

Option 2: Get all and filter (one call, parse locally)

GET /api/states
# Filter in client: select by entity_id prefix

Option 3: Server-side template (most efficient)

POST /api/template
{"template": "{{ states.light | selectattr('state', 'eq', 'on') | list | length }}"}

Load: resources/templates.md for advanced queries

Batch Operations

# Bad: Multiple sequential API calls
POST /api/services/light/turn_on {"entity_id": "light.kitchen"}
POST /api/services/light/turn_on {"entity_id": "light.living_room"}
POST /api/services/light/turn_on {"entity_id": "light.bedroom"}

# Better: Array of entities in one call
POST /api/services/light/turn_on
{"entity_id": ["light.kitchen", "light.living_room", "light.bedroom"]}

# Best: Use Home Assistant script (for complex multi-step)
POST /api/services/script/turn_on
{"entity_id": "script.my_scene"}

Load: resources/examples.md for working code patterns

Entity Type Quick Reference

Read-Only (Sensors)

  • sensor.* - Numeric/text readings
  • binary_sensor.* - On/off detection
  • camera.* - Camera snapshots

Load: resources/entity-types.md for attributes

Controllable Entities

  • light.* - Lights (on/off, brightness, color)
  • switch.* - Switches (on/off)
  • climate.* - Thermostats (temperature, mode)
  • cover.* - Blinds, doors (open/close, position)
  • lock.* - Locks (lock/unlock)
  • fan.* - Fans (on/off, speed, oscillate)
  • media_player.* - Media devices (play/pause, volume)

Load: resources/entity-types.md then resources/service-reference.md

Meta Entities (Non-device)

  • automation.* - Automations (trigger, turn on/off)
  • script.* - Scripts (turn on/off)
  • scene.* - Scenes (activate)
  • group.* - Entity groups
  • person.* - Location tracking
  • device_tracker.* - Device tracking
  • input_* - Input helpers

Status Entities

  • person.* - "home" or "not_home"
  • device_tracker.* - Location state
  • sun.sun - "above_horizon" or "below_horizon"
  • weather.* - Weather conditions

Service Call Parameters

Most Common Services

DomainServiceKey Parameters
lightturn_onentity_id, brightness, rgb_color, transition
lightturn_offentity_id, transition
switchturn_onentity_id
switchturn_offentity_id
climateset_temperatureentity_id, temperature, hvac_mode
climateset_hvac_modeentity_id, hvac_mode
coveropen_coverentity_id
coverset_cover_positionentity_id, position (0-100)
locklockentity_id, code (optional)
lockunlockentity_id, code (optional)
fanturn_onentity_id, percentage, preset_mode
media_playerplay_mediaentity_id, media_content_id, media_content_type
notifymobile_app_*message, title, data
automationtriggerentity_id
scriptturn_onentity_id
sceneturn_onentity_id, transition

Load: resources/service-reference.md for complete reference

Response Handling

Success (200)

{
  "entity_id": "light.kitchen",
  "state": "on",
  "attributes": {...},
  "last_changed": "...",
  "last_updated": "...",
  "context": {...}
}

Authorization Error (401)

{
  "error": "Unauthorized",
  "message": "Invalid authentication provided"
}

Solution: Check token, regenerate if needed

Not Found (404)

{
  "error": "Entity not found",
  "message": "No entity found for domain 'light' and name 'nonexistent'"
}

Solution: Verify entity_id exists, check spelling

Bad Request (400)

{
  "error": "Invalid JSON",
  "message": "..."
}

Solution: Validate JSON syntax, required fields

Server Error (500)

Solution: Check HA error log, restart if needed

Load: resources/core-concepts.md for detailed error handling

Python Example Workflow

import requests

class HomeAssistant:
    def __init__(self, url, token):
        self.url = url
        self.headers = {
            "Authorization": f"Bearer {token}",
            "Content-Type": "application/json"
        }

    # State queries
    def get_state(self, entity_id):
        """Load: state-management.md"""
        return requests.get(f"{self.url}/api/states/{entity_id}",
                          headers=self.headers).json()

    # Service calls
    def turn_on_light(self, entity_id, brightness=None):
        """Load: service-reference.md + entity-types.md"""
        data = {"entity_id": entity_id}
        if brightness:
            data["brightness"] = brightness

        return requests.post(
            f"{self.url}/api/services/light/turn_on",
            headers=self.headers,
            json=data
        ).json()

    # Complex queries
    def count_on_lights(self):
        """Load: templates.md"""
        template = "{{ states.light | selectattr('state', 'eq', 'on') | list | length }}"
        resp = requests.post(
            f"{self.url}/api/template",
            headers=self.headers,
            json={"template": template}
        )
        return int(resp.json()['result'])

# Usage
ha = HomeAssistant("http://localhost:8123", "YOUR_TOKEN")

# Query state
kitchen = ha.get_state("light.kitchen")
print(f"Kitchen light: {kitchen['state']}")

# Control device
ha.turn_on_light("light.kitchen", brightness=200)

# Complex query
count = ha.count_on_lights()
print(f"{count} lights are on")

Load: resources/examples.md for complete working examples

Decision Matrix: Which Task?

I want to...Load ResourceExample
Understand how to authenticatecore-concepts.mdGetting access token
Query temperature or sensor valuestate-management.mdGET /api/states/sensor.temp
Turn on a lightservice-reference.md → entity-types.mdPOST /api/services/light/turn_on
Find devices with low batterytemplates.mdServer-side template query
Understand light color optionsentity-types.mdBrightness, RGB, HS color
Count how many lights are ontemplates.mdselectattr filter
Check if config is validsystem-config.mdPOST /api/config/core/check_config
Write working Python codeexamples.mdComplete client implementation
Handle errors properlycore-concepts.md → examples.mdRetry logic, error codes
Batch control multiple devicesservice-reference.md → examples.mdArray of entity_ids

Recommended Learning Path

New to Home Assistant API?

  1. resources/core-concepts.md - Understand authentication and basics
  2. resources/state-management.md - Learn to query state
  3. resources/service-reference.md - Learn to control devices
  4. resources/examples.md - See working code

Building an integration?

  1. resources/core-concepts.md - Error handling, timeouts
  2. resources/examples.md - Client setup, retry logic
  3. resources/service-reference.md - Available operations
  4. resources/templates.md - Complex queries

Power user optimizations?

  1. resources/templates.md - Server-side queries
  2. resources/system-config.md - Discovery, caching
  3. resources/examples.md - Performance patterns

Next Step: Identify your task above, load the appropriate resource file, and proceed with implementation.

平台分布

Claude Code

29.78%
按下载量换算80

github-copilot

24.11%
按下载量换算65

OpenCode

16.32%
按下载量换算44

Codex

10.82%
按下载量换算29

Antigravity

8.08%
按下载量换算22

windsurf

3.68%
按下载量换算10

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。

继续浏览同类 Skills