重要前提
安装AI Skills的关键前提是:必须科学上网,且开启TUN模式,这一点至关重要,直接决定安装能否顺利完成,在此郑重提醒三遍:科学上网,科学上网,科学上网。查看完整安装教程 →
ha-automations by laurigates/claude-plugins
npx skills add https://github.com/laurigates/claude-plugins --skill ha-automations| 在以下情况下使用此技能... | 在以下情况下请改用 ha-configuration... |
|---|---|
| 创建自动化规则 | 编辑 configuration.yaml |
| 编写触发器/条件/动作 | 设置集成 |
| 处理脚本和场景 | 管理密钥 |
| 使用蓝图 | 组织包 |
| 设备触发器设置 | 通用 YAML 配置 |
automation:
- id: "unique_automation_id"
alias: "Descriptive Name"
description: "What this automation does"
mode: single # single, restart, queued, parallel
trigger:
- platform: state
entity_id: binary_sensor.motion
to: "on"
condition:
- condition: time
after: "08:00:00"
before: "22:00:00"
action:
- service: light.turn_on
target:
entity_id: light.living_room
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
trigger:
# 基本状态变化
- platform: state
entity_id: binary_sensor.door
to: "on"
from: "off"
# 带持续时间
- platform: state
entity_id: binary_sensor.motion
to: "off"
for:
minutes: 5
# 属性变化
- platform: state
entity_id: climate.thermostat
attribute: current_temperature
trigger:
# 特定时间
- platform: time
at: "07:00:00"
# 输入日期时间
- platform: time
at: input_datetime.alarm_time
# 时间模式(每小时)
- platform: time_pattern
hours: "*"
minutes: 0
seconds: 0
# 每15分钟
- platform: time_pattern
minutes: "/15"
其他触发器类型(数值状态、太阳、设备、事件、webhook、模板、区域)记录在 REFERENCE.md 中。
condition:
# 单个实体
- condition: state
entity_id: binary_sensor.door
state: "off"
# 允许多种状态
- condition: state
entity_id: alarm_control_panel.home
state:
- armed_home
- armed_away
# 检查持续时间
- condition: state
entity_id: binary_sensor.motion
state: "off"
for:
minutes: 10
condition:
# 时间范围
- condition: time
after: "08:00:00"
before: "22:00:00"
# 仅工作日
- condition: time
weekday:
- mon
- tue
- wed
- thu
- fri
# 组合条件
- condition: time
after: "09:00:00"
before: "17:00:00"
weekday:
- mon
- tue
- wed
- thu
- fri
其他条件类型(数值状态、太阳、模板、区域、逻辑、简写)记录在 REFERENCE.md 中。
action:
# 基本服务调用
- service: light.turn_on
target:
entity_id: light.living_room
data:
brightness_pct: 80
color_temp: 350
# 多个目标
- service: light.turn_off
target:
entity_id:
- light.bedroom
- light.bathroom
area_id: upstairs
action:
- service: light.turn_on
target:
entity_id: light.living_room
# 固定延迟
- delay:
seconds: 30
# 等待触发器
- wait_for_trigger:
- platform: state
entity_id: binary_sensor.motion
to: "off"
timeout:
minutes: 5
continue_on_timeout: true
# 等待模板
- wait_template: "{{ is_state('light.bedroom', 'off') }}"
timeout: "00:05:00"
action:
- if:
- condition: state
entity_id: binary_sensor.motion
state: "on"
then:
- service: light.turn_on
target:
entity_id: light.hallway
else:
- service: light.turn_off
target:
entity_id: light.hallway
关于高级动作模式(选择、重复、变量、并行执行)、脚本、场景和常见自动化模式,请参阅 REFERENCE.md。
| 模式 | 行为 |
|---|---|
single | 运行时忽略新触发器 |
restart | 停止当前运行,启动新的运行 |
queued | 排队最多 max 次运行 |
parallel | 并行运行最多 max 次 |
automation:
- alias: "Motion Light"
mode: restart
max: 10 # 用于 queued/parallel 模式
max_exceeded: silent # silent, warning, error
| 上下文 | 命令 |
|---|---|
| 查找自动化 | grep -r "alias:" config/automations.yaml |
| 查找触发器 | grep -r "platform: state" config/ --include="*.yaml" |
| 列出脚本 | grep -r "^ [a-z_]*:" config/scripts.yaml |
| 查找场景 | grep -r "^ - name:" config/scenes.yaml |
| 检查自动化ID | grep -r "^ - id:" config/automations.yaml |
每周安装量
55
仓库
GitHub 星标数
19
首次出现
2026年2月9日
安全审计
安装于
opencode55
gemini-cli55
github-copilot55
codex55
amp55
kimi-cli55
| Use this skill when... | Use ha-configuration instead when... |
|---|---|
| Creating automation rules | Editing configuration.yaml |
| Writing triggers/conditions/actions | Setting up integrations |
| Working with scripts and scenes | Managing secrets |
| Using blueprints | Organizing packages |
| Device trigger setup | General YAML configuration |
automation:
- id: "unique_automation_id"
alias: "Descriptive Name"
description: "What this automation does"
mode: single # single, restart, queued, parallel
trigger:
- platform: state
entity_id: binary_sensor.motion
to: "on"
condition:
- condition: time
after: "08:00:00"
before: "22:00:00"
action:
- service: light.turn_on
target:
entity_id: light.living_room
trigger:
# Basic state change
- platform: state
entity_id: binary_sensor.door
to: "on"
from: "off"
# With duration
- platform: state
entity_id: binary_sensor.motion
to: "off"
for:
minutes: 5
# Attribute change
- platform: state
entity_id: climate.thermostat
attribute: current_temperature
trigger:
# Specific time
- platform: time
at: "07:00:00"
# Input datetime
- platform: time
at: input_datetime.alarm_time
# Time pattern (every hour)
- platform: time_pattern
hours: "*"
minutes: 0
seconds: 0
# Every 15 minutes
- platform: time_pattern
minutes: "/15"
Other trigger types (numeric state, sun, device, event, webhook, template, zone) are documented in REFERENCE.md.
condition:
# Single entity
- condition: state
entity_id: binary_sensor.door
state: "off"
# Multiple states allowed
- condition: state
entity_id: alarm_control_panel.home
state:
- armed_home
- armed_away
# Check for duration
- condition: state
entity_id: binary_sensor.motion
state: "off"
for:
minutes: 10
condition:
# Time range
- condition: time
after: "08:00:00"
before: "22:00:00"
# Weekdays only
- condition: time
weekday:
- mon
- tue
- wed
- thu
- fri
# Combined
- condition: time
after: "09:00:00"
before: "17:00:00"
weekday:
- mon
- tue
- wed
- thu
- fri
Other condition types (numeric state, sun, template, zone, logical, shorthand) are documented in REFERENCE.md.
action:
# Basic service call
- service: light.turn_on
target:
entity_id: light.living_room
data:
brightness_pct: 80
color_temp: 350
# Multiple targets
- service: light.turn_off
target:
entity_id:
- light.bedroom
- light.bathroom
area_id: upstairs
action:
- service: light.turn_on
target:
entity_id: light.living_room
# Fixed delay
- delay:
seconds: 30
# Wait for trigger
- wait_for_trigger:
- platform: state
entity_id: binary_sensor.motion
to: "off"
timeout:
minutes: 5
continue_on_timeout: true
# Wait for template
- wait_template: "{{ is_state('light.bedroom', 'off') }}"
timeout: "00:05:00"
action:
- if:
- condition: state
entity_id: binary_sensor.motion
state: "on"
then:
- service: light.turn_on
target:
entity_id: light.hallway
else:
- service: light.turn_off
target:
entity_id: light.hallway
For advanced action patterns (choose, repeat, variables, parallel execution), scripts, scenes, and common automation patterns, see REFERENCE.md.
| Mode | Behavior |
|---|---|
single | Ignore new triggers while running |
restart | Stop current run, start new |
queued | Queue up to max runs |
parallel | Run up to max in parallel |
automation:
- alias: "Motion Light"
mode: restart
max: 10 # For queued/parallel
max_exceeded: silent # silent, warning, error
| Context | Command |
|---|---|
| Find automation | grep -r "alias:" config/automations.yaml |
| Find triggers | grep -r "platform: state" config/ --include="*.yaml" |
| List scripts | grep -r "^ [a-z_]*:" config/scripts.yaml |
| Find scenes | grep -r "^ - name:" config/scenes.yaml |
| Check automation IDs | grep -r "^ - id:" config/automations.yaml |
Weekly Installs
55
Repository
GitHub Stars
19
First Seen
Feb 9, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
opencode55
gemini-cli55
github-copilot55
codex55
amp55
kimi-cli55
Skills CLI 使用指南:AI Agent 技能包管理器安装与管理教程
52,700 周安装