Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

ha-automation

БесплатноБез исполняемых скриптовНе проверен

Automation YAML patterns, triggers, conditions, actions, and best practices for Home Assistant.

TheLobbiот TheLobbi★ 22 звезды на GitHub

Об этом скилле

Home Assistant Automation Skill

Automation YAML patterns, triggers, conditions, actions, and best practices for Home Assistant.

Activation Triggers

Activate this skill when:

  • Creating or modifying automations
  • Working with automation YAML
  • Designing trigger logic
  • Building condition chains
  • Creating action sequences

Automation Structure

# Complete automation template
alias: "Descriptive Name"
id: unique_automation_id  # Optional but recommended
description: "What this automation does and why"
mode: single  # single, restart, queued, parallel

# Variables available throughout
variables:
  room: "living_room"
  default_brightness: 80

trigger:
  - platform: state
    entity_id: binary_sensor.motion
    to: "on"
    id: motion_detected  # For use in choose

condition:
  - condition: sun
    after: sunset

action:
  - service: light.turn_on
    target:
      entity_id: "light.{{ room }}"
    data:
      brightness_pct: "{{ default_brightness }}"

Trigger Types

State Trigger

trigger:
  - platform: state
    entity_id: binary_sensor.door
    from: "off"
    to: "on"
    for:
      seconds: 30
    attribute: any  # Optional: trigger on attribute change

Time Trigger

trigger:
  - platform: time
    at: "06:30:00"

  # Multiple times
  - platform: time
    at:
      - "07:00:00"
      - "12:00:00"
      - "18:00:00"

  # Input datetime
  - platform: time
    at: input_datetime.wake_up_time

Time Pattern

trigger:
  - platform: time_pattern
    hours: "/2"  # Every 2 hours
    minutes: "30"

  - platform: time_pattern
    minutes: "/5"  # Every 5 minutes

Sun Trigger

trigger:
  - platform: sun
    event: sunset
    offset: "-01:00:00"  # 1 hour before sunset

Numeric State

trigger:
  - platform: numeric_state
    entity_id: sensor.temperature
    above: 75
    below: 85
    for:
      minutes: 5

Template Trigger

trigger:
  - platform: template
    value_template: >
      {{ states('sensor.power') | float > 1000 and
         is_state('input_boolean.high_power_alert', 'on') }}
    for:
      minutes: 5

Event Trigger

trigger:
  - platform: event
    event_type: mobile_app_notification_action
    event_data:
      action: "TURN_OFF_LIGHTS"

Device Trigger

trigger:
  - platform: device
    type: turned_on
    device_id: abc123def456
    entity_id: switch.smart_plug
    domain: switch

Webhook Trigger

trigger:
  - platform: webhook
    webhook_id: my_custom_webhook
    allowed_methods:
      - POST
    local_only: true

MQTT Trigger

trigger:
  - platform: mqtt
    topic: "home/doorbell/status"
    payload: "pressed"

Condition Types

State Condition

condition:
  - condition: state
    entity_id: input_boolean.guest_mode
    state: "off"

  # Multiple states (OR)
  - condition: state
    entity_id: alarm_control_panel.home
    state:
      - "armed_home"
      - "armed_away"

Numeric State

condition:
  - condition: numeric_state
    entity_id: sensor.battery
    above: 20

Time Condition

condition:
  - condition: time
    after: "22:00:00"
    before: "06:00:00"
    weekday:
      - mon
      - tue
      - wed
      - thu
      - fri

Sun Condition

condition:
  - condition: sun
    after: sunset
    before: sunrise
    after_offset: "-00:30:00"

Zone Condition

condition:
  - condition: zone
    entity_id: device_tracker.phone
    zone: zone.home

Template Condition

condition:
  - condition: template
    value_template: >
      {{ now().month in [6, 7, 8] }}  # Summer months

Logical Operators

condition:
  - condition: and
    conditions:
      - condition: state
        entity_id: input_boolean.vacation
        state: "off"
      - condition: or
        conditions:
          - condition: state
            entity_id: person.john
            state: "home"
          - condition: state
            entity_id: person.jane
            state: "home"

Action Patterns

Service Call

action:
  - service: light.turn_on
    target:
      entity_id: light.kitchen
    data:
      brightness_pct: 100
      transition: 2

Dynamic Targets

action:
  - service: light.turn_on
    target:
      entity_id: >
        {{ expand('group.all_lights')
           | selectattr('state', 'eq', 'on')
           | map(attribute='entity_id')
           | list }}

Delay & Wait

action:
  - delay:
      seconds: 30

  - wait_for_trigger:
      - platform: state
        entity_id: binary_sensor.door
        to: "off"
    timeout:
      minutes: 5
    continue_on_timeout: true

  - wait_template: "{{ is_state('lock.front', 'locked') }}"
    timeout: "00:01:00"

Choose (If/Else)

action:
  - choose:
      - conditions:
          - condition: state
            entity_id: sun.sun
            state: "bel
Полный SKILL.md на GitHub

Установить ha-automation в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл ha-automation?

Automation YAML patterns, triggers, conditions, actions, and best practices for Home Assistant.

Как установить скилл ha-automation?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл ha-automation запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить ha-automation с