← 返回
开发者工具 Key 中文

minos

Control Home Assistant devices, read sensors, and manage automations using the Python Bridge. Use when the user wants to interact with their smart home - tur...
通过 Python Bridge 控制 Home Assistant 设备、读取传感器及管理自动化。当用户欲与其智能家居交互时使用。
mischa-petschenig
开发者工具 clawhub v1.0.0 1 版本 100000 Key: 需要
★ 0
Stars
📥 645
下载
💾 16
安装
1
版本
#latest

概述

Home Assistant Skill (Python Bridge)

Integration with Home Assistant via Python Bridge for reliable smart home control.

Prerequisites

  • Home Assistant instance running (local or remote)
  • Long-lived access token from HA profile
  • Network connectivity to HA instance
  • Python 3 with requests module

Configuration

One-time setup:

cd /root/.openclaw/workspace/skills/home-assistant/scripts
./ha-setup.sh

This creates ~/.homeassistant.conf with your HA_URL and HA_TOKEN.

Load configuration:

source ~/.homeassistant.conf

Core Commands

All commands go through ha-bridge.py. Aliases are supported everywhere — use friendly names instead of entity IDs.

Device Control

python3 ha-bridge.py on <entity|alias>          # Turn on
python3 ha-bridge.py off <entity|alias>         # Turn off
python3 ha-bridge.py toggle <entity|alias>      # Toggle
python3 ha-bridge.py on <entity> --verify       # Turn on + verify state after 3s

Examples:

python3 ha-bridge.py on kitchen                 # Alias → switch.kitchen_light_relay
python3 ha-bridge.py off tv --verify            # Turn off + verify
python3 ha-bridge.py toggle bedroom             # Toggle bedroom light

Light Control

python3 ha-bridge.py light <entity|alias> --brightness <0-255>
python3 ha-bridge.py light <entity|alias> --color-temp <mireds>
python3 ha-bridge.py light <entity|alias> --rgb "255,0,0"

Examples:

python3 ha-bridge.py light bedroom --brightness 128
python3 ha-bridge.py light kitchen --rgb "255,200,100"

Climate Control

python3 ha-bridge.py climate <entity|alias> --temperature <value>
python3 ha-bridge.py climate <entity|alias> --mode <heat|cool|auto|off>

Scene Activation

python3 ha-bridge.py scene <scene_entity>

Read States

python3 ha-bridge.py states                     # All entities (JSON)
python3 ha-bridge.py state <entity|alias>       # Specific entity (JSON)

Search Entities

python3 ha-bridge.py search <query>             # Search by name or entity_id
python3 ha-bridge.py search licht               # Find all "licht" entities
python3 ha-bridge.py search temp --domain sensor  # Only sensors matching "temp"

History

python3 ha-bridge.py history <entity|alias>              # Last 24h
python3 ha-bridge.py history kitchen --hours 48           # Last 48h

Aliases

python3 ha-bridge.py aliases                    # Show all configured aliases

Aliases are stored in scripts/aliases.json. Edit directly to add/change/remove.

Services

python3 ha-bridge.py services                   # List all available HA services

Alias System

Aliases map friendly names to entity IDs. Stored in scripts/aliases.json:

{
  "kitchen": "switch.kitchen_light_relay",
  "bedroom": "light.bedroom_led_strip",
  "thermostat": "climate.living_room"
}

Use aliases anywhere an entity ID is expected.

Aliases

Aliases are stored in scripts/aliases.json. Copy scripts/aliases.example.json as starting point:

cp scripts/aliases.example.json scripts/aliases.json

Then edit with your own device mappings. Use python3 ha-bridge.py search to find entity IDs.

Status Delay Note

Home Assistant needs 1-3 seconds to update state after a command. Use --verify to auto-check after 3 seconds.

File Structure

skills/home-assistant/
├── SKILL.md                          # This file
├── README.md                         # Human-readable docs
├── scripts/
│   ├── ha-bridge.py                  # Main bridge (all commands)
│   ├── ha-setup.sh                   # One-time setup
│   ├── aliases.json                  # Your alias mappings (create from example)
│   └── aliases.example.json          # Example alias mappings
└── references/
    └── finding-entities.md           # How to find entity IDs

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-03-29 21:06 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

developer-tools

Gog

steipete
Google Workspace 命令行工具,支持 Gmail、日历、云端硬盘、通讯录、表格和文档。
★ 921 📥 185,808
developer-tools

CodeConductor.ai

larsonreever
AI驱动平台,提供快速全栈开发、智能体、工作流自动化及低代码AI集成的可扩展产品创建。
★ 68 📥 180,239
developer-tools

Github

steipete
使用 `gh` CLI 与 GitHub 交互,通过 `gh issue`、`gh pr`、`gh run` 和 `gh api` 管理议题、PR、CI 运行及高级查询。
★ 668 📥 324,236