← 返回 Skills 市场
ricanwarfare

HA Skill

作者 ricanwarfare · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ⚠ suspicious
84
总下载
0
收藏
1
当前安装
1
版本数
在 OpenClaw 中安装
/install ha-skill
功能描述
Control Home Assistant entities via REST API. Use when the user asks to control lights, climate, switches, or other HA entities. Supports climate (thermostat...
使用说明 (SKILL.md)

Home Assistant Skill

Control your Home Assistant instance via REST API. Supports climate control, lights, switches, and sensor queries.

Purpose

This skill provides read and write access to your Home Assistant entities:

  • Climate: Set temperature, HVAC mode, query current state
  • Lights: Turn on/off, set brightness, color
  • Switches: Toggle on/off
  • Sensors: Query current values
  • Services: Call any HA service

Setup

Credentials are stored in ~/.openclaw/credentials/homeassistant.json:

{
  "url": "http://192.168.2.82:8123",
  "token": "LONG_LIVED_ACCESS_TOKEN"
}

To generate a long-lived access token:

  1. Open Home Assistant → Profile (bottom left)
  2. Scroll to "Long-Lived Access Tokens"
  3. Click "Create Token"
  4. Name it "clawd" and copy the token

Commands

All commands use the HA REST API. Output is human-readable by default, add json for raw output.

Climate Control

Set thermostat temperature and mode:

# Set temperature (auto-selects cool/heat based on setpoint vs current)
bash scripts/climate.sh set \x3Centity_id> \x3Ctemperature>

# Set specific mode (cool, heat, auto, off)
bash scripts/climate.sh mode \x3Centity_id> \x3Cmode>

# Get current climate state
bash scripts/climate.sh status \x3Centity_id>
bash scripts/climate.sh status \x3Centity_id> json

Examples:

# Set to 73°F cooling
bash scripts/climate.sh set climate.living_room 73 cool

# Turn off thermostat
bash scripts/climate.sh mode climate.living_room off

# Check current temperature
bash scripts/climate.sh status climate.living_room

List Entities

Find entity IDs for climate, lights, switches:

# List all climate entities
bash scripts/entities.sh climate

# List all light entities
bash scripts/entities.sh light

# List all switch entities
bash scripts/entities.sh switch

# List all entities of a domain
bash scripts/entities.sh all

Light Control

# Turn on
bash scripts/light.sh on light.living_room

# Turn off
bash scripts/light.sh off light.living_room

# Set brightness (0-255)
bash scripts/light.sh brightness light.living_room 128

# Set color (RGB)
bash scripts/light.sh color light.living_room 255 0 0

# Get state
bash scripts/light.sh status light.living_room

Switch Control

# Toggle switch
bash scripts/switch.sh toggle switch.bedroom_fan

# Turn on/off
bash scripts/switch.sh on switch.bedroom_fan
bash scripts/switch.sh off switch.bedroom_fan

Sensor Query

# Get sensor value
bash scripts/sensor.sh get sensor.temperature_outside
bash scripts/sensor.sh get sensor.humidity_living_room json

Call Service

Direct service call for advanced use:

# Generic service call
bash scripts/service.sh call \x3Cdomain> \x3Cservice> \x3Centity_id> '[{"key": "value"}]'

# Example: Set temperature via climate.set_temperature
bash scripts/service.sh call climate set_temperature climate.living_room '{"temperature": 73}'

Entity Discovery

If you don't know the entity ID:

# Find all climate entities
bash scripts/entities.sh climate

# Find entities by name (fuzzy search)
bash scripts/entities.sh search thermostat
bash scripts/entities.sh search temperature

Common Workflows

  1. "Make it cold" / "Turn on AC" → Find climate entity → Set to cool mode at desired temp
  2. "Turn off the lights" → List light entities → Turn off specific or all
  3. "What's the temperature?" → Query temperature sensor
  4. "Set thermostat to 73" → Set climate entity to 73°F

Error Handling

If the command fails:

  • Check HA is reachable: curl -s http://192.168.2.82:8123
  • Verify token is valid (regenerate if needed)
  • Confirm entity ID exists: bash scripts/entities.sh climate

Notes

  • HA URL: http://192.168.2.82:8123 (from MEMORY.md)
  • All calls use long-lived access token (no OAuth refresh needed)
  • Climate mode mappings: cool, heat, auto, off, heat_cool
  • Temperature unit follows HA configuration (°F for US)

Reference

安全使用建议
This skill appears to implement Home Assistant REST control and will read a long‑lived access token from ~/.openclaw/credentials/homeassistant.json and then call your HA API. Before installing or enabling it: 1) inspect or create the credentials file yourself (do not paste tokens into untrusted places) and be aware the token grants full control per HA permissions — treat it like a password and rotate it if needed; 2) note mismatches: the SKILL.md references scripts/service.sh which is missing, and climate.sh uses 'bc' but required binaries list only curl and jq — the package may be incomplete or poorly maintained; 3) ask the publisher for a homepage or source repo and for corrected metadata (declare config path and required binaries) or prefer a skill from a trusted source; 4) if you proceed, run in a safe environment (or on a non-critical HA instance) and limit token scope where possible. If the publisher provides an updated package (includes service.sh, declares the credentials file in metadata, and adds 'bc' to required binaries), my confidence that the package is coherent would increase.
功能分析
Type: OpenClaw Skill Name: ha-skill Version: 1.0.0 The Home Assistant skill provides functional integration for controlling smart home devices but contains significant security vulnerabilities in its implementation. Specifically, scripts/light.sh and scripts/switch.sh use manual string concatenation and sed to construct JSON payloads for API calls rather than using jq, which creates a risk of injection if entity IDs or parameters are maliciously crafted. While the behavior is consistent with the stated purpose, these vulnerabilities in input handling and JSON construction meet the threshold for a suspicious classification.
能力标签
requires-oauth-token
能力评估
Purpose & Capability
Name/description align with the included scripts: the skill uses curl + jq to call the Home Assistant REST API and implements climate, light, switch, and sensor actions, which is coherent with the claimed purpose. However, the SKILL/README expect credentials in ~/.openclaw/credentials/homeassistant.json but the registry metadata declares no required config paths or credentials — that's an omission/inconsistency.
Instruction Scope
Runtime instructions and the scripts read a long-lived HA access token from ~/.openclaw/credentials/homeassistant.json and make API calls to the configured URL. Reading that credentials file is within the skill's stated purpose (it needs a token), but the file path is not declared in the registry metadata. The SKILL.md also documents a scripts/service.sh helper and shows examples using it, but no scripts/service.sh exists in the package — a mismatch that could break functionality or indicate sloppy packaging.
Install Mechanism
No install spec (instruction-only) so nothing will be downloaded/executed at install time — lower risk. However the package includes shell scripts that will run locally when invoked; there is no automated installer but the presence of code files means review before use is prudent.
Credentials
The skill requests no environment variables in metadata but all scripts read a credentials file containing a long‑lived HA access token. That credential access is necessary for the stated purpose, but the registry should have declared the config path/credential requirement. Additionally, climate.sh uses bc for numeric comparison but 'bc' is not listed in required binaries — a missing dependency.
Persistence & Privilege
always is false and there is no install process that requests persistent system-wide privileges. The skill will only run when invoked and uses the user's credentials file; autonomous invocation is allowed (default) but not combined here with other high-privilege flags.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install ha-skill
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /ha-skill 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Renamed from clawd-homeassistant
元数据
Slug ha-skill
版本 1.0.0
许可证 MIT-0
累计安装 1
当前安装数 1
历史版本数 1
常见问题

HA Skill 是什么?

Control Home Assistant entities via REST API. Use when the user asks to control lights, climate, switches, or other HA entities. Supports climate (thermostat... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 84 次。

如何安装 HA Skill?

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

HA Skill 是免费的吗?

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

HA Skill 支持哪些平台?

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

谁开发了 HA Skill?

由 ricanwarfare(@ricanwarfare)开发并维护,当前版本 v1.0.0。

💬 留言讨论